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

DependNode

getSubtype()#
Returns

The contents of the payaSubtype attribute, if present and populated, otherwise None.

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.

Parameters

*name (str) – an optional override for the class name; if provided, no attempt will be made to access the payaSubtype attribute

Returns

The custom class, if one could be retrieved.

Return type

type, None

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

DependNode

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

str

rename(*name, **kwargs)#

Overloads pymel.core.nodetypes.DependNode.rename() to turn name into an optional argument.

Parameters
Returns

self

Return type

DependNode

basename(stripNamespace=False, stripTypeSuffix=False)#

Returns shorter versions of this node’s name.

Parameters
  • stripNamespace/sns (bool) – remove namespace information; defaults to False

  • stripTypeSuffix/sts (bool) – removes anything that looks like a type suffix; defaults to False

Returns

the modified name

Return type

str

duplicate(name=None, **kwargs)#
Overloads pymel.core.nodetypes.DependNode.duplicate() to add a

contextual default to name/n.

Parameters
Returns

The duplicate node.

Return type

DependNode

classmethod createNode(name=None, **kwargs)#

Object-oriented version of pymel.core.general.createNode().

Parameters
Returns

The node.

Return type

DependNode

classmethod createFromMacro(macro, **overrides)#

Basic DependNode implementation; uses createNode().

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

DependNode

macro()#

Basic DependNode implementation; includes merely the node name and node type.

Returns

This node’s name and type in a dictionary.

Return type

dict

isControl(*state)#
Parameters

*state (bool) – if True, make this node a controller; if False, 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 multi

  • defaultValue/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 type double).

Return type

Vector

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 attribute

  • defaultValue/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 type doubleAngle)

Return type

EulerRotation

addAttr(attrName, channelBox=None, attrSection=None, **kwargs)#

Overloads addAttr() to add the channelBox/cb option and to return self. 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 to None

  • **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.

Parameters
  • *args – names of attributes to set to keyable

  • keyable/k – names of attributes to set to keyable; defaults to None

  • channelBox/cb (None, tuple, list, str) – names of attributes to set to settable; defaults to None

Type

keyable/k: None, tuple, list, str

Returns

self

Return type

DependNode

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.

Parameters
  • attrNames (list of str) – attribute names in the preferred order

  • above/ab (None, str) – the name of an attribute above which to insert the attributes; defaults to None

  • below/bl – the name of an attribute below which to insert the attributes; defaults to None

Returns

list of Attribute

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.

Parameters

sectionName (str) – the name of the section

Returns

The ‘section’ enum attribute.

Return type

Enum

getSectionAttrs()#
Returns

A list of ‘section’ attributes on this node.

Return type

list of Enum

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
  • tag (str) – the tag to add to

  • *nodesOrAttrs (Attribute, PyNode, str) – nodes and/or attributes to add to the tag

Returns

self

Return type

DependNode

clearTags(*tags)#
Parameters

*tags (str, list [str]) – tags to clear; if none are specified, all tags will be removed

Returns

self

Return type

DependNode

getByTag(tag)#

Retrieves nodes and / or attribues previously tagged using tag() on this node.

Parameters

tag (str) – the tag to inspect

Returns

Members of the specified tag.

Return type

list [DependNode, Attribute]