PDA

View Full Version : what are these pipe characters doing in my code? is it a bug?


torebjerkan
11-05-2006, 05:49 PM
Well I added a custom attribute test to my object(a joint in this case). Then the script editor echoed back this:

addAttr -ln test -at double -min 0.1 -max 1 |LHip|LKnee;
setAttr -e -keyable true |LHip|LKnee.test;

Notice the pipe characters(denoted in green color). Is this proper syntax? or is this a bug? I've run into the pipe a couple of times before in the expression editor. Then it was considered a bug. Is it still? If I was to reuse this code with pipes in a mel script would it work? If this is a bug what does the pipe characters really translate to.

Adam
11-05-2006, 07:52 PM
this is considered maya's long name. It does this to allow a person to name two object under differnt parents to have the same name in the outliner but have a unquie name in code by tracing out the models higherarchy and making that its "long name". the | is used to show one object is the parent of another. This makes it possible to refer to one of the two models even though they are named the same in say the outliner or hypergraph or any other UI element. If you want an example you can use this code/command on a selection to see the items long names.

ls -long -selection;

Hope this helps.

meljunky
11-07-2006, 02:24 PM
The long name only comes into play with multiple objects with the same name like Adam said, but when using the addAttr command you can omit the long name provided their is only one node that has that name. Sometimes the shape nodes get the same name as other nodes.

addAttr -ln test -at double -min 0.1 -max 1 -k 1 LKnee;

You can also embed the keyable command inside the addAttr command.

-brian
www.meljunky.com (http://www.meljunky.com/)

CGTalk Moderation
11-07-2006, 02:24 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.