The NodeState JavaScript class. Represents the state of a node for a given pose. More...
Public Slots | |
NodeState | interpolate (float a, NodeState b) |
Create a new NodeState, by linearly interpolating the current one with the other one given in argument. More... | |
NodeState | interpolate2d (float u, float v, NodeState b, NodeState c, NodeState d) |
Create a new NodeState, by performing a bilinear interpolation of the current one with the 3 other ones given in argument. More... | |
AttrState | getAttr (int index) |
Get a copy of the AttrState contained in the current NodeState object at the specified index. More... | |
int | getAttrCount () |
Get the attribute count tracked by this NodeState. More... | |
void | applyState (int frameNo) |
Apply the values of the current NodeState snapshot to the scene, at the specified frame. More... | |
int | loadFromString (String &sData, int nPos, String &sRelativePath) |
Restore a NodeState from a previously generated NodeState string representation. More... | |
String | toString (String &sRelativePath) |
Generate a string representation of the current NodeState data. More... | |
Public Member Functions | |
virtual | ~NodeState () |
Properties | |
String | sNodePath |
The qualified name of the node associated with the current NodeState object. More... | |
The NodeState JavaScript class. Represents the state of a node for a given pose.
A NodeState is a snapshot of the state of a node and of its selected attributes. This snapshot can be stored, blended, and applied to a scene destination frame. It aims at making it easier to manipulate node data by offering a simple, high-level interface to represent the state of a node. Internally, a NodeState object contains a list of attributes with their values for a given pose or frame number.
|
virtual |
|
slot |
Apply the values of the current NodeState snapshot to the scene, at the specified frame.
The example below transfers ["POSITION", "SCALE", "ROTATION"] properties of node "Top/Master-P" from frame 1 to frame 20.
frameNo | : The destination frame number, where the NodeState snapshot values are applied. |
|
slot |
Get a copy of the AttrState contained in the current NodeState object at the specified index.
This example creates a NodeState containing position, scale and rotation attributes of "Top/Master-P" node. It then returns the AttrState for the second attribute (scale)
index | : The index of the AttrState to retrieve. Must be within [0-getAttrCount[. |
|
slot |
Get the attribute count tracked by this NodeState.
This example creates a RigState from the "Top" group, then gets the first NodeState from it and displays its attribute count.
Create a new NodeState, by linearly interpolating the current one with the other one given in argument.
The example below interpolates poseA with poseB, giving a weight of 25% to state A and 75% to state B.
a | : The normalized weight given to state b. |
b | : The state to interpolate the current one with (node and attributes must match) |
Create a new NodeState, by performing a bilinear interpolation of the current one with the 3 other ones given in argument.
The example below illustrates the long and short way to perform a bilinear interpolation.
u | : First axis interpolation weight |
v | : Second axis interpolation weight |
b | : The second NodeState of the bilinear interpolation |
c | : The third NodeState of the bilinear interpolation |
d | : The fourth NodeState of the bilinear interpolation |
|
slot |
Restore a NodeState from a previously generated NodeState string representation.
This example creates a string representation .
sData | : The string containing the NodeState data. |
nPos | : The start index in the string (typicaly zero) |
sRelativePath | : The qualified name of the root character group (optional). When provided, this argument makes it possible to adjust data generated from a character group that was renamed. |
|
slot |
Generate a string representation of the current NodeState data.
This example creates a new node state, generates the string representation and saves the data to a file.
sRelativePath | (optional) : The qualified name of the root character group (optional). When provided, node paths are stored relative to this group, making it possible to rename or move the character group node without invalidating the data. |
|
readwrite |
The qualified name of the node associated with the current NodeState object.