A single block that specifies either an input (a variable) or an output (a function or operation); connected together they form a NodeTree. Node blocks are the visual representation of code and can be used to build Script, Utility and Shader. It is ideal to use for non-programmers and they act as interconnected building blocks allowing you to do virtually everything that a programmer's code will do.
From a programmer standpoint nodes can also be manually generated using Node Definition Tags
(see Node Definition Tags). Using the NDT a programmer can then create its own node blocks from non-programmers to use based on its own Lua
or GLSL
code and functions.
See Also
Static Variables
Variables
Name | Description |
flags | Bit mask generated out of NodeBlock flags. |
Declaration
Cap | Value | Description |
NOD_FLAG_SELECTED | bit.lshift(1,0) | Specify wether or not the active NodeBlock is selected. |
NOD_FLAG_ROOT | bit.lshift(1,1) | Hint the system that the NodeBlock is a root node. |
NOD_FLAG_OUTPUT | bit.lshift(1,2) | Specify to the system that the NodeBlock is an output. |
NOD_FLAG_VARIABLE | bit.lshift(1,3) | The NodeBlock is an input variable. |
NOD_FLAG_LOCAL | bit.lshift(1,4) | Specify that the NodeBlock functionalities are local (Lua). |
NOD_FLAG_ATTRIBUTE | bit.lshift(1,5) | Specify that the NodeBlock is an attribute (GLSL). |
NOD_FLAG_GLOBAL | bit.lshift(1,6) | Specify that the NodeBlock is a global variable (Lua) or a uniform (GLSL). |
NOD_FLAG_FUNCTION | bit.lshift(1,7) | Specify that the NodeBlock contains an user function. |
NOD_FLAG_PRIORITY | bit.lshift(1,8) | Allow the user to increase or decrease the priority of the NodeBlock. |
NOD_FLAG_READ_ONLY | bit.lshift(1,9) | Prevent the user to modify the underlying code of the NodeBlock. |
NOD_FLAG_UPDATE | bit.lshift(1,10) | Force a full update of the NodeBlock GUI. |
- Note
- Flags assigned automatically while parsing the node definition tags; however they can also be tweaked by the programmer to force certain functionalities.
|
line_number | The underlying line number the node is current present in the code. |
Declaration
|
dna | Unique identifier that is generated based on the NodeBlock definition code. |
Declaration
|
location | The location and scale of the NodeBlock in the Node Editor. |
Declaration
|
Functions
The function below is still exposed to the scripting and plugin interface however they are called automatically by the node generator. There is very little need for a programmer to directly use theses function; they are listed here mostly for reference purposes.
Name | Description |
AddLink | Attach a new NodeLink to the active NodeBlock. |
Declaration NodeLink *AddLink( const char *name ) Parameters
name : Unique name to identify the NodeLink.
Return Value
A new NodeLink reference.
|
AddPlug | Add a new NodePlug to the current NodeBlock. |
Declaration NodePlug *AddPlug( const char *name, const VariableType type ) Parameters
Return Value
A new NodePlug reference attached to the current NodeBlock.
|
AddInput | Create a new NodeInput and attach it to the current NodeBlock. |
Declaration NodeInput *AddInput( const char *name, const VariableType type ) Parameters
Return Value
A new NodeInput reference.
|
AddOutput | Add a new NodeOutput to the current NodeBlock. |
Declaration NodeOutput *AddOutput( const char *name, const VariableType type ) Parameters
Return Value
A new NodeOutput reference that is attached to the current NodeBlock.
|
ConnectLink | Create a new NodeInput and attach it to the current NodeBlock. |
Declaration bool ConnectLink( const char *link_name, NodeBlock *dst ) Parameters
link_name : The link name to connect.
dst : The destination NodeBlock to connect it to.
Return Value
true on success; return false if the destination NodeBlock is invalid. If the destination is a root, a variable, is a local or an attribute (see flags for more info.).
|
DisconnectLink | Disconnect an existing link. |
Declaration bool DisconnectLink( const char *link_name )
link_name : Name of the NodeBlock link to disconnect.
Return Value
true if the link have successfully been disconnected; false if the link name doesn't correspond to any NodeLink maintained by the NodeBlock, or if the link was not connected to anything.
|
ConnectOutput | Connect an existing NodeOutput. |
Declaration bool ConnectOutput( const char *output_name, NodeBlock *dst, const char *plug_name ) Parameters
output_name : The output name to connect.
dst : The destination NodeBlock to connect it to.
plug_name : The destination NodePlug name.
Return Value
true on success; return false if the destination is invalid or the plug name doesn't exist.
|
DisconnectOutput | Disconnect an existing link. |
Declaration bool DisconnectOutput( const char *output_name ) Parameters
Return Value
true if the disconnected successfully; false if the output name doesn't correspond to any NodeOutput maintained by the current NodeBlock, or if the output was not connected.
|
DisconnectPlug | Disconnect an existing NodePlug using its name key. |
Declaration bool DisconnectPlug( const char *plug_name ) Parameters
plug_name : The plug name to connect.
Return Value
true on success; return false if the plug provided is invalid or if the plug was not connected.
|
DisconnectAll | Disconnect all possible connection to the active NodeBlock. |
Declaration bool DisconnectAll( void )
|
NodeValue
Special container designed to maintain and handle a variable or a list of predefined options (NodeList).
Static Variables
Variables
Name | Description |
| Specify a tool tip for the user. |
| Specify the value range (the min. and max.) that can be manipulated by the NodeValue. |
Declaration - Note
- The lowest value should be stored in the
X component and max. should be placed in the Y component of the vector.
|
_bool | Access the value of a boolean variable. |
Declaration
|
_int | Access the value of an integer variable. |
Declaration
|
_float | Access the value of a floating point variable. |
Declaration
|
_vec2 | Access the value of a two dimensional vector. |
Declaration
|
_vec3 | Access the value of a tri-dimensional vector variable. |
Declaration
|
_vec4 | Access the value of a color or quaternion variable. |
Declaration
|
_string | Access the value of string variable. |
Declaration
|
NodeLink
A structure that handles calls from one NodeBlock to another.
Static Variables
NodePlug
A structure that handles input to a dedicated parameter usually part of a Lua or GLSL function.
Static Variables
Name | Description |
nodevalue | Default NodeValue handled by the plug. |
Declaration
|
name | Unique name to identify the plug. |
Declaration
|
NodeInput
A structure that handles an input variable.
Static Variables
Name | Description |
nodevalue | Default NodeValue handled by the input. |
Declaration
|
name | Unique name to identify the input. |
Declaration
|
NodeOutput
A structure that handles a return value.
Static Variables
Name | Description |
nodevalue | The NodeValue associated to the type of output data. |
Declaration
|
nodepin_count | Amount of pins that correspond to the number of components handled by the output VariableType. |
Declaration unsigned char nodepin_count
|
name | Name to identify the NodeOutput. |
Declaration
|
Variables
Name | Description |
var_index | Internal variable index assigned by the code generator. |
Declaration
|