PDA

View Full Version : Help! Maya won't rename all of my object's name in my expression!!?


Don3Don
12-12-2002, 03:39 AM
Hi all,
I have a really serious problems...... That is when I reference a scene with expression with add all nodes a prefix.....Maya won't rename all the object's name in my expression. All name in () or " " won't be change. How can I fix this? or....any idea....?

this example: (reference with added prefix A)

$wof = A_milk.waveOffsetFrame;
A_waterSurface.rotateX =(
(`getAttr -time (frame-$wof) Control.rotateX`)*1

maya helps to rename the "milk" to "A_milk"
while maya leave "Control" for me to reanme it to "A_Control" by hand?
:surprised :surprised :surprised

forgive my poor english....

artifish
12-12-2002, 09:15 AM
one way is to store the prefix in a custom variable in an appropriate node of your referenced objects, you can change the variable when referencing the objects to the prefix you actually use. you've got to write your expression so that it take the variable into account.
eg:

// get prefix, rember to add any special characters like "_" or ":"
string $prefix = myNode.prefix;

waterSurface.rotateX = eval ("getAttr "+$prefix+"Control.rotateX");

Don3Don
12-12-2002, 04:09 PM
Thanks artifish

If I guess right.. you mean to add an extra attribute call "prefix" and change my expression to add this "prefix" b4 all the objects name in my expression. Than after I reference my scene. I can type my "prefix" name once for all the reference objects name in my expresision..?
But. that I need to type every reference....?
and is it only for maya4.0? cause maya3.0 can't add a "string" attribute.

and is that normal for everyone? Do I have a way to let maya change all the name in my expression?

artifish
12-12-2002, 04:41 PM
Originally posted by 3don
Thanks artifish

If I guess right.. you mean to add an extra attribute call "prefix" and change my expression to add this "prefix" b4 all the objects name in my expression. Than after I reference my scene. I can type my "prefix" name once for all the reference objects name in my expresision..?
yes, that's exactly the idea!

But. that I need to type every reference....?
yes, I would do this with a script ... reference the object with the "file" command, then do a "setAttr" on the referenced object once you imported it

and is it only for maya4.0? cause maya3.0 can't add a "string" attribute...
sorry, can't give any insights on this, as I am on 4.0 and have no experience with 3.0, but I guess there must be a way to concat strings there, too

and is that normal for everyone? Do I have a way to let maya change all the name in my expression?
if there is an easier way (apart from not using any mel in expressions) I'd sure like to know this, too

alexx
12-12-2002, 06:48 PM
Originally posted by artifish
sorry, can't give any insights on this, as I am on 4.0 and have no experience with 3.0, but I guess there must be a way to concat strings there, too


concattenating strings works since maya 1.0.
but i think he means, that you are not able adding a string attribute to a node..
i think (as far as i can remember) that was an interface problem..
you can add string attributes by using the mel command (addAttr i think it was - no maya here sorry) to create it..
i think that radio button is missing in the interface :surprised

cheers

alexx

CGTalk Moderation
01-13-2006, 11:00 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.