Node

Nodes are synonymous with Filter, IO, Move and Group Modules in the Network View.

With Node functions, you can retrieve values from modules in your effects and compositing network. You can also use these functions to add and link modules in your network, and set their attributes.

Because there can be identical module names in the effects network, you must use the full path to identify a module. Similarly, when functions return module names, they often use the full path.

The syntax for module paths is:

Top/Group_Name/Module_Name

To find the proper syntax for modules and their attributes, create a scene, add the modules you want to check, save the scene and then check the *.stage file.

The following is a list of the Node functions:

add
addCompositeToGroup
coordX
coordY
createGroup
deleteNode
dstNode
equals
explodeElementSymbolsInGroups
explodeGroup
flatDstNode
flatSrcNode
getCameras
getDefaultCamera
getEnable
getLocked
getMatrix
getName
getTextAttr
groupAtNetworkBuilding
isGroup
isLinked
link
linkAttr
linkedColumn
moveToGroup
noNode
numberOfInputPorts
numberOfOutputLinks
numberOfOutputPorts
numberOfSubNodes
parentNode
rename
root
setAsDefaultCamera
setAsGlobalDisplay
setCoord
setEnable
setGlobalToDisplayAll
setLocked
setTextAttr
srcNode
subNode
subNodeByName
type
unlink
unlinkAttr
width/height

Example

This script automates the process of compositing several modules together using a Composite Module. This script takes all of the selected modules in the Network View and links them to a new Composite Module, named “comp”.

{

/* The parentNode function in this script adds the Composite Module in the parent group of the selected modules.

The link function, in a loop, connects all selected modules to the new Composite Module.

The setCoord function positions the new module in the network.

function compose()*/

 

var n = selection.numberOfNodesSelected();

var i, posx, posy;

 

if (n > 0)

{

var comp = node.add(

node.parentNode(selection.selectedNode(0)), "comp",

"COMPOSITE", 0, 0, 0);

posx = 0; posy = -10000;

for (i = 0; i < n; ++i)

{

var selNode = selection.selectedNode(i);

node.link(selNode, 0, comp, i);

posx += node.coordX(selNode);

if (node.coordY(selNode) > posy)

posy = node.coordY(selNode);

}

posx /= n;

posy += 50;

node.setCoord(comp, posx, posy)

}

}

Related Topics 

Scripting Reference