Node¶
-
class
cgp_maya_utils.scene.Node(name)¶ Bases:
objectnode object that manipulates any kind of node
-
MFn()¶ the function set of the node
Returns: the function set of the node Return type: maya.api.OpenMaya.MFn
-
MObject()¶ the MObject of the node
Returns: the MObject of the node Return type: maya.api.OpenMaya.MObject
-
attribute(attribute)¶ the attribute of the node from an attribute name
Parameters: attribute (str) – name of the attribute to get Returns: the attribute object Return type: cgp_maya_utils.scene.Attribute
-
attributeValues()¶ the values of the available attributes of the node
Returns: the attribute values Return type: dict
-
attributes(attributeTypes=None, attributeTypesIncluded=True, onlyUserDefined=False)¶ the attributes of the node from attribute types
Parameters: Returns: the attributes
Return type:
-
connections(attributes=None, sources=True, destinations=True, nodeTypes=None, nodeTypesIncluded=True, skipConversionNodes=False)¶ the source and destination connections of the node
Parameters: - attributes (list[str]) – attributes of the node to get the connections from - get all if nothing specified
- sources (bool) –
True: get the source connections -False: does not get the source connections - destinations (bool) –
True: get the destination connections -False: does not get the destination connections - nodeTypes (list[str]) – types of nodes to get the connections from - All if nothing is specified
- nodeTypesIncluded (bool) –
True: include specified node types -False: exclude specified node types - skipConversionNodes (bool) –
True: conversion nodes are skipped -Falseconversion nodes are not skipped
Returns: the connections of the node
Return type:
-
classmethod
create(nodeType, connections=None, attributeValues=None, name=None, **__)¶ create a node
Parameters: Returns: the created node
Return type:
-
data()¶ data necessary to store the node on disk and/or recreate it from scratch
Returns: the data of the node Return type: dict
-
delete()¶ delete the node
-
duplicate()¶ duplicate the node
Returns: the duplicated node Return type: cgp_maya_utils.scene.Node
-
hasAttribute(attribute)¶ check if the node has the attribute
Parameters: attribute (str) – the attribute to check Returns: True: it has the attribute -False: it does not have the attributeReturn type: bool
-
hasAttributes(attributes)¶ check if the node has the attributes
Parameters: attributes (list[str]) – attributes to check on the node Returns: True: it has the attributes -False: it does not have the attributesReturn type: bool
-
isLocked()¶ check if the node is locked
Returns: True: it is locked -False: it is not lockedReturn type: bool
-
isReferenced()¶ check if the node is referenced
Returns: True: it is referenced -False: it is not referencedReturn type: bool
-
namespace()¶ the namespace of the node
Returns: the namespace of the node Return type: cgp_maya_utils.scene.Namespace
-
rebuild()¶ rebuild the node
-
reference()¶ the reference of the node
Returns: the reference object Return type: cgp_maya_utils.scene.Reference
-
select()¶ select the node
-
setAttributeValues(attributeValues)¶ set the values of the attributes of the node
Parameters: attributeValues (dict) – values to set to the attributes of the node - {attr1: value1, attr2: value2 ...}
-
setConnections(connections)¶ set the connections of the node
Parameters: connections (list[tuple[str]]) – connection data used to set the connections
-