Node

Inheritance diagram of rumba.Node
class Node

Bases: pybind11_builtins.pybind11_object

Base class of all Rumba nodes.

A Node has plugs and children nodes.

Python example

# Create a root node
node = Node("Node", "node", None)

# Create two children nodes
child0 = Node("Node", "child", node)
child1 = Node("Node", "child", node)

# Test if a child exists
if node.has_child("child"):

    # Get a child node
    child = node.child("child")

    # Get the parent node
    parent = child.parent()

# Iterates the children
for child in node.children():
    name = child.name()

# Get a node plug
plug = node.plug("structure")
plug = node.structure   # alternative

# Iterate the plugs
for p in node.plugs():
    name = p.name()

# Create a Lerp plug-in node
lerp = Node("Lerp", "lerp", None)

# Get a plug
weight = lerp.weight

# Set its value
weight.set_value(0.5)

Constructors

__init__

Methods

__eq__
__getattr__
__ne__
bases() Returns a list of all the types this class derives.
channels() Returns the channels of this node.
child(name) Get a child node by its name.
children() Get the node children accessor.
delete_node(undo_stack) Delete this node from the document.
document() Get the Document parent node.
find_first(name) Get the first node named name in the children hierarchy of this node.
full_document_name() Return the node full name starting at the document node.
full_name() Return the node full name starting at the workspace node.
has_child(child_name) Check if a child node exists.
has_document() Check if this node is child of a Document node.
has_parent() Check if this node has a parent.
has_plug(plug_name) Check if a plug exists.
is_instance(node_type_name) Check if this node derive from another node type.
is_mutable() Check if this node can be modified.
is_reference_loaded() Returns true if this node is a root reference node and the reference is loaded.
is_reference_root() Check if this node is the root node of a reference.
is_referenced() Check if this node is referenced.
load_reference
name() Return the node name.
parent() Get the node parent.
plug(plug_name) Return a plug by its name.
plugs() Return the node plugs iteration.
reference_filename() Returns the reference file name for this node.
relationship() Returns the nodes in relationship with this node.
rename(new_name)
type new_name:unicode
replace_reference(new_reference) Replace this root reference node with another file.
search(key) Search in the node childrens all the name that satisfies the key.
type_name() Return the node type name.
unload_reference() Unload this root reference node.
write(filename) Write the node into a file.
bases() -> list(unicode)

Returns a list of all the types this class derives.

Return type:list(unicode)
channels() -> list(Plug)

Returns the channels of this node.

Return type:list(Plug)
child(name: unicode) → Node

Get a child node by its name.

Return type:Node
Raises:RuntimeError – if the child doesn’t exist.
children() → Children

Get the node children accessor.

Return type:Children
delete_node(undo_stack: bool) → None

Delete this node from the document.

Parameters:undo_stack (bool) – if true, this action is undoable
document() → Node

Get the Document parent node.

Return type:Node
Raises:RuntimeError – if the node is not a child of a Document node.
find_first(name: unicode) → Node

Get the first node named name in the children hierarchy of this node.

Return type:Node
Raises:RuntimeError – if the node doesn’t exist.
full_document_name() → unicode

Return the node full name starting at the document node.

Return type:unicode
full_name() → unicode

Return the node full name starting at the workspace node.

Return type:unicode
has_child(child_name: unicode) → bool

Check if a child node exists.

Return type:bool
has_document() → bool

Check if this node is child of a Document node.

Return type:bool
has_parent() → bool

Check if this node has a parent.

Return type:bool
has_plug(plug_name: unicode) → bool

Check if a plug exists.

Return type:bool
is_instance(node_type_name: unicode) → bool

Check if this node derive from another node type.

Return type:bool
is_mutable() → bool

Check if this node can be modified.

The node is mutable if it is not inside a reference.

Return type:bool
is_reference_loaded() → bool

Returns true if this node is a root reference node and the reference is loaded.

Return type:bool
is_reference_root() → bool

Check if this node is the root node of a reference.

Return type:bool
is_referenced() → bool

Check if this node is referenced.

Returns true if the node is inside a reference node (read only) or if the node is a root reference node (mutable).

Return type:bool
name() → unicode

Return the node name.

Return type:unicode
parent() → Node

Get the node parent.

Return type:Node
Raises:RuntimeError – if the node has no parent.
plug(plug_name: unicode) → Plug

Return a plug by its name.

In Python, you can access a plug like an attribute.

# Get a node plug
plug = node.plug("structure")
plug = node.structure   # alternative
Return type:Plug
Raises:RuntimeError – if the plug does not exist.
plugs() → Plugs

Return the node plugs iteration.

Return type:Plugs
reference_filename() → unicode

Returns the reference file name for this node.

If the node is not a reference root node, return an empty string.

Return type:unicode
relationship() -> list(Node)

Returns the nodes in relationship with this node.

A relationship can have different meanings. For a layer for instance, the relationship are the controllers animated in this layer.

Return type:list(Node)
rename(new_name: unicode, undo_stack: bool) → None
replace_reference(new_reference: unicode) → None

Replace this root reference node with another file.

Replace the reference with another file. The reference stays loaded or unload.

Raises:RuntimeError – if the file is corrupted
search(key: unicode) -> list(Node)

Search in the node childrens all the name that satisfies the key.

Returns a list of nodes that satisfies the search key.

Parameters:key (unicode) – The key use in the regex to search node by name
Return type:list(Node)
type_name() → unicode

Return the node type name.

Return type:unicode
unload_reference() → None

Unload this root reference node.

Unload the reference starting at this node from memory, and keep all its values and connection. If Node::is_reference_loaded returns false, this method has no effect.

write(filename: unicode) → None

Write the node into a file.

Raises:RuntimeError – if the writing fails.