
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi - as subject says im trying to write a MEL script which goes through selection and looks for a certain custom attribute called DT_decoID. Since FBX exporter only exports transform node attributes I want to copy the DT_decoID value to a new attribute on the transform node called DecoForMax.
It kinda works, but in situations where two objects have the exact same name it get a
"Cannot evaluate more than one attribute" error. As Im very noob in MEL I was wondering if anyone has a good direction for me
br
Chr
CODE
{
//Lists the transform nodes of all selected objects in the scene
string $nodes[] = `ls -selection`;
for ($node in $nodes)
{
//From each transform node, obtain its shape node
string $shapes[] = `listRelatives -children $node`;
for ($shape in $shapes)
{
int $deco = `getAttr ($shape +".DTdecoID[1]")`;
if($deco != 0){
addAttr -ln "DecoForMax" -at long -dv 0 $node;
setAttr ($node +".DecoForMax") $deco;
}
}
}
}
Solved! Go to Solution.