NodeDelegate

Inheritance diagram of rumba.NodeDelegate
class NodeDelegate

This interface gives a high level access to the document structure.

Using this class, not only the API nodes structure can be traversed but also the values.

The values can present a hierarchical structure which is managed by the value itself.

For exemple, a USD reader Rumba node exposes the USD file structure to the Rumba user interface with special USD values and a specialized NodeDelegate.

This class can be used to traverse the document in a user interface.

Deriving this class, one can also define a value internal hierarchy.

Those objects are invalid if the document structure changes. So they shall be keeped only during the traversal and not used if the current node has been destroyed.

If you need to keep references on a node, use a path on this node. The path is a string like “/nodeA/nodeB/nodeC.plugA/nodeD/nodeE”. Here “nodeA”, “nodeB” and “nodeC” are valid rumba:Node objects. “plugA” is the name of a plug of “nodeC”. “nodeD” and “nodeE” are nodes served by the value stored in “plugA”. “nodeD” and “nodeE” do not really exist in the document.

The matrix of the node delegate is decomposed in different components: scale, shear, rotation, translation, scale_pivots, rotate_pivot and joint_orient.

The formula to get the local matrix is (using post multiplication) : matrix = [-scale_pivot] * [scale] * [shear] * [scale_pivot] * [-rotate_pivot] * [rotate] * [joint_orient] * [rotate_pivot] * [translation]

The formula to get the world matrix is (using post multiplication) : world_matrix = matrix * parent_world_matrix

Methods

__eq__

Return self==value.

__getattr__

__hash__

Return hash(self).

__ne__

Return self!=value.

aim()

Return the aim target node if available.

animate()

Called when the node delegate is assigned to an animation system layer.

aspect_ratio()

Return the camera's aspect ratio, width over height.

attribute(name)

Return a node attribute using its name.

attribute_count()

Returns the number of attributes.

attributes()

rtype

Attributes

center_of_interest

channel(sc)

Return the specified channel if available, return nullptr otherwise.

channels()

Return all the node's channels.

child(name)

Return a node child using its name.

child_count()

Returns the number of children in the node.

children()

rtype

Children

create_camera_observer

create_transform_observer(func, in_interactive)

Create an observer notified when the NodeDelegate transform attributes have changed.

description()

Returns the node's description, always returns a valid pointer.

document_path()

Returns the document path to the node.

extract_rotation

extract_translation

far_clipping_plane

find(path)

Returns descendent node_delegate using a path starting at this node.

has_geometry()

Return true if this node has a geometry.

has_transform()

Return true if this node is has a transformation matrix.

is_camera()

Returns true if this node is a camera.

is_locked()

Return true if the camera can't be moved.

is_node()

Return true if this node delegate is a Rumba Node.

is_orthographic

joint_orient

matrix

mutable_flags()

Returns the mutable transformation component.

name()

The node's name.

near_clipping_plane

node()

Return the node behind this node delegate.

orthographic_width

parent()

Returns the parent node.

parent_world_matrix

path()

Returns the full path to the node.

projection_matrix

rotate_order

rotate_pivot

rotation

scale

scale_pivot

set_center_of_interest

set_far_clipping_plane

set_locked

set_matrix

set_near_clipping_plane

set_orthographic_width

set_rotation

set_scale

set_translation

start_transform

translation

type_name()

rtype

StringView

up()

Return the up target node if available.

world_matrix

class MutableFlags

Members:

ScaleX : The x scale component is mutable.

ScaleY : The y scale component is mutable.

ScaleZ : The z scale component is mutable.

Scale : The scale is mutable.

RotateX : The x rotation component is mutable.

RotateY : The y rotation component is mutable.

RotateZ : The z rotation component is mutable.

Rotate : The rotation is mutable.

TranslateX : The x translation component is mutable.

TranslateY : The y translation component is mutable.

TranslateZ : The z translation component is mutable.

Translate : The translation is mutable.

AllComponents : All the transformation components are mutable.

__init__()
class TransformUserData

A blind data provided by the start_transform’s implementation and passed to set_scale, set_rotation and set_translation.

__init__(*args, **kwargs)
__init__(*args, **kwargs)
aim() NodeDelegate

Return the aim target node if available.

Return type

NodeDelegate

animate() None

Called when the node delegate is assigned to an animation system layer.

The node delegate can use this opportunity to create default channel plugs. All document modifications must be done using the undo stack (undo_stack = true).

The default implementation does nothing.

aspect_ratio() float

Return the camera’s aspect ratio, width over height. This aspect ratio is used to shape the viewport’s frame.

Return type

float

attribute(name: StringView) AttributeDelegate

Return a node attribute using its name.

Return nullptr if the attribute does not exist.

Return type

AttributeDelegate

attribute_count() int

Returns the number of attributes.

Return type

int

attributes() Attributes
Return type

Attributes

channel(sc: ChannelType) Channel

Return the specified channel if available, return nullptr otherwise.

Return the animation channels of the represented node.

Return type

Channel

channels()

Return all the node’s channels.

Return type

list(Channel)

child(name: StringView) NodeDelegate

Return a node child using its name.

Return nullptr if the child does not exist.

Return type

NodeDelegate

child_count() int

Returns the number of children in the node.

Implemented by the plug-in.

Return type

int

children() Children
Return type

Children

create_transform_observer(func, in_interactive: bool) Observer

Create an observer notified when the NodeDelegate transform attributes have changed.

Return type

Observer

description() AttributeDescriptor

Returns the node’s description, always returns a valid pointer.

Return type

AttributeDescriptor

document_path() unicode

Returns the document path to the node.

Return type

unicode

find(path: StringView) NodeDelegate

Returns descendent node_delegate using a path starting at this node.

If the node_delegate does not exist, returns nullptr.

Return type

NodeDelegate

has_geometry() bool

Return true if this node has a geometry.

Return type

bool

has_transform() bool

Return true if this node is has a transformation matrix.

If has_transform returns true, the node has a matrix, a parent_world_matrix and a world_matrix.

Return type

bool

is_camera() bool

Returns true if this node is a camera.

Return type

bool

is_locked() bool

Return true if the camera can’t be moved.

Return type

bool

is_node() bool

Return true if this node delegate is a Rumba Node.

Return type

bool

mutable_flags() int

Returns the mutable transformation component.

If a flag is set, its component is mutable.

Return type

int

name() maquina.StringView

The node’s name.

Implemented by the plug-in.

Return type

maquina.StringView

node() Node

Return the node behind this node delegate.

Return type

Node

Raises

RuntimeError – if the node delegate is not mapped to a Node

parent() NodeDelegate

Returns the parent node.

Implemented by the plug-in.

Return type

NodeDelegate

path() unicode

Returns the full path to the node.

Implemented by the plug-in.

Return type

unicode

type_name() StringView
Return type

StringView

up() NodeDelegate

Return the up target node if available.

Return type

NodeDelegate