connecting attributes
hi,
I dont get the right syntax for this little script for linking custom attributes. I have a locator with added attributes - schalA...schalH. I need to connect the schalA to 35 object´s zRotation. please view my script and lend a helping hand for ($i = 0; $i <= 35; ++$i) { $object_a = "schalA_" + $i; eval select -r $object_a; $object_b = "locator1" ; eval select -add $object_b; //commando connectAttr -f "object_b" + ".rotateZ" object_a.rotateZ; } the schal_objects are deep down a hierarchy. hope that´s not the problem. thx in advance |
Hello.
Just wondering, 'ave you tried replacing the line "connectAttr -f object_b object_a.rotateZ;" with "connectAttr -f $object_b $object_a.rotateZ;" I reckon you're prob is a missing dollar sign (whatever the name for that is in the syntax). I'm guessin they're variables you've defined in the mel code from the way you refference them. Since execution's making it past the other two refferences to them, I reckon that's your prob. Simon |
for ($i = 0; $i <= 35; ++$i)
{ $object_a = "schalA_" + $i; eval select -r $object_a; $object_b = "locator1" ; eval select -add $object_b; //commando eval("connectAttr -f locator1.schalA schalA_" + $i + ".rotateZ"); } |
thx for your help enhzflep,
this is working now for ($i = 0; $i <= 16; ++$i) { $object_a = "schalB_" + $i; $object_b = "locator1" ; eval select -add $object_b; //commando eval("connectAttr -f locator1.schalB schalB_" + $i + ".rotateZ;"); } |
you don't need all those eval statements:
for ($i = 0; $i <= 16; ++$i) { $object_a = ("schalB_" + $i); $object_b = "locator1" ; select -add $object_b; //commando connectAttr -f "locator1.schalB" ($object_a + ".rotateZ"); } this will work better :ninja: A |
thx for reply Pure!
|
All times are GMT. The time now is 04:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018