Script
List of all members
node Class Reference

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

#include <nodeinterface.h>

Inheritance diagram for node:
Inheritance graph
[legend]
Collaboration diagram for node:
Collaboration graph
[legend]

Public Slots

Node Data.
QString root () const
 returns the name of the Top level in the network, which is "Top".
 
bool isGroup (QString node) const
 returns a true or false value indicating if the module is a Group Module.
 
QString getName (QString node) const
 returns the name of a module
 
QString type (QString node) const
 returns the module type. These are all of the built-in module types available from the Stage Module like: READ, COMPOSITE, PEG, QUADMAP, SHADOW, etc
 
int numberOfSubNodes (QString parent) const
 returns an integer that indicates the number of modules contained in a group.
 
QString subNode (QString parent, int iSubNode) const
 returns the path of a module in a group. Modules are counted starting with zero
 
QString subNodeByName (QString parent, QString name) const
 This function returns the full path name of a child node belonging to a parent group. This function will validate that the parent group exists and that the child node exists in that parent. This function should be used instead of manually concatenating the full path name of child nodes.
 
QString parentNode (QString node) const
 returns the path of the parent level of a module contained in a group
 
QString noNode () const
 returns the null string that is returned by other functions when there is an error.
 
bool equals (QString node1, QString node2) const
 returns true or false to indicate if a node path is equal to another. Used to compare node paths.
 
QString getTextAttr (QString node, double atFrame, QString attrName) const
 returns the value(s) of the module's selected attribute(s).
 
QString linkedColumn (QString node, QString attrName) const
 returns the name of the column that an attribute is linked to. If the attribute is not linked to a column, the function returns the null string.
 
virtual int coordX (QString node) const
 returns an integer indicating the X position of a module in the network
 
virtual int coordY (QString node) const
 returns an integer indicating the Y position of a module in the network
 
virtual int width (QString node) const
 returns the width of a given node. This width / height parameter is useful for computing the position of nodes in the Network view. It uses the same unit system as the coordX() and coordY() functions.
 
virtual int height (QString node) const
 returns the height of a given node. This width / height parameter is useful for computing the position of nodes in the Network view. It uses the same unit system as the coordX() and coordY() functions.
 
virtual bool setCoord (QString node, int x, int y)
 sets the position of a module in the network.
 
int numberOfInputPorts (QString node) const
 the number of input ports on the module.
 
bool isLinked (QString node, int iPort) const
 returns true or false to indicate if a port is connected to another module.
 
QString srcNode (QString node, int iPort) const
 returns the path for the module that the port is linked to.
 
QString flatSrcNode (QString node, int iPort) const
 If the srcNode is a Group Module, this function returns the path of the module inside the Group Module that is the source. If the source is not inside a group, the flatSrcNode function behaves like the srcNode function.
 
int numberOfOutputPorts (QString node) const
 the number of output ports on a module.
 
int numberOfOutputLinks (QString node, int iPort) const
 the number of modules actually linked from the output ports.
 
QString dstNode (QString node, int iPort, int iLink) const
 returns the path of the destination module linked to by the output port on the source module.
 
QString flatDstNode (QString node, int iPort, int iLink) const
 If the dstNode is a Group Module, this function returns the path of the module inside the Group Module that is the destination. This function behaves like the dstNode function when the module is not in a group.
 
bool groupAtNetworkBuilding (QString node) const
 returns true if the peg's groupAtNetworkBuilding attribute is true.
 
bool addCompositeToGroup (QString node) const
 returns the value of the "Add Composite To Group" attribute of the peg-module. This method is obsolete.
 
Node Editing
QString add (QString parentGroup, QString name, QString type, int x, int y, int z)
 adds a module to the network.
 
QString getGroupInputModule (QString parentGroup, QString name, int x, int y, int z)
 Return existing or add a group multi port in module.
 
QString getGroupOutputModule (QString parentGroup, QString name, int x, int y, int z)
 Return existing or add a group multi port out module.
 
bool deleteNode (QString name, bool deleteTimedValues=false, bool deleteElements=false)
 Delete a single node. Optionally, delete all columns and element associated to that node. The column and element would only be removed when no other modules refer to them. This function returns true when successful.
 
QString createGroup (QString nodes, QString groupName)
 Create a group from the selection of nodes. The list of nodes is a string where the nodes are separated by commas. The actual name of each node in the list of nodes must include the full path of that node. The function returns the full path of the created group, or an empty string if the creation of the node failed.
 
QString moveToGroup (QString nodeName, QString groupName)
 moves the specified node within the specified group. Similar to performing a drag and drop of a node to a group from the timeline.
 
bool explodeGroup (QString groupName)
 Explode a group into its parent group. This function is identical to the "Explode Selected Group" from the Network view.
 
bool rename (QString node, QString newName)
 changes the name of a module.
 
bool setTextAttr (QString node, QString attrName, int atFrame, QString attrValue)
 changes the value of an attribute in a module.
 
bool linkAttr (QString node, QString attrName, QString columnName)
 links an attribute to a function column in the Xsheet View.
 
bool unlinkAttr (QString node, QString attrName)
 unlinks an attribute from a function column.
 
bool link (QString srcNode, int srcPort, QString dstNode, int dstPort)
 links a port on a module to a port on another module.
 
bool unlink (QString dstNode, int inPort)
 unlinks a port on one module from the port on another module.
 
bool setEnable (QString node, bool flag)
 Setters and getters for the enable/disable property of a node.
 
bool getEnable (QString node)
 returns whether a module is enabled or not.
 
bool setLocked (QString node, bool lock)
 Setters and getters for the lock/unlock property of a node.
 
bool getLocked (QString node)
 returns the lock flag
 
bool setTimelineTag (QString node, bool tag)
 
bool getTimelineTag (QString node)
 
bool setAsGlobalDisplay (QString node)
 This function changes the global display used in the application. The node must be the full path of a display module.
 
bool setGlobalToDisplayAll ()
 This function changes the global display used by the application to "Display All" pseudo-display.
 
bool setAsDefaultCamera (QString node)
 Setters and getters for the default camera.
 
QString getDefaultCamera ()
 returns the name of the default camera.
 
QStringList getCameras ()
 Returns a list of all cameras within the scene.
 
QObject * getMatrix (QString node, int frame)
 returns the model matrix of a node.
 
QObject * getPivot (QString node, int frame)
 returns the pivot of the module
 
void explodeElementSymbolsInGroups (QString element, bool disableElement, bool clearExposure, const QString &prefix=QString())
 This function creates a group for each exposure of element elem where there is a symbol and will put the content of the symbol in that group. If disable element is TRUE, will disable the element afterwards. If clearExposure is TRUE, will clear the exposures where there were symbols afterwards. Will use prefix as the prefix for the generated group names.
 

Detailed Description

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

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 = election.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)
}

Member Function Documentation

QString node::add ( QString  parentGroup,
QString  name,
QString  type,
int  x,
int  y,
int  z 
)
slot

adds a module to the network.

Parameters
parent_group_path,:The path of the parent node into which you want to add this module
name,:The name of the module you will add.
type,:The type of module you will add. The module types are like: READ, COMPOSITE, PEG, QUADMAP, SHADOW, etc.
X: The X position of the module in the Network View.
Y: The Y position of the module in the Network View.
Z: The Z position of the module in the Network View. This property is important when two modules overlap
bool node::addCompositeToGroup ( QString  node) const
slot

returns the value of the "Add Composite To Group" attribute of the peg-module. This method is obsolete.

Parameters
node,:the path of the module
virtual int node::coordX ( QString  node) const
virtualslot

returns an integer indicating the X position of a module in the network

Parameters
node,:the path of the module
virtual int node::coordY ( QString  node) const
virtualslot

returns an integer indicating the Y position of a module in the network

Parameters
node,:the path of the module
QString node::createGroup ( QString  nodes,
QString  groupName 
)
slot

Create a group from the selection of nodes. The list of nodes is a string where the nodes are separated by commas. The actual name of each node in the list of nodes must include the full path of that node. The function returns the full path of the created group, or an empty string if the creation of the node failed.

The parent of the group is implicitly specified. It will be the same as the parent of the first node in the list.

Parameters
nodes,:This a comma delimited list of names of nodes. ( node0,node1,node2)
groupName,:The name of the group to create. The actual group
bool node::deleteNode ( QString  name,
bool  deleteTimedValues = false,
bool  deleteElements = false 
)
slot

Delete a single node. Optionally, delete all columns and element associated to that node. The column and element would only be removed when no other modules refer to them. This function returns true when successful.

Parameters
node,:the path of the module
deleteTimedValues,:A boolean that indicates if the columns referenced by that node shall be removed if they are no longer in use.
deleteElements,:A boolean that indicates if the element should also be removed, if they are no longer in use.
QString node::dstNode ( QString  node,
int  iPort,
int  iLink 
) const
slot

returns the path of the destination module linked to by the output port on the source module.

Parameters
node,:the path of the module
iPort,:The port number on which you want to find the connected module. This value is between 0 and the results of the numberOfInputPorts function.
iLink,:The link number whose destination module you want to find. This value is between 0 and the results of the numberOfInputLinks function.
bool node::equals ( QString  node1,
QString  node2 
) const
slot

returns true or false to indicate if a node path is equal to another. Used to compare node paths.

Parameters
node1,:the path of the first module
node2,:the path of the second module
void node::explodeElementSymbolsInGroups ( QString  element,
bool  disableElement,
bool  clearExposure,
const QString &  prefix = QString() 
)
slot

This function creates a group for each exposure of element elem where there is a symbol and will put the content of the symbol in that group. If disable element is TRUE, will disable the element afterwards. If clearExposure is TRUE, will clear the exposures where there were symbols afterwards. Will use prefix as the prefix for the generated group names.

Parameters
bool node::explodeGroup ( QString  groupName)
slot

Explode a group into its parent group. This function is identical to the "Explode Selected Group" from the Network view.

This function returns true if successful.

Parameters
node,:the name of the module
QString node::flatDstNode ( QString  node,
int  iPort,
int  iLink 
) const
slot

If the dstNode is a Group Module, this function returns the path of the module inside the Group Module that is the destination. This function behaves like the dstNode function when the module is not in a group.

Parameters
node,:the path of the module
iPort,:The port number on which you want to find the connected module. This value is between 0 and the results of the numberOfInputPorts function.
iLink,:The link number whose destination module you want to find. This value is between 0 and the results of the numberOfInputLinks function.
QString node::flatSrcNode ( QString  node,
int  iPort 
) const
slot

If the srcNode is a Group Module, this function returns the path of the module inside the Group Module that is the source. If the source is not inside a group, the flatSrcNode function behaves like the srcNode function.

Parameters
node,:the path of the module
iPort,:the port number on the destination module whose source module you want to find. This value is between 0 and the results of the numberOfInputPorts function.
QStringList node::getCameras ( )
slot

Returns a list of all cameras within the scene.

QString node::getDefaultCamera ( )
slot

returns the name of the default camera.

bool node::getEnable ( QString  node)
slot

returns whether a module is enabled or not.

Parameters
node,:the name of the module
QString node::getGroupInputModule ( QString  parentGroup,
QString  name,
int  x,
int  y,
int  z 
)
slot

Return existing or add a group multi port in module.

QString node::getGroupOutputModule ( QString  parentGroup,
QString  name,
int  x,
int  y,
int  z 
)
slot

Return existing or add a group multi port out module.

bool node::getLocked ( QString  node)
slot

returns the lock flag

Parameters
node,:the name of the module
QObject* node::getMatrix ( QString  node,
int  frame 
)
slot

returns the model matrix of a node.

Parameters
node,:the name of the module
Frame,:is the int that specifies the frame number
QString node::getName ( QString  node) const
slot

returns the name of a module

Parameters
node,:the path of the module
QObject* node::getPivot ( QString  node,
int  frame 
)
slot

returns the pivot of the module

Parameters
node,:the name of the module
frame,:is the int that specified the frame number
Returns
3d point
QString node::getTextAttr ( QString  node,
double  atFrame,
QString  attrName 
) const
slot

returns the value(s) of the module's selected attribute(s).

Parameters
node,:the path of the module
atFrame,:the frame number from which you want to extract the attribute value. If the value is static, you must still pass a value. You can, for example, pass 1 to take the value at the first frame.
attrName,:The attribute whose value you want.

Use the attribute PALETTES.NUMBER to return the number of palettes in the colour override module's palette list. Use the attribute PALETTES.x to return the palette at index x from the colour override module's palette list. x is a number between 0 and the number of palettes in the list, minus one. If x is not given (argument is "PALETTES") or x is not valid (< 0 or out of range) then 0 is assumed.

bool node::getTimelineTag ( QString  node)
slot
bool node::groupAtNetworkBuilding ( QString  node) const
slot

returns true if the peg's groupAtNetworkBuilding attribute is true.

Parameters
node,:the path of the module
virtual int node::height ( QString  node) const
virtualslot

returns the height of a given node. This width / height parameter is useful for computing the position of nodes in the Network view. It uses the same unit system as the coordX() and coordY() functions.

Parameters
node,:the path of the module
bool node::isGroup ( QString  node) const
slot

returns a true or false value indicating if the module is a Group Module.

Parameters
node,:the path of the module
bool node::isLinked ( QString  node,
int  iPort 
) const
slot

returns true or false to indicate if a port is connected to another module.

Parameters
node,:the path of the module
iPort,:The number of the port whose link status you want to check. This value is between 0 and the results of the numberOfInputPorts function.
bool node::link ( QString  srcNode,
int  srcPort,
QString  dstNode,
int  dstPort 
)
slot

links a port on a module to a port on another module.

Parameters
srcNode: The path of the module whose output port you want to link to a destination module.
srcPort,:The port that you want to link to the input port on the destination module. This value is between 0 and the results of the numberOfOutputPorts function.
dstNode,:The path of the module whose input port you want to link to the source module.
dstPort,:The port on the destination module that you want to link to the output port from the source module. This value is between 0 and the results of the numberOfInputPorts function.
bool node::linkAttr ( QString  node,
QString  attrName,
QString  columnName 
)
slot

links an attribute to a function column in the Xsheet View.

Parameters
node,:the name of the module
attrName,:The name of the attribute
columnName,:The name of the column that you want to link to the attribute
QString node::linkedColumn ( QString  node,
QString  attrName 
) const
slot

returns the name of the column that an attribute is linked to. If the attribute is not linked to a column, the function returns the null string.

Parameters
node,:the path of the module
attrName,:The attribute you want to check to see if it is linked to a column
QString node::moveToGroup ( QString  nodeName,
QString  groupName 
)
slot

moves the specified node within the specified group. Similar to performing a drag and drop of a node to a group from the timeline.

Parameters
nodeName,:the name of the module
group_path,:The path of the group.
QString node::noNode ( ) const
slot

returns the null string that is returned by other functions when there is an error.

int node::numberOfInputPorts ( QString  node) const
slot

the number of input ports on the module.

Parameters
node,:the path of the module
int node::numberOfOutputLinks ( QString  node,
int  iPort 
) const
slot

the number of modules actually linked from the output ports.

Parameters
node,:the path of the module
iPort,:The port number on which you want to locate the module that is connected to it. This value is between 0 and the results of the numberOfInputPorts function.
int node::numberOfOutputPorts ( QString  node) const
slot

the number of output ports on a module.

Parameters
node,:the path of the module
int node::numberOfSubNodes ( QString  parent) const
slot

returns an integer that indicates the number of modules contained in a group.

Parameters
parent,:the path of the parent module
QString node::parentNode ( QString  node) const
slot

returns the path of the parent level of a module contained in a group

Parameters
node,:the path of the module
bool node::rename ( QString  node,
QString  newName 
)
slot

changes the name of a module.

Parameters
node,:the name of the module
newName,:The new name for the module.
QString node::root ( ) const
slot

returns the name of the Top level in the network, which is "Top".

bool node::setAsDefaultCamera ( QString  node)
slot

Setters and getters for the default camera.

sets the default camera in the scene. Returns whether successful or not.

Parameters
node,:the name of the camera
bool node::setAsGlobalDisplay ( QString  node)
slot

This function changes the global display used in the application. The node must be the full path of a display module.

This function returns true if successful. It returns false if the display node was not found or an invalid name was provided.

Parameters
node,:The full path of a display node
virtual bool node::setCoord ( QString  node,
int  x,
int  y 
)
virtualslot

sets the position of a module in the network.

Parameters
node,:the path of the module
X,:The X position of the module in the Network View
Y,:The Y position of the module in the Network View
bool node::setEnable ( QString  node,
bool  flag 
)
slot

Setters and getters for the enable/disable property of a node.

sets the enable flag of the node.

Parameters
node,:the name of the module
flag: true or false
bool node::setGlobalToDisplayAll ( )
slot

This function changes the global display used by the application to "Display All" pseudo-display.

This function returns true if successful.

bool node::setLocked ( QString  node,
bool  lock 
)
slot

Setters and getters for the lock/unlock property of a node.

sets the lock flag

Parameters
node,:the name of the module
bool node::setTextAttr ( QString  node,
QString  attrName,
int  atFrame,
QString  attrValue 
)
slot

changes the value of an attribute in a module.

Additions specific to the Colour Override module: Use the attribute PALETTES.CLEAR to clear the palette list in the colour override module. Use the attribute PALETTES.ADD to add a palette to the palette list of the colour override module. Use the attribute PALETTES.REMOVE to remove a palette from the palette list of the colour override module.

Parameters
node,:the name of the module
attrName,:The name of the attribute whose value you want to change.
atFrame,:the frame number at which you set the value.
attrValue: new value
bool node::setTimelineTag ( QString  node,
bool  tag 
)
slot
QString node::srcNode ( QString  node,
int  iPort 
) const
slot

returns the path for the module that the port is linked to.

Parameters
node,:the path of the module
iPort,:he port number on the destination module whose source module you want to find. This value is between 0 and the results of the numberOfInputPorts function.
QString node::subNode ( QString  parent,
int  iSubNode 
) const
slot

returns the path of a module in a group. Modules are counted starting with zero

Parameters
parent,:the path of the parent module
iSubNode,:An integer representing the numerical value of the module. This value must be between 0 and the numberOfSubNodes function for that point.
QString node::subNodeByName ( QString  parent,
QString  name 
) const
slot

This function returns the full path name of a child node belonging to a parent group. This function will validate that the parent group exists and that the child node exists in that parent. This function should be used instead of manually concatenating the full path name of child nodes.

Parameters
parent,:Fully qualified path of the parent group.
name,:The actual node name suffix. This one is only the short name, not the full path of the node
QString node::type ( QString  node) const
slot

returns the module type. These are all of the built-in module types available from the Stage Module like: READ, COMPOSITE, PEG, QUADMAP, SHADOW, etc

Parameters
node,:the path of the module
bool node::unlink ( QString  dstNode,
int  inPort 
)
slot

unlinks a port on one module from the port on another module.

Parameters
dstNode,:The path of the module whose input port you want to unlink from the source module.
inPort,:The input port that you want to unlink. This value is between 0 and the results of the numberOfInputPorts function.
bool node::unlinkAttr ( QString  node,
QString  attrName 
)
slot

unlinks an attribute from a function column.

Parameters
node,:the name of the module
attrName,:The name of the attribute that you want to unlink.
virtual int node::width ( QString  node) const
virtualslot

returns the width of a given node. This width / height parameter is useful for computing the position of nodes in the Network view. It uses the same unit system as the coordX() and coordY() functions.

Parameters
node,:the path of the module

The documentation for this class was generated from the following file: