Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.
attributeQuery [-affectsAppearance] [-affectsWorldspace] [-attributeType] [-cachedInternally] [-categories] [-channelBox] [-connectable] [-enum] [-exists] [-hidden] [-indeterminant] [-indexMatters] [-internal] [-internalGet] [-internalSet] [-keyable] [-listChildren] [-listDefault] [-listEnum] [-listParent] [-listSiblings] [-longName] [-maxExists] [-maximum] [-message] [-minExists] [-minimum] [-multi] [-niceName] [-node name] [-numberOfChildren] [-range] [-rangeExists] [-readable] [-renderSource] [-shortName] [-softMax] [-softMaxExists] [-softMin] [-softMinExists] [-softRange] [-softRangeExists] [-storable] [-type string] [-typeExact string] [-usedAsColor] [-usedAsFilename] [-usesMultiBuilder] [-worldspace] [-writable]
attributeQuery is NOT undoable, NOT queryable, and NOT editable.
attributeQuery returns information about the configuration of an attribute. It handles both boolean flags, returning true or false, as well as other return values. Specifying more than one boolean flag will return the logical "and" of all the specified boolean flags. You may not specify any two flags when both do not provide a boolean return type. (eg. "-internal -hidden" is okay but "-range -hidden" or "-range -softRange" is not.)float[] | when querying ranges or default values |
boolean | when querying attribute flags |
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
-affectsAppearance(-aa)
|
|
|||
|
||||
-affectsWorldspace(-aws)
|
|
|||
|
||||
-attributeType(-at)
|
|
|||
|
||||
-cachedInternally(-ci)
|
|
|||
|
||||
-categories(-ct)
|
|
|||
|
||||
-channelBox(-ch)
|
|
|||
|
||||
-connectable(-c)
|
|
|||
|
||||
-enum(-e)
|
|
|||
|
||||
-exists(-ex)
|
|
|||
|
||||
-hidden(-h)
|
|
|||
|
||||
-indeterminant(-idt)
|
|
|||
|
||||
-indexMatters(-im)
|
|
|||
|
||||
-internal(-i)
|
|
|||
|
||||
-internalGet(-ig)
|
|
|||
|
||||
-internalSet(-is)
|
|
|||
|
||||
-keyable(-k)
|
|
|||
|
||||
-listChildren(-lc)
|
|
|||
|
||||
-listDefault(-ld)
|
|
|||
|
||||
-listEnum(-le)
|
|
|||
|
||||
-listParent(-lp)
|
|
|||
|
||||
-listSiblings(-ls)
|
|
|||
|
||||
-longName(-ln)
|
|
|||
|
||||
-maxExists(-mxe)
|
|
|||
|
||||
-maximum(-max)
|
|
|||
|
||||
-message(-msg)
|
|
|||
|
||||
-minExists(-mne)
|
|
|||
|
||||
-minimum(-min)
|
|
|||
|
||||
-multi(-m)
|
|
|||
|
||||
-niceName(-nn)
|
|
|||
|
||||
-node(-n)
|
name
|
|||
|
||||
-numberOfChildren(-nc)
|
|
|||
|
||||
-range(-r)
|
|
|||
|
||||
-rangeExists(-re)
|
|
|||
|
||||
-readable(-rd)
|
|
|||
|
||||
-renderSource(-rs)
|
|
|||
|
||||
-shortName(-sn)
|
|
|||
|
||||
-softMax(-smx)
|
|
|||
|
||||
-softMaxExists(-sxe)
|
|
|||
|
||||
-softMin(-smn)
|
|
|||
|
||||
-softMinExists(-sme)
|
|
|||
|
||||
-softRange(-s)
|
|
|||
|
||||
-softRangeExists(-se)
|
|
|||
|
||||
-storable(-st)
|
|
|||
|
||||
-type(-typ)
|
string
|
|||
|
||||
-typeExact(-tex)
|
string
|
|||
|
||||
-usedAsColor(-uac)
|
|
|||
|
||||
-usedAsFilename(-uaf)
|
|
|||
|
||||
-usesMultiBuilder(-umb)
|
|
|||
|
||||
-worldspace(-ws)
|
|
|||
|
||||
-writable(-w)
|
|
|||
|
Flag can appear in Create mode of command | Flag can appear in Edit mode of command |
Flag can appear in Query mode of command | Flag can be used more than once in a command. |
// Determine the hidden status of the "selector" attribute on choice nodes. // attributeQuery -typ choice -h selector; // Result: 0 // Determine the hidden status of the "selector" attribute on this choice node. // (Usually the same but you can do this for dynamic attributes too.) // createNode choice -n whoIsIt; // Result: choice1 attributeQuery -n whoIsIt -h selector; // Result: 0 // Determine the range of the selector value on choice nodes. // In this case there is no range. // Note, if there is only a minimum or only a maximum range will not set. // attributeQuery -typ choice -range selector; // For the next several examples create a poly cube and add extra attributes. polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1; addAttr -ln egRange -at long -min 0 -max 5 -dv 2 |pCube1; setAttr -e -keyable false |pCube1.egRange; // Determine if an attribute is keyable // attributeQuery -node "pCube1" -k "egRange"; // Result: 0 // Determine the minimum and maximum values of the added attribute egRange // attributeQuery -node "pCube1" -range "egRange"; // Result: 0 5 // Determine if there is a minimum for the attribute. // Note, having a minimum or maximum value does not imply the attribute has a range. addAttr -ln egMin -at long -min 2 |pCube1; attributeQuery -node "pCube1" -minExists "egMin"; // Result: 1 attributeQuery -node "pCube1" -maxExists "egMin"; // Result: 0 attributeQuery -node "pCube1" -min "egMin"; // Result: 2 // Determine if an attribute is an enum // List the enum strings. This will use ':' as a separator like the attr is written in // an .ma file. addAttr -ln myEnum -at "enum" -en "chicken:turkey:duck:" |pCube1 -ct "fowl"; attributeQuery -node "pCube1" -listEnum "myEnum"; // Result: chicken:turkey:duck // // Secondary way to find an attribute's type directly attributeQuery -node "pCube1" -attributeType "myEnum"; // Result: enum // // See to which categories and attribute belongs attributeQuery -node "pCube1" -categories "myEnum"; // Result: fowl //