7.23. SetNodeScalarValue

set_node_scalar_value ‐ Dynamic modification of the value of a scalar attached to a node

7.23.1. Attributes

NameTypeDefaults
idSTRINGNone (required)
valueINTEGER0
valueFLOAT0.0
valueSTRINGEmpty string
operatorSTRINGNone (required)

7.23.2. Description

This action is used to modify the value of a scalar variable associated with a scene node. If the attribute values contain parenthesized expressions, they are dynamically evaluated as numerical expressions and their values are replaced in the attribute value strings. The string value of the operator attribute is an operator string. The values of the operator must be "=", "=", "+=", "-=", "*=", or "/=".

The value v of the value attribute is called source value. The string value id of the id attribute defines the reference to the target scalar. The target node must have a scalar named id. If so, the target scalar is assigned the source value.

7.23.3. Expected children

None.

7.23.4. Expected target

The target node must have a scalar named id.

7.23.5. Example

The example below defines an action that sets the value of the scalar currentFilm of the node main node to the value 1.

<set_node_scalar_value id="currentFilm" 
                      value="1" operator="="/>
<target type="single_node" value="#main node" />