Go to: Synopsis. Return value. Keywords.
Related. Flags.
Python examples.
affects(string, [by=boolean], [type=string])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
affects is NOT undoable, NOT queryable, and NOT
editable.
This command gets the list of attributes on a node or node type
that are affected by the named attribute.
string |
List of affected/affecting attributes |
attribute, node, class, dg
affectedNet, listConnections
by, type
Long name (short name) |
Argument types |
Properties |
by() |
boolean |
|
|
Show attributes that are affected by the given one rather than
the ones that it affects. |
|
type(t) |
string |
|
|
static node type from which to get 'affects' information |
|
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
# List the attributes on node "sphere" that affect the "tx" attribute
cmds.sphere( n='sphere' )
cmds.affects( 'tx', 'sphere' )
# List the attributes on nodes of type "transform" that are affected by
# the "ty" attribute
cmds.affects( 'ty', by=True, t='transform' )
# List the attributes on nodes of type "revolve" that affect the
# "outputSurface" attribute
cmds.affects( 'outputSurface', t='revolve' )