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.
Return the camera's aspect ratio, width over height.
attribute(name)Return a node attribute using its name.
Returns the number of attributes.
- rtype
Attributes
center_of_interestchannel(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.
Returns the number of children in the node.
children()- rtype
Children
create_camera_observercreate_transform_observer(func, in_interactive)Create an observer notified when the NodeDelegate transform attributes have changed.
Returns the node's description, always returns a valid pointer.
Returns the document path to the node.
extract_rotationextract_translationfar_clipping_planefind(path)Returns descendent node_delegate using a path starting at this node.
Return true if this node has a geometry.
Return true if this node is has a transformation matrix.
Returns true if this node is a camera.
Return true if the camera can't be moved.
is_node()Return true if this node delegate is a Rumba Node.
is_orthographicjoint_orientmatrixReturns the mutable transformation component.
name()The node's name.
near_clipping_planenode()Return the node behind this node delegate.
orthographic_widthparent()Returns the parent node.
parent_world_matrixpath()Returns the full path to the node.
projection_matrixrotate_orderrotate_pivotrotationscalescale_pivotset_center_of_interestset_far_clipping_planeset_lockedset_matrixset_near_clipping_planeset_orthographic_widthset_rotationset_scaleset_translationstart_transformtranslation- 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
- 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
- child(name: StringView) NodeDelegate
Return a node child using its name.
Return nullptr if the child does not exist.
- Return type
- 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
- 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
- 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
- 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
- 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