This command creates a named itemFilterAttr object. This object can be attached to editors, in order to filter the attributes going through them. Using union and intersection filters, complex composite filters can be created.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
byName (bn) | unicode | ||
The filter will only pass items whose names match the given regular expression string. This string can contain the special characters * and ?. ‘?’ matches any one character, and ‘*’ matches any substring. |
|||
byNameString (bns) | unicode | ||
The filter will only pass items whose names match the given string. This is a multi-use flag which allows the user to specify several strings. The filter will pass items that match any of the strings. |
|||
byScript (bs) | unicode | ||
The filter will run a MEL script named by the given string on each attribute name. Attributes will pass the filter if the script returns a non-zero value. The script name string must be the name of a proc whose signature is:global proc int procName( string $nodeName string $attrName ) |
|||
classification (cls) | unicode | ||
|
|||
dynamic (dy) | bool | ||
exists (ex) | bool | ||
hasCurve (hc) | bool | ||
|
|||
hasDrivenKey (hdk) | bool | ||
|
|||
hasExpression (he) | bool | ||
|
|||
hidden (h) | bool | ||
|
|||
intersect (intersect) | unicode, unicode | ||
The filter will consist of the intersection of two other filters, whose names are the given strings. Attributes will pass this filter if and only if they pass both of the contained filters. |
|||
keyable (k) | bool | ||
|
|||
listBuiltInFilters (lbf) | bool | ||
|
|||
listOtherFilters (lof) | bool | ||
Returns an array of all attribute filters with classification “other”.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
listUserFilters (luf) | bool | ||
|
|||
negate (neg) | bool | ||
|
|||
parent (p) | unicode | ||
|
|||
published (pub) | bool | ||
|
|||
readable (r) | bool | ||
|
|||
scaleRotateTranslate (srt) | bool | ||
|
|||
secondScript (ss) | unicode | ||
Can be used in conjunction with the -bs flag. The second script is for filtering whole lists at once, rather than individually. Its signature must be:global proc string[] procName( string[] $nodeName string[] $attrName )It should take in a list of attributes, and return a filtered list of attributes. |
|||
text (t) | unicode | ||
|
|||
union (un) | unicode, unicode | ||
The filter will consist of the union of two other filters, whose names are the given strings. Attributes will pass this filter if they pass at least one of the contained filters. |
|||
writable (w) | bool | ||
|
Derived from mel command maya.cmds.itemFilterAttr
Example:
import pymel.core as pm
import maya.cmds as cmds
# Create a filter that will pass all the SRT (scale-rotate-translate)
# attributes.
#
srtFilter = pm.itemFilterAttr('itemFilterAttr', scaleRotateTranslate=True)
# Create a filter that will pass all the attributes driven by an
# expression.
#
exprFilter = pm.itemFilterAttr(hasExpression=True)
# Create a filter that will pass all the SRT attributes driven by an
# expression (intersect two previous ones).
#
srtExprFilter = pm.itemFilterAttr(intersect=(srtFilter, exprFilter))
# Delete the filters when done with them.
#
pm.delete( srtFilter, exprFilter, srtExprFilter )