paya.runtime.nodes.DependNode#
- class DependNode(*args, **kwargs)#
Inheritance
DependNode
PyNode
ProxyUnicode
- setSubtype(clsname)#
Initialises and populates the
payaSubtype
attribute.Note
This does not modify class assignment. To switch to the specified type, follow this up with
asSubtype()
.- Parameters
clsname (str) – the subtype class name
- Returns
self
- Return type
- getSubtype()#
- Returns
The contents of the
payaSubtype
attribute, if present and populated, otherwiseNone
.- Return type
str
,None
- getSubtypeClass(*name)#
If this node has a configured
payaSubtype
attribute, and a subtypes pool is defined for this node type, attempts to retrieve the class.If the operation fails, explanatory warnings are issued and
None
is returned.
- asSubtype(*name)#
If this node has a configured
payaSubtype
attribute, and a subtypes pool is defined for this node type, attempts to retrieve the class and assign it to this instance.This is an in-place operation, but
self
is returned for convenience. If the operation fails, explanatory warnings are issued and reassignment is skipped.- Parameters
*name (str) – an optional override for the class name; if provided, no attempt will be made to access the
payaSubtype
attribute- Returns
self
- Return type
- makeName(*elems, inherit=True, padding=<undefined>, suffix=<undefined>)#
Constructs a node name based on
Name
contexts. Results will vary depending on whether this method is called on:A class
A transform instance with a controller tag
A transform instance with shapes
A transform instance without shapes
A shape instance
Any other kind of node instance
- Alias
mn
- Returns
The constructed node name.
- Return type
- rename(*name, **kwargs)#
Overloads
pymel.core.nodetypes.DependNode.rename()
to turn name into an optional argument.- Parameters
*name – the name to use; if omitted, defaults to a contextual name
**kwargs – forwarded to
pymel.core.nodetypes.DependNode.rename()
- Returns
self
- Return type
- basename(stripNamespace=False, stripTypeSuffix=False)#
Returns shorter versions of this node’s name.
- duplicate(name=None, **kwargs)#
- Overloads
pymel.core.nodetypes.DependNode.duplicate()
to add a contextual default to name/n.
- Parameters
name/n (str) – a name for the duplicate; defaults to a contextual name
**kwargs – forwarded to
pymel.core.nodetypes.DependNode.duplicate()
- Returns
The duplicate node.
- Return type
- Overloads
- classmethod createNode(name=None, **kwargs)#
Object-oriented version of
pymel.core.general.createNode()
.- Parameters
name/n (str) – a name for the new node; defaults to a contextual name
*kwargs – forwarded to
pymel.core.general.createNode()
- Returns
The node.
- Return type
- classmethod createFromMacro(macro, **overrides)#
Basic
DependNode
implementation; usescreateNode()
.- Parameters
macro (dict) – the macro to use
**overrides – one or more overrides to the macro dict, passed-in as keyword arguments
- Returns
The constructed node.
- Return type
- macro()#
Basic
DependNode
implementation; includes merely the node name and node type.- Returns
This node’s name and type in a dictionary.
- Return type
- isControl(*state)#
- Parameters
*state (bool) – if
True
, make this node a controller; ifFalse
, remove any controller tags; if omitted, return whether this node is a controller- Raises
NotImplementedError – The control state can’t be edited on non- DAG nodes.
- Returns
bool or None
- addVectorAttr(name, keyable=None, channelBox=None, input=None, defaultValue=None, lock=False, multi=False)#
- Parameters
name – the attribute name
keyable/k (bool) – make the attribute keyable; defaults to True
channelBox/cb (bool) – make the attribute settable; defaults to False
multi/m (bool) – create a multi (array) attribute; defaults to False
input/i (str,
Vector
) – an optional input for the attribute, if it’s not a multidefaultValue/dv (list, tuple,
Vector
,Point
) – an optional default value for the attribute; defaults to [0.0, 0.0, 0.0]lock/l (bool) – lock the attribute; defaults to False
- Returns
A vector / point attribute (i.e., a compound of type
double3
with children of typedouble
).- Return type
- addEulerAttr(name, keyable=None, channelBox=None, input=None, defaultValue=None, lock=False, multi=False)#
- Parameters
name – the attribute name
keyable/k (bool) – make the attribute keyable; defaults to True
channelBox/cb (bool) – make the attribute settable; defaults to False
multi/m (bool) – create a multi (array) attribute; defaults to False
input/i (str,
Vector
) – an optional input for the attributedefaultValue/dv (list, tuple,
EulerRotation
) – an optional default value for the attribute; defaults to [0.0, 0.0, 0.0]lock/l (bool) – lock the attribute; defaults to False
- Returns
An euler rotation attribute (i.e., a compound of type
double3
with children of typedoubleAngle
)- Return type
- addAttr(attrName, channelBox=None, attrSection=None, **kwargs)#
Overloads
addAttr()
to add thechannelBox/cb
option and to returnself
.None
will be returned if compound children are not yet completely specified.- Parameters
attrName (str) – the attribute name
channelBox/cb (bool) – when in create mode, create the attribute as settable instead of keyable; defaults to None
attrSection/ats (
str
,None
) – the name of an attribute section under which to nest the attribute; the section must exist; defaults toNone
**kwargs – forwarded to
addAttr()
- Returns
Where possible, the newly-created attribute.
- Return type
None,
Attribute
- maskAnimAttrs(*args, keyable=None, channelBox=None)#
Selectively enables attributes of interest to animators. Useful for control configuration.
- reorderAttrs(*attrNames, above=None, below=None)#
Reorders attributes on this node. The attributes must be dynamic (not ‘factory’ Maya attributes like translateX), animatable (i.e. not matrix, string etc) and not compounds or multis. Lock states are dodged and connections are preserved.
- getReorderableAttrs()#
- Returns
Attributes on this node that can be reordered.
- Return type
list of str
- getReorderableAttrNames()#
- Returns
The long names of attributes on this node that can be reordered.
- Return type
list of str
- addSectionAttr(sectionName)#
Adds a ‘section’ enum attribute.
- getAttrSectionMembership()#
- Returns
A zipped mapping of section name: member attributes.
- Return type
list of tuple
- tag(tag, *nodesOrAttrs)#
Tags nodes or attributes for quick retrieval via
getByTag()
on this node.- Parameters
- Returns
self
- Return type