new $.oNode(path, oSceneObject)
openHarmony/openHarmony_node.js, line 102
Constructor for $.oNode class
| Name | Type | Description |
|---|---|---|
path |
string | Path to the node in the network. |
oSceneObject |
$.oScene | optional Access to the oScene object of the DOM. |
- See:
-
- NodeType
Example
// To grab a node object from the scene, it's possible to create a new node object by calling the constructor:
var myNode = new $.oNode("Top/Drawing", $.scn)
// However, most nodes will be grabbed directly from the scene object.
var doc = $.scn
var nodes = doc.nodes; // grabs the list of all the nodes in the scene
// It's possible to grab a single node from the path in the scene
var myNode = doc.getNodeByPath("Top/Drawing")
var myNode = doc.$node("Top/Drawing") // short synthax but same function
// depending on the type of node, oNode objects returned by these functions can actually be an instance the subclasses
// oDrawingNode, oGroupNode, oPegNode...
$.log(myNode instanceof $.oNode) // true
$.log(myNode instanceof $.oDrawingNode) // true
// These other subclasses of nodes have other methods that are only shared by nodes of a certain type.
// Not documented in this class, oNode objects have attributes which correspond to the values visible in the Layer Properties window.
// The attributes values can be accessed and set by using the dot notation on the oNode object:
myNode.can_animate = false;
myNode.position.separate = true;
myNode.position.x = 10;
// To access the oAttribute objects in the node, call the oNode.attributes object that contains them
var attributes = myNode.attributes;
Members
-
readonlyattributesoAttribute
-
An object containing all attributes of this node.
Example
// You can get access to the actual oAttribute object for a node parameter by using the dot notation: var myNode = $.scn.$node("Top/Drawing") var drawingAttribute = myNode.attributes.drawing.element // from there, it's possible to set/get the value of the attribute, get the column, the attribute keyword etc. drawingAttribute.setValue ("1", 5); // creating an exposure of drawing 1 at frame 5 var drawingColumn = drawingAttribute.column; // grabbing the column linked to the attribute that holds all the animation $.log(drawingAttribute.keyword); // "DRAWING.ELEMENT" // for a more direct way to access an attribute, it's possible to also call: var drawingAttribute = myNode.getAttributeByName("DRAWING.ELEMENT"); -
readonlyboundsoBox
-
The bounds of the node rectangle in the node view.
-
readonlycanCreateInPortsbool
-
Whether the node can create new in-ports.
-
readonlycanCreateOutPortsbool
-
Whether the node can create new out-ports.
-
readonlychildrenArray.<$.oNode>
-
The $.oNode objects contained in this group. This is deprecated and was moved to oGroupNode
- Deprecated
- Use oGroupNode.children instead.
-
readonlycontainingBackdropsArray.<$.oBackdrop>
-
The list of backdrops which contain this node.
-
enabledbool
-
Is the node enabled?
-
readonlyexistsbool
-
Does the node exist?
-
readonlyfullPathstring
-
The derived path to the node.
- Deprecated
- use oNode.path instead
-
readonlygroupoGroupNode
-
The group containing the node.
-
readonlyheightfloat
-
The height of the node in the node view.
-
readonlyinLinksArray.<$.oNodeLink>
-
The list of oNodeLinks objects descibing the connections to the inport of this node, in order of inport.
- Deprecated
- returns $.oNodeLink instances but $.oLink is preferred. Use oNode.getInLinks() instead.
-
readonlyinNodesArray.<$.oNode>
-
The list of nodes connected to the inport of this node, in order of inport.
- Deprecated
- returns $.oNodeLink instances but $.oLink is preferred. Use oNode.linkedInNodes instead.
-
readonlyinPortsint
-
The number of link ports on top of the node, connected or not.
-
readonlyinsArray.<$.oNode>
-
The list of nodes connected to the inport of this node, in order of inport. Similar to oNode.inNodes
- Deprecated
- alias for deprecated oNode.inNodes property
-
readonlyisGroupbool
-
Is the node a group?
- Deprecated
- check if the node is an instance of oGroupNode instead
-
readonlyisRootbool
-
Is the node the root?
-
readonlylinkedColumnsArray.<oColumn>
-
The list of all columns linked across all the attributes of this node.
-
readonlylinkedInNodesArray.<$.oNode>
-
The list of nodes connected to the inport of this node, as a flat list, in order of inport.
-
readonlylinkedOutNodesArray.<$.oNode>
-
The list of nodes connected to the inport of this node, as a flat list, in order of inport.
-
lockedbool
-
Is the node locked?
-
readonlymatrixoMatrix
-
The transformation matrix of the node at the currentFrame.
-
namestring
-
The node's name.
-
nodeColor$.oColorValue
-
The color of the node
-
nodePositionoPoint
-
The position of the node.
-
readonlyoutLinksArray.<$.oNodeLink>
-
The list of oNodeLinks objects descibing the connections to the outports of this node, in order of outport.
- Deprecated
- returns $.oNodeLink instances but $.oLink is preferred. Use oNode.getOutLinks instead.
-
readonlyoutNodesArray.<Array.<$.oNode>>
-
The list of nodes connected to the outports of this node
- Deprecated
- returns $.oNodeLink instances but $.oLink is preferred. Use oNode.linkedOutNodes instead.
-
readonlyoutPortsint
-
The number of link ports at the bottom of the node, connected or not.
-
readonlyoutsArray.<Array.<$.oNode>>
-
The list of nodes connected to the outport of this node, in order of outport and links. Similar to oNode.outNodes
- Deprecated
- alias for deprecated oNode.outNodes property
-
readonlyparent$.oNode
-
The $.oNode object for the parent in which this node exists.
-
readonlypathstring
-
The path of the node (includes all groups from 'Top' separated by forward slashes). To change the path of a node, use oNode.moveToGroup()
-
selectedbool
-
Is the node selected?
-
readonlytypestring
-
The type of the node.
-
readonlywidthfloat
-
The width of the node in the node view.
-
xfloat
-
The horizontal position of the node in the node view.
-
yfloat
-
The vertical position of the node in the node view.
-
zfloat
-
The depth position of the node in the node view.
Methods
-
addOutLink(nodeToLink, ownPort, destPort){$.oNodeLink}
openHarmony/openHarmony_node.js, line 1804 -
Creates an $.oNodeLink and connects this node to the target via this nodes outport.
Name Type Description nodeToLinkoNode The target node as an in node. ownPortint The out port on this node to connect to. destPortint The in port on the inNode to connect to. Returns:
Type Description $.oNodeLink the resulting created link. Example
var peg1 = $.scene.getNodeByPath( "Top/Peg1" ); var peg2 = $.scene.getNodeByPath( "Top/Group/Peg2" ); var newLink = peg1.addOutLink( peg2, 0, 0 ); -
centerAbove(oNodeArray, xOffset, yOffset){oPoint}
openHarmony/openHarmony_node.js, line 1387 -
Place a node above one or more nodes with an offset.
Name Type Description oNodeArrayArray.<$.oNode> The array of nodes to center this above. xOffsetfloat The horizontal offset to apply after centering. yOffsetfloat The vertical offset to apply after centering. Returns:
Type Description oPoint The resulting position of the node. -
centerBelow(oNodeArray, xOffset, yOffset){oPoint}
openHarmony/openHarmony_node.js, line 1416 -
Place a node below one or more nodes with an offset.
Name Type Description oNodeArrayArray.<$.oNode> The array of nodes to center this below. xOffsetfloat The horizontal offset to apply after centering. yOffsetfloat The vertical offset to apply after centering. Returns:
Type Description oPoint The resulting position of the node. -
clone(newName, newPosition)
openHarmony/openHarmony_node.js, line 1605 -
Create a clone of the node.
Name Type Description newNamestring The new name for the cloned module. newPositionoPoint The new position for the cloned module. -
createAttribute(attrName, type, displayName, linkable){$.oAttribute}
openHarmony/openHarmony_node.js, line 1823 -
Creates a new dynamic attribute in the node.
Name Type Default Description attrNamestring The attribute name to create. typestring "string" optional The type of the attribute ["string", "bool", "double", "int"] displayNamestring attrName optional The visible attribute name to the GUI user. linkablebool false optional Whether the attribute can be linked to a column. Returns:
Type Description $.oAttribute The resulting attribute created. -
duplicate(newName, newPosition)
openHarmony/openHarmony_node.js, line 1636 -
Duplicates a node by creating an independent copy.
Name Type Description newNamestring optional The new name for the duplicated node. newPositionoPoint optional The new position for the duplicated node. -
findFirstInLinkOfType(type, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1150 -
Traverses the node hierarchy up until if finds a node of the given type.
Name Type Description typestring the type of node we are looking for lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
findFirstInNodeMatching(condition, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1083 -
Traverses the node hierarchy up until if finds a node matching the condition.
Name Type Description conditionfunction a function returning true or false which can be used to find the node lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
findFirstInNodeOfType(type, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1129 -
Traverses the node hierarchy up until if finds a node of the given type.
Name Type Description typestring the type of node we are looking for lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
findFirstOutLinkOfType(type, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1163 -
Traverses the node hierarchy up until if finds a node of the given type.
Name Type Description typestring the type of node we are looking for lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
findFirstOutNodeMatching(condition, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1106 -
Traverses the node hierarchy down until if finds a node matching the condition.
Name Type Description conditionfunction a function returning true or false which can be used to find the node lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
findFirstOutNodeOfType(type, lookInsideGroups){$.oNode}
openHarmony/openHarmony_node.js, line 1139 -
Traverses the node hierarchy down until if finds a node of the given type.
Name Type Description typestring the type of node we are looking for lookInsideGroupsbool wether to consider the nodes inside connected groups Returns:
Type Description $.oNode the found node -
getAttributeByColumnName(columnName){oAttribute}
openHarmony/openHarmony_node.js, line 1732 -
Provides a matching attribute based on the column name provided. Assumes only one match at the moment.
Name Type Description columnNamestring The column name to search. Returns:
Type Description oAttribute The matched attribute object, given the column name. -
getAttributeByName(keyword){oAttribute}
openHarmony/openHarmony_node.js, line 1696 -
Provides a matching attribute based on provided keyword name. Keyword can include "." to get subattributes.
Name Type Description keywordstring The attribute keyword to search. Returns:
Type Description oAttribute The matched attribute object, given the keyword. -
getFreeInPort(createNew){int}
openHarmony/openHarmony_node.js, line 925 -
Returns a free unconnected in-port
Name Type Default Description createNewbool true optional Whether to allow creation of new ports Returns:
Type Description int the port number that isn't connected -
getFreeOutPort(createNew){int}
openHarmony/openHarmony_node.js, line 1062 -
Returns a free unconnected out-port
Name Type Default Description createNewbool false optional Whether to allow creation of new ports Returns:
Type Description int the port number that isn't connected -
getInLink(inPort){$.oLink}
openHarmony/openHarmony_node.js, line 888 -
Returns the oLink object representing the connection of a specific inPort
Name Type Description inPortint the number of the port to get links from. Returns:
Type Description $.oLink the oLink Object representing the link connected to the inport -
getInLinks(){Array.<$.oLink>}
openHarmony/openHarmony_node.js, line 907 -
Returns all the valid oLink objects describing the links that are connected into this node.
Returns:
Type Description Array.<$.oLink> An array of $.oLink objects. -
getInLinksNumber(inPort)
openHarmony/openHarmony_node.js, line 877 -
Returns the number of links connected to an in-port
Name Type Description inPortint the number of the port to get links from. -
getLinkedInNode(inPort){$.oNode}
openHarmony/openHarmony_node.js, line 998 -
Returns the node connected to a specific in-port
Name Type Description inPortint the number of the port to get the linked Node from. Returns:
Type Description $.oNode The node connected to this in-port -
getLinkedOutNode(outPort, outLink){$.oNode}
openHarmony/openHarmony_node.js, line 1214 -
Returns the node connected to a specific outPort
Name Type Default Description outPortint the number of the port to get the node from. outLinkint 0 optional the index of the link. Returns:
Type Description $.oNode The node connected to this outPort and outLink -
getMatrixAtFrame(frameNumber){oMatrix}
openHarmony/openHarmony_node.js, line 1322 -
Get the transformation matrix for the node at the given frame
Name Type Description frameNumberint Returns:
Type Description oMatrix the matrix object -
getOutLink(outPort, outLink){$.oLink}
openHarmony/openHarmony_node.js, line 1021 -
Returns the $.oLink object representing the connection of a specific outPort / link
Name Type Description outPortint the number of the port to get the link from. outLinkint optional the index of the link. Returns:
Type Description $.oLink The link object describing the connection -
getOutLinks(){Array.<$.oLink>}
openHarmony/openHarmony_node.js, line 1041 -
Returns all the valid oLink objects describing the links that are coming out of this node.
Returns:
Type Description Array.<$.oLink> An array of $.oLink objects. -
getOutLinksNumber(outPort){int}
openHarmony/openHarmony_node.js, line 1009 -
Returns the number of links connected to an outPort
Name Type Description outPortint the number of the port to get links from. Returns:
Type Description int the number of links -
getTimelineLayer(timeline){int}
openHarmony/openHarmony_node.js, line 1333 -
Retrieves the node layer in the timeline provided.
Name Type Description timelineoTimeline optional Optional: the timeline object to search the column Layer. (by default, grabs the current timeline) Returns:
Type Description int The index within that timeline. -
insertInNode(inPort, oNodeObject, inPortTarget, outPortTarget){bool}
openHarmony/openHarmony_node.js, line 1252 -
Inserts the $.oNodeObject provided as an innode to this node, placing it between any existing nodes if the link already exists.
Name Type Description inPortint This node's inport to connect. oNodeObject$.oNode The node to link this one's outport to. inPortTargetint The target node's inPort to connect. outPortTargetint The target node's outPort to connect. Returns:
Type Description bool The result of the link, if successful. -
linkInNode(nodeToLink, ownPort, destPort, createPorts){bool}
openHarmony/openHarmony_node.js, line 949 -
Links this node's inport to the given module, at the inport and outport indices.
Name Type Description nodeToLink$.oNode The node to link this one's inport to. ownPortint optional This node's inport to connect. destPortint optional The target node's outport to connect. createPortsbool optional Whether to create new ports on the nodes. Returns:
Type Description bool The result of the link, if successful. -
linkOutNode(nodeToLink, ownPort, destPort, createPorts){bool}
openHarmony/openHarmony_node.js, line 1178 -
Links this node's out-port to the given module, at the inport and outport indices.
Name Type Description nodeToLink$.oNode The node to link this one's outport to. ownPortint optional This node's outport to connect. destPortint optional The target node's inport to connect. createPortsbool optional Whether to create new ports on the nodes. Returns:
Type Description bool The result of the link, if successful. -
moveToGroup(group)
openHarmony/openHarmony_node.js, line 1272 -
Moves the node into the specified group. This doesn't create any composite or links to the multiport nodes. The node will be unlinked.
Name Type Description groupoGroupNode the group node to move the node into. -
orderAboveNodes(verticalSpacing, horizontalSpacing)
openHarmony/openHarmony_node.js, line 1468 -
Sorts the nodes above this node in a grid like manner, based on their links.
Name Type Default Description verticalSpacingint 120 optional optional: The spacing between two rows of nodes. horizontalSpacingint 40 optional optional: The spacing between two nodes horizontally. -
placeAtCenter(oNodeArray, xOffset, yOffset){oPoint}
openHarmony/openHarmony_node.js, line 1445 -
Place at center of one or more nodes with an offset.
Name Type Description oNodeArrayArray.<$.oNode> The array of nodes to center this below. xOffsetfloat The horizontal offset to apply after centering. yOffsetfloat The vertical offset to apply after centering. Returns:
Type Description oPoint The resulting position of the node. -
refreshAttributes(oNodeObject){bool}
openHarmony/openHarmony_node.js, line 1875 -
Refreshes/rebuilds the attributes and getter/setters.
Name Type Description oNodeObject$.oNode The node to link this one's inport to. Returns:
Type Description bool The result of the unlink. -
remove(deleteColumns, deleteElements){void}
openHarmony/openHarmony_node.js, line 1668 -
Removes the node from the scene.
Name Type Description deleteColumnsbool Should the columns of drawings be deleted as well? deleteElementsbool Should the elements of drawings be deleted as well? Returns:
Type Description void -
removeAttribute(attrName){bool}
openHarmony/openHarmony_node.js, line 1864 -
Removes an existing dynamic attribute in the node.
Name Type Description attrNamestring The attribute name to remove. Returns:
Type Description bool The result of the removal. -
subNodes(recurse){Array.<$.oNode>}
openHarmony/openHarmony_node.js, line 1365 -
obtains the nodes contained in the group, allows recursive search. This method is deprecated and was moved to oGroupNode
Name Type Description recursebool Whether to recurse internally for nodes within children groups. - Deprecated
- Yes
Returns:
Type Description Array.<$.oNode> The subbnodes contained in the group. -
timelineIndex(timeline){int}
openHarmony/openHarmony_node.js, line 1350 -
Retrieves the node index in the timeline provided.
Name Type Description timelineoTimeline optional Optional: the timeline object to search the column Layer. (by default, grabs the current timeline) Returns:
Type Description int The index within that timeline. -
toString(){string}
openHarmony/openHarmony_node.js, line 1722 -
Used in converting the node to a string value, provides the string-path.
Returns:
Type Description string The node path's as a string. -
unlinkInNode(oNodeObject){bool}
openHarmony/openHarmony_node.js, line 965 -
Searches for and unlinks the $.oNode object from this node's inNodes.
Name Type Description oNodeObject$.oNode The node to link this one's inport to. Returns:
Type Description bool The result of the unlink. -
unlinkInPort(inPort){bool}
openHarmony/openHarmony_node.js, line 985 -
Unlinks a specific port from this node's inport.
Name Type Description inPortint The inport to disconnect. Returns:
Type Description bool The result of the unlink, if successful. -
unlinkOutNode(oNodeObject){bool}
openHarmony/openHarmony_node.js, line 1195 -
Links this node's out-port to the given module, at the inport and outport indices.
Name Type Description oNodeObject$.oNode The node to unlink from this node's outports. Returns:
Type Description bool The result of the link, if successful. -
unlinkOutPort(outPort, outLink){bool}
openHarmony/openHarmony_node.js, line 1228 -
Unlinks a specific port/link from this node's output.
Name Type Description outPortint The outPort to disconnect. outLinkint The outLink to disconnect. Returns:
Type Description bool The result of the unlink, if successful.