PDA

View Full Version : MEL: How to query an attribute?


niic
09-21-2009, 10:27 AM
Hi all,

I'm learning some MEL for rigging and I am wondering how you would query an attribute - attributeQuery?

I am trying to find out what my IK Handles pole vectors are set at:
So I am trying to query L_Ankle_IK_handle.poleVectorX;

I am reading through some MEL ref manuals but I am new to programming and the syntax I am unsure of. Any help woulf be great!

Cheers
Nick.

Irakli
09-21-2009, 11:08 AM
Use getAttr command
float $polVecValx = `getAttr L_Ankle_IK_handle.poleVectorX`;

niic
09-21-2009, 04:46 PM
Hey mate,

Great! Thank you for that. So to get at any attribute and display it in the Script Ed. or print it out to the results line you need to dump it into a var first!?

Cheers
Nick.

Irakli
09-21-2009, 08:13 PM
If you want to use this value - yes you need to cast it on variable. If just for know the value you can use just
getAttr L_Ankle_IK_handle.poleVectorX;

niic
09-22-2009, 10:54 AM
Great many thanks!!

CGTalk Moderation
09-22-2009, 10:54 AM
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.