Skip to content

Node

Node

A node the file creates, or a default node whose attributes it edits.

Attributes

attributes

attributes: list[Attribute]

is_dag

is_dag: bool

is_default

is_default: bool

True for a node the file does not create (a select -ne block).

is_transform

is_transform: bool

name

name: str

Name, with its namespace (ns:target).

Setting it is rename(value) with its defaults.

parent

parent: Node | None

The parent node, or None for a root node or a parent outside this file.

parent_name

parent_name: str | None

Parent as stored: a short name, or a DAG path when the name is ambiguous.

path

path: str

Long name: the full DAG path for DAG nodes, the name otherwise.

paths

paths: list[str]

Every DAG path of the node, path first: one per parent (instancing adds parents), times the paths of each parent.

scene

scene = scene

type

type: str

Type name, 0x... for an unknown .mb type id, "" for an unknown default node.

type_id

type_id: int | None

Type id, or None when unknown (default nodes, plugin types in .ma).

uuid

uuid: str | None

Methods:

attr

attr(name: str) -> Attribute

The stored attribute named name, by short or long name (ftn, fileTextureName, uvst[0].uvsn, uvSet[0].uvSetName).

Attributes missing from Maya's schema, addAttr ones included, match their stored name only.

rename

rename(
    new_name: str,
    *,
    shapes: bool = True,
    in_strings: bool = False,
) -> None

Rename the node and rewrite every stored reference to it.

Rewritten: parents, connections, relationships, reference edits and the externalContentTable (on save). Like maya.cmds.rename, renaming a transform also renames its shapes whose name starts with the old name (boxShape > crateShape), unless shapes is False.

in_strings also rewrites node names inside string attribute values that name a node ("box", "|grp|box.tx") and inside the MEL of expressions and script nodes (getAttr box.ty). Maya does not, and a string that only looks like a node name (box.exr) is rewritten too.