View Full Version : query if an attribute is muted?

07 July 2007, 10:51 AM
It there a way to query if an attribute is muted?
Would help me quite a lot...



07 July 2007, 05:44 PM
Well, I don't believe there's a command to directly query this. Someone please correct me if there is... But you can write a simple enough procedure to do it for you:

global proc int isAttrMuted( string $strObjAttr )
// List connection source nodes of the type "mute"
string $strSourceNode[] = `listConnections -s 1 -t "mute" $strObjAttr`;
// If connected to a "mute" node, array will have a size greater than 0
if (size($strSourceNode) > 0)
// Query the value of the mute attr, and return it
return `getAttr ($strSourceNode[0] + ".mute")`;

// If no "mute" connections found, then the attribute is not muted.
return 0;

So you can use this to query an object.attr: isAttrMuted "pSphere1.rotateX";

Returns a 1 if muted and a 0 if not. :thumbsup:

CGTalk Moderation
07 July 2007, 05:44 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.