![]() |
The node wrapping object. Represents a specific node in the scene.
The node object represents a node within a scene. This object will maintain its link, even if the node is renamed. Some operations, such as copying and pasting, as well as moving nodes will result in this object no longer being valid.
The node object provides access to the node's details, ports and attributes and is useful for automatic rig tasks in a scene.
There exists multiple subclasses of the node object, these provide custom utilities for specialized node types:
Public Member Functions | |
OMC::Scene * | parent_scene () const |
Getaaa the parent scene for the node. More... | |
OMC::GroupNode * | parent_group () const |
Gets the parent group for the node. More... | |
void | move_to (const QString &groupPath, int x=0, int y=0) |
Moves the node into a group. More... | |
void | move_to (OMC::GroupNode *groupPath, int x=0, int y=0) |
Moves the node into a group. More... | |
Public Attributes | |
OMC::AttributeList * | attributes |
Provides the list of attributes of the node. More... | |
OMC::PortList * | ports_in |
Provides the list of input ports belonging to the node. More... | |
OMC::PortList * | ports_out |
Provides the list of output ports belonging to the node. More... | |
QString | name |
Get/set the name of the node. More... | |
QString | path |
Get the path of the node. The path of the node is the absolute location of a node within a scene, including its name. The node's path provides the absolute location and the name of the node and can be used to both move and rename the node as needed. More... | |
QString | type |
Get the type of the node. More... | |
OMC::Node_Coordinates * | position |
The position of the node in the node view. More... | |
bool | enabled |
Get/set whether the node is enabled. More... | |
bool | cached |
Get/set whether the node is cached. More... | |
bool | locked |
Get/set whether the node is locked. More... | |
OMC::Node::Colour * | colour |
Get/set the colour of the node. More... | |
bool | cacheable |
Get whether the node can be cached. More... | |
int | version_max |
Get the max version of the node available. More... | |
int | version |
Get and set the version of the node. More... | |
OMC::Port * | matte_port |
Returns the matte port, if one exists. More... | |
bool | thumbnail_timeline |
Get and set whether the node shows a thumbnail in the timeline. More... | |
OMC::NodeDataHandler * | data |
The data handler that manages node data for views and tools. More... | |
OMC::MetaDataHandler * | metadata |
The metadata handler object to provide metadata information. More... | |
bool | valid |
Whether the bool is currently valid and the node still exists in the scene. More... | |
OMC::NodeSubselectionList * | subselections |
A list of subselectable objects that belong to the node. More... | |
void OMC::Node::move_to | ( | const QString & | groupPath, |
int | x = 0 , |
||
int | y = 0 |
||
) |
Moves the node into a group.
Similar to OMC::NodeList::move, moves this node from one group to another based on the provided group path – but the OMC::Node connection is maintained. Fails with an error if the move fails.
groupPath | - The path to the group into which this node will be placed. |
x | - The x coordinate of the node in the node view. |
y | - The y coordinate of the node in the node view. |
Move a Group Node into the Top Scene Group
void OMC::Node::move_to | ( | OMC::GroupNode * | groupPath, |
int | x = 0 , |
||
int | y = 0 |
||
) |
Moves the node into a group.
Similar to OMC::NodeList::move, moves this node from one group to another based on the provided group object (OMC::GroupNode) – but the OMC::Node connection is maintained. Fails with an error if the move fails.
groupPath | - The path to the group into which this node will be placed. |
x | - The x coordinate of the node in the node view. |
y | - The y coordinate of the node in the node view. Move a Group Node into the Top Scene Group import random from ToonBoom import harmony #Import the Harmony Module sess = harmony.session() #Get access to the Harmony session, this class. proj = sess.project #Get the active session's currently loaded project. scene = proj.scene #Get the top scene in the project. nodes = scene.nodes #Get the node list of the scene. original_node = nodes["Top/Group1/Node"] #Get a node by name. original_node.move_to( scene.top ) #Move the node to the new path. print( "New Node Path: %s"%(original_node.path) ) #Print the new path for the node. |
OMC::GroupNode* OMC::Node::parent_group | ( | ) | const |
Gets the parent group for the node.
Retrieves the group-object in which this node belong (OMC::GroupNode). Every node belongs within a group – even the top-level nodes belong to a transparent group named 'Top'. The 'Top' group node behaves in the same manner as any other group, but is not visible within the node view (See OMC::Scene::top).
Identify the Group of a Random Node in the Scene
OMC::Scene* OMC::Node::parent_scene | ( | ) | const |
Getaaa the parent scene for the node.
Every node belongs within a scene, this method provides the scene (OMC::Scene, or OMH::Scene) object to which this node belongs.
Identify the Scene of the Current Node
OMC::Node::attributes |
Provides the list of attributes of the node.
The attribute-list is a dynamic list object (OMC::AttributeList) that provides the manipulatable attribute objects for the node. These attribute objects are useful for changing node attribute values both statically and over time (if the attribute is animateable).
Print All Attributes for All Nodes (This could take time in heavier scenes)
|
read |
Get whether the node can be cached.
Identifies if the node is cacheable, and can be cached with the OMC::Node::cached node property.
|
readwrite |
Get/set whether the node is cached.
A boolean property that defines whether or not the node is cached as part of the rig cache. Nodes with caching enabled will use a cached bitmap when rendering to OpenGL.
OMC::Node::colour |
Get/set the colour of the node.
Sets the node's colour in the scene. The node colour is used in the node view as a coloured swatch and in the timeline as a tint on the timeline layer. The property is a colour object specific to the given node – and it accepts colours defined by OMC::Colour.
Tint All Selected Nodes Red
OMC::Node::data |
The data handler that manages node data for views and tools.
The OMC::Node::data property will provide a map of custom data handlers that are dynamic properties defined by the application in specific contexts. These contexts include data for specific views (timeline, xsheet, node-view) and data for specific tools. This will be implemented and expanded in future versions of the DOM.
|
readwrite |
Get/set whether the node is enabled.
Nodes that are disabled (enabled = False) have specific behaviour based on the type of node that is disabled. Generally, a disabled node is passed-through and ignored for transformations and when rendering the image. Disabling a node is useful when turning off portions of a rig, or comparing the output of a node.
Disable All 'FX'
|
readwrite |
Get/set whether the node is locked.
A boolean property that defines whether the node is locked. Locked nodes will restrict certain kinds of interactions.
OMC::Node::matte_port |
Returns the matte port, if one exists.
Some node-types provide a matte-port (sometimes hidden) that provides specialized functionality for providing a matte while rendering. This property provides the matte-port as a OMC::InPort if one is available.
Attach a mask to a drawing
OMC::Node::metadata |
The metadata handler object to provide metadata information.
Metadata can be used to store generic information in the scene, and in nodes. This data is created and accessed through the object (OMC::MetaDataHandler) provided by this property.
Print all Metadata in the node.
Create Some Metadata
|
readwrite |
Get/set the name of the node.
The name of the node is the unique node name within a group. Given a node with "Top/Group/NodeName", the last section "NodeName" is the unique node-name within the group. This can also be used to rename the node in-place – in the event that the provided name is not unique, a new unique name will be generated.
Add a Prefix to All Selected Nodes
|
readwrite |
Get the path of the node. The path of the node is the absolute location of a node within a scene, including its name. The node's path provides the absolute location and the name of the node and can be used to both move and rename the node as needed.
Rename the Node with the Path
OMC::Node::ports_in |
Provides the list of input ports belonging to the node.
Provides a dynamic list object (OMC::PortList) of input ports on the node. The portlist object is also used for generating new in-ports (OMC::InPort) on the node when the node-type supports dynamic port creation.
Ports are connected to one another for rigging-purposes – a node's in-ports must be connected to another node's out-ports.
Find First Node – Identify Port Count
OMC::Node::ports_out |
Provides the list of output ports belonging to the node.
Provides a dynamic list object (OMC::PortList) of output ports on the node. The portlist object is also used for generating new out-ports (OMC::OutPort) on the node when the node-type supports dynamic port creation.
Ports are connected to one another for rigging-purposes – a node's in-ports must be connected to another node's out-ports.
Find First Node – Identify Port Count
OMC::Node::position |
The position of the node in the node view.
Provides a modifiable OMC::Node_Coordinates object. This can be used to modify the position of a node within the node view. See OMC::Node_Coordinates for more information.
OMC::Node::subselections |
A list of subselectable objects that belong to the node.
Provides a list of subselection objects, with IDs. These are used when selecting controllers on a given node and are best used in conjunction with the selection interface.
|
readwrite |
Get and set whether the node shows a thumbnail in the timeline.
Defines whether the thumbnail in the timeline view is enabled. When enabled, the node in the timeline will be expanded and a thumbnail will be visible. Generally, only image-type nodes (nodes with an image output port) support thumbnails in the timeline.
Identify the Image Nodes and Enable Thumbnails
|
read |
Get the type of the node.
All nodes have an underlying keyword node-type. This type value defines the type of the node and its utility in the scene. This is useful when looking for a specific node type in a scene.
Find all Nodes, Move them 10 Units Right
|
read |
Whether the bool is currently valid and the node still exists in the scene.
The Document Object Model maintains links between the object in the DOM and the actual object in Harmony. Certain methods and actions within the GUI will devalidate the DOM objects, and in these cases the object is considered no longer valid. This can happen if the object is kept in memory in the DOM and other actions are performed in the GUI.
The valid property defines whether or not the object is still valid. If actions are performed on an object that is no longer valid, an error will be thrown and needs to be caught and dealt with appropriately. It is particularly important to catch errors and check for validity on nodes in longer-running/persistent scripts. Only a few methods will devalidate a node within the same script.
Checking for Valid Nodes
|
readwrite |
Get and set the version of the node.
Certain nodes are versioned and these versions can change between versions releases and builds of the application. The version property identifies the current version of the node, which can be up to a maximum of the value provided by OMC::Node::version_max.
|
read |
Get the max version of the node available.
Certain nodes are versioned and these versions can change between versions releases and builds of the application. The version_max property provides the max version number that the node supports. The version of the node can be changed with the OMC::Node::version property.