Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IVariable

The IVariable graph node interface.

Variable nodes provide a generic bridge between user logic code and certain scene graph nodes as well as a means for simple arithmetic operations within the scene graph. Variable nodes serve as input for e.g. controllers that implement the Graph::IVariableController interface, or Graph::IClipTransition nodes.

Depending on the actual operation given (IEnums::ALU_OPERATION_*), certain constraints apply to the given input and output data types (inType and outType: IEnums::VARIABLE_TYPE_*) as well as number of constant and variable inputs and outputs (numIn and numOut):

  • COPY and REPLACE: numIn==1, numOut==0, inType==outType Result equals input operand #0.
  • ADD, SUBTRACT, SUBTRACT_REVERSE, MULTIPLY, DIVIDE, DIVIDE_REVERSE: numIn>=2, numOut==0, inType==outType, inType==SINT32||REAL Result is the combined operation over all input operands.
  • MAP, MAP_CLAMPED: numIn>=3, numIn==numOut, inType==REAL Input operands 1..N represent an either strictly ascending or descending sequence of values that map input operand 0 linearly to their corresponding output values (not necessarily in strict order). MAP_CLAMPED clamps the result to the given first or last output operand, if input #0 is outside the range of inputs 1..N. Output #0 is ignored.
  • LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL: numIn==2, numOut==0, outType==BOOL, inType==SINT32||REAL Result is boolean true or false depending on comparison outcome.
  • EQUAL, NOT_EQUAL: numIn==2, numOut==0, outType==BOOL, inType==SINT32||REAL||BOOL Result is boolean true or false depending on comparison outcome.
  • NEGATE: numIn==1, numOut==0, inType==outType, inType==SINT32||REAL Result is the negated input #0 (-value).
  • INVERT: numIn==1, numOut==0, inType==outType, inType==SINT32||BOOL Result is bitwise (SINT32) or logically (BOOL) inverted.
  • AND, OR, XOR: numIn>=2, numOut==0, inType==outType, inType==SINT32||BOOL Result is the bitwise (SINT32) or logical (BOOL) outcome of operation.


Table members

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

SetInputType(type)

Set the data type for all constant input operands.

Boolean SetInputType(Murl.IEnums.VariableType type)

Parameters
typeThe data type.
Returns
Boolean true if successful.

GetInputType()

Get the data type for all constant input operands.

Murl.IEnums.VariableType GetInputType()

Returns
Murl.IEnums.VariableType The data type.

SetOutputType(type)

Set the output data type.

Boolean SetOutputType(Murl.IEnums.VariableType type)

Parameters
typeThe data type.
Returns
Boolean true if successful.

GetOutputType()

Get the output data type.

Murl.IEnums.VariableType GetOutputType()

Returns
Murl.IEnums.VariableType The data type.

SetOperation(operation)

Set the arithmetic/logic operation to perform.

Boolean SetOperation(Murl.IEnums.AluOperation operation)

Parameters
operationThe operation.
Returns
Boolean true if successful.

GetOperation()

Get the arithmetic/logic operation performed.

Murl.IEnums.AluOperation GetOperation()

Returns
Murl.IEnums.AluOperation The operation.

SetAutoResetEnabled(enabled)

Enable/disable auto-resetting.

Boolean SetAutoResetEnabled(Boolean enabled)

Parameters
enabledIf true, auto-resetting is enabled.
Returns
Boolean true if successful.

IsAutoResetEnabled()

Check if auto-resetting is enabled.

Boolean IsAutoResetEnabled()

Returns
Boolean true if auto-resetting is enabled.

GetVariableInputOperandNodeTarget()

Get the constant Graph::IVariableNodeTarget container referencing the input variables. This method returns a constant pointer to the node's Graph::IVariableNodeTarget container, which allows to query references to the input variables.

Murl.Graph.IGenericNodeTarget.GraphIVariable GetVariableInputOperandNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIVariable The constant Graph::IVariableNodeTarget container, or null if not available.

GetVariableOutputOperandNodeTarget()

Get the constant Graph::IVariableNodeTarget container referencing the output variables. This method returns a constant pointer to the node's Graph::IVariableNodeTarget container, which allows to query references to the output variables.

Murl.Graph.IGenericNodeTarget.GraphIVariable GetVariableOutputOperandNodeTarget()

Returns
Murl.Graph.IGenericNodeTarget.GraphIVariable The constant Graph::IVariableNodeTarget container, or null if not available.

SetConstantInputOperand(index, value)

Set a constant floating-point input value at a given index. See class description.

Boolean SetConstantInputOperand(Integer index, Number value)

Parameters
indexThe input operand index.
valueThe value to apply.
Returns
Boolean true if successful.

SetConstantInputOperand(index, value)

Set a constant string input value at a given index. See class description.

Boolean SetConstantInputOperand(Integer index, String value)

Parameters
indexThe input operand index.
valueThe value to apply.
Returns
Boolean true if successful.

SetConstantInputOperand(index, value)

Set a constant boolean input value at a given index. See class description.

Boolean SetConstantInputOperand(Integer index, Boolean value)

Parameters
indexThe input operand index.
valueThe value to apply.
Returns
Boolean true if successful.

GetConstantInputOperand(index, value)

Get a constant floating-point input value at a given index. See class description.

Boolean, Number GetConstantInputOperand(Integer index, Number value)

Parameters
indexThe input operand index.
valueThe return value to retrieve.
Returns
Boolean true if successful.
Number value The return value to retrieve.

GetConstantInputOperand(index, value)

Get a constant boolean input value at a given index. See class description.

Boolean, Boolean GetConstantInputOperand(Integer index, Boolean value)

Parameters
indexThe input operand index.
valueThe return value to retrieve.
Returns
Boolean true if successful.
Boolean value The return value to retrieve.

SetConstantOutputOperand(index, value)

Set a constant floating-point output value at a given index. See class description.

Boolean SetConstantOutputOperand(Integer index, Number value)

Parameters
indexThe output operand index.
valueThe value to apply.
Returns
Boolean true if successful.

SetConstantOutputOperand(index, value)

Set a constant string output value at a given index. See class description.

Boolean SetConstantOutputOperand(Integer index, String value)

Parameters
indexThe output operand index.
valueThe value to apply.
Returns
Boolean true if successful.

SetConstantOutputOperand(index, value)

Set a constant boolean output value at a given index. See class description.

Boolean SetConstantOutputOperand(Integer index, Boolean value)

Parameters
indexThe output operand index.
valueThe value to apply.
Returns
Boolean true if successful.

GetConstantOutputOperand(index, value)

Get a constant floating-point output value at a given index. See class description.

Boolean, Number GetConstantOutputOperand(Integer index, Number value)

Parameters
indexThe output operand index.
valueThe return value to retrieve.
Returns
Boolean true if successful.
Number value The return value to retrieve.

GetConstantOutputOperand(index, value)

Get a constant boolean output value at a given index. See class description.

Boolean, Boolean GetConstantOutputOperand(Integer index, Boolean value)

Parameters
indexThe output operand index.
valueThe return value to retrieve.
Returns
Boolean true if successful.
Boolean value The return value to retrieve.

GetValue(value)

Try to get the result as a floating-point value.

Boolean, Number GetValue(Number value)

Parameters
valueA reference to a floating-point variable to receive the result.
Returns
Boolean true if successful.
Number value A reference to a floating-point variable to receive the result.

GetValue(value)

Try to get the result as a boolean value.

Boolean, Boolean GetValue(Boolean value)

Parameters
valueA reference to a boolean variable to receive the result.
Returns
Boolean true if successful.
Boolean value A reference to a boolean variable to receive the result.