Go to: Synopsis. Return value. Flags. Python examples.
itemFilterAttr(
[string]
, [byName=string], [byNameString=string], [byScript=string], [classification=string], [hasCurve=boolean], [hasDrivenKey=boolean], [hasExpression=boolean], [hidden=boolean], [intersect=[string, string]], [keyable=boolean], [listBuiltInFilters=boolean], [listOtherFilters=boolean], [listUserFilters=boolean], [negate=boolean], [parent=string], [published=boolean], [readable=boolean], [scaleRotateTranslate=boolean], [secondScript=string], [text=string], [union=[string, string]], [writable=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
itemFilterAttr is undoable, queryable, and editable.
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.
In query mode, return type is based on queried flag.
byName, byNameString, byScript, classification, hasCurve, hasDrivenKey, hasExpression, hidden, intersect, keyable, listBuiltInFilters, listOtherFilters, listUserFilters, negate, parent, published, readable, scaleRotateTranslate, secondScript, text, union, writable
Long name (short name) |
Argument types |
Properties |
|
byName(bn)
|
string
|
|
|
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.
This flag cannot be used in conjunction with the -byScript or -secondScript flags.
|
|
byNameString(bns)
|
string
|
|
|
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.
This flag cannot be used in conjunction with the -byScript or -secondScript flags.
|
|
byScript(bs)
|
string
|
|
|
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 )
This flag cannot be used in conjunction with the -byName or -byNameString flags.
|
|
classification(cls)
|
string
|
|
|
Indicates whether the filter is a built-in or user filter.
The string argument must be either "builtIn" or "user".
The "other" filter classification is deprecated. Use "user"
instead.
Filters created by Maya should be classified as "builtIn".
Filters created by plugins or user scripts should be classified
as "user".
Filters will not be deleted by a file new. Filter nodes will
be hidden from the UI (ex: Attribute Editor, Hypergraph etc) and
will not be accessible from the command-line.
|
|
hasCurve(hc)
|
boolean
|
|
|
The filter will only pass attributes that are driven by animation
curves.
|
|
hasDrivenKey(hdk)
|
boolean
|
|
|
The filter will only pass attributes that are driven by driven keys
|
|
hasExpression(he)
|
boolean
|
|
|
The filter will only pass attributes that are driven by expressions
|
|
hidden(h)
|
boolean
|
|
|
The filter will only pass attributes that are hidden to the user
|
|
intersect(intersect)
|
[string, string]
|
|
|
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)
|
boolean
|
|
|
The filter will only pass attributes that are keyable
|
|
listBuiltInFilters(lbf)
|
boolean
|
|
|
Returns an array of all attribute filters with classification "builtIn".
|
|
listOtherFilters(lof)
|
boolean
|
|
|
The "other" classification has been deprecated. Use "user" instead.
Returns an array of all attribute filters with classification "other".
|
|
listUserFilters(luf)
|
boolean
|
|
|
Returns an array of all attribute filters with classification "user".
|
|
negate(neg)
|
boolean
|
|
|
This flag can be used to cause the filter to invert itself,
and reverse what passes and what fails.
|
|
parent(p)
|
string
|
|
|
This flag is no longer supported.
|
|
published(pub)
|
boolean
|
|
|
The filter will only pass attributes that are published on the container.
|
|
readable(r)
|
boolean
|
|
|
The filter will only pass attributes that are readable (outputs)
|
|
scaleRotateTranslate(srt)
|
boolean
|
|
|
The filter will show only SRT attributes: scale, rotate, translate and
their children
|
|
secondScript(ss)
|
string
|
|
|
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.
This flag cannot be used in conjunction with the -byName or -byNameString flags.
|
|
text(t)
|
string
|
|
|
Defines an annotation string to be stored with the filter
|
|
union(un)
|
[string, string]
|
|
|
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)
|
boolean
|
|
|
The filter will only pass attributes that are writable (inputs)
|
|
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 have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
# Create a filter that will pass all the SRT (scale-rotate-translate)
# attributes.
#
srtFilter = cmds.itemFilterAttr('itemFilterAttr', scaleRotateTranslate=True)
# Create a filter that will pass all the attributes driven by an
# expression.
#
exprFilter = cmds.itemFilterAttr(hasExpression=True)
# Create a filter that will pass all the SRT attributes driven by an
# expression (intersect two previous ones).
#
srtExprFilter = cmds.itemFilterAttr(intersect=(srtFilter, exprFilter))
# Delete the filters when done with them.
#
cmds.delete( srtFilter, exprFilter, srtExprFilter )