Module Class Reference

The JavaScript class to get information about nodes. Obtain it from the Context global object. More...

Public Slots

Ports
InputPort input (int idx=0)
 retrieve specific input port More...
 
Attributes
Attribute attribute (const String &name)
 Retrieve attribute of specific name in current module. More...
 
Attribute attribute (const String &name, const QVariant &defAttr)
 Retrieve attribute of specific name in current module. More...
 
Attribute attribute (const String &name, QObject defAttr)
 Retrieve attribute of specific name in current module. More...
 
bool dirtyOnFrameKeyChange (int startFrame=0, int endFrame=0)
 Check if the module aknowledges its output became dirty within a frame range, and needs to be re-rendered. More...
 

Properties

int nInputs
 Number of inputs. More...
 
String type
 Type name of current module. More...
 
String name
 Name of current module. More...
 
int id
 Id of current module. More...
 

Detailed Description

The JavaScript class to get information about nodes. Obtain it from the Context global object.

Refers to a specific module linked in the current rendering context. If a module exports its attributes, it is possible to fetch them using methods from this class. Modules can be accessed through the Context.

// Fetch attribute by its name, value is set to 'undefined' if not found
attr1 = module.attribute( "name" );
// Fetch attribute by its name, value is set to Point3d if not found
attr2 = module.attribute( "name", new Point3d() );

Member Function Documentation

◆ attribute [1/3]

Attribute Module::attribute ( const String &  name)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
Returns
Attribute, or null if not found

◆ attribute [2/3]

Attribute Module::attribute ( const String &  name,
const QVariant &  defAttr 
)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
defAttrDefault value for attribute if not found
Returns
Attribute, or Attribute linking to defAttr if not found

◆ attribute [3/3]

Attribute Module::attribute ( const String &  name,
QObject  defAttr 
)
slot

Retrieve attribute of specific name in current module.

Parameters
nameName of attribute
defAttrDefault value for attribute if not found
Returns
Attribute, or Attribute linking to defAttr if not found

◆ dirtyOnFrameKeyChange

bool Module::dirtyOnFrameKeyChange ( int  startFrame = 0,
int  endFrame = 0 
)
slot

Check if the module aknowledges its output became dirty within a frame range, and needs to be re-rendered.

Parameters
startFrameStart of frame range
endFrameEnd of frame range
Returns
True if the node has dirty frames within the frame range. By default it returns false.

◆ input

InputPort Module::input ( int  idx = 0)
slot

retrieve specific input port

Parameters
idxIndex of port [ 0, nInput - 1 ]
Returns
InputPort

Property Documentation

◆ id

int Module::id
read

Id of current module.

◆ name

String Module::name
read

Name of current module.

◆ nInputs

int Module::nInputs
read

Number of inputs.

◆ type

String Module::type
read

Type name of current module.