PDA

View Full Version : Need Help in MEL Script


Ajithanim
12-27-2010, 10:42 PM
Hi all,
I created a poly sphere and a poly cylinder and assigned those names into a variable

//This is my script

string $test= "pSphere1";
string $testb= "pCube1";

connectAttr -f $test.rotate $testb.rotate;

//End

But I couldn't successfully connect the attributes and error is coming up..

//Error: Invalid object or value: pCube1 //

can any one please tell how can I connect attributes of of objects assigned through variables.

The variables are working with all the other set of commands like e.g. select

but when used in connectAttr its not working. Thanks in advance....:cool:

NaughtyNathan
12-28-2010, 05:34 PM
.rotate is a literal "string". $test is a variable. you cannot inline catenate variables and strings directly in MEL without using + and brackets (braces):

connectAttr -f ($test + ".rotate") ($testb + ".rotate");
:nathaN

Ajithanim
12-28-2010, 06:40 PM
Thanks u very much Nathan..it worked :thumbsup:

CGTalk Moderation
12-28-2010, 06:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.