The RigState JavaScript class. Represents the state of a rig for a given pose. More...
Public Slots | |
NodeState | getNodeState (int index) |
Get a copy of the NodeState contained in the current RigState object at the specified index. More... | |
RigState | interpolate (float a, RigState b) |
Create a new RigState, by linearly interpolating the current one with the other one given in argument. More... | |
RigState | interpolate2d (float u, float v, RigState b, RigState c, RigState d) |
Create a new RigState, by performing a bilinear interpolation of the current one with the 3 other ones given in argument. More... | |
int | nodeCount () |
Get the node count contained in this RigState. More... | |
void | addNodeAttrList (String &sNodePath, QScriptValue sAttrArray, int frameNo) |
Add node attributes to the current RigState snapshot. More... | |
void | applyState (int frameNo) |
Apply the values of the current snapshot to the scene, at the specified frame. More... | |
String | toString (String &sRelativePath) |
Generate a string representation of the current RigState data. More... | |
int | loadFromString (String &sData, int nPos, String &sRelativePath) |
Restore a RigState from a previously generated RigState string representation. More... | |
Public Member Functions | |
RigState (String stateName, int frameNo, String nodeQualifiedName) | |
Create a new RigState. More... | |
~RigState () | |
Properties | |
String | stateName |
The given name of the current RigState snapshot. More... | |
int | frameNo |
The source frame number associated to the current RigState snapshot, at creation. Note : interpolated states have no source frame number. More... | |
The RigState JavaScript class. Represents the state of a rig for a given pose.
A RigState is a snapshot of a part of the node network. It can store all attributes values associated to a rig state, such as position, color, effects parameters, scale, deformation, drawings, etc. These snapshots, or RigStates, can be stored, blended, and applied to a rig. It aims at making it easier to manipulate rig data by offering a simple, high-level interface to represent the state of a rig. Internally, a RigState object contains a list of nodes and attributes with their values for a given pose.
RigState::RigState | ( | String | stateName, |
int | frameNo, | ||
String | nodeQualifiedName | ||
) |
Create a new RigState.
The example below transfers a head pose from frame 15 to frame 20.
stateName | : The identifier given to this new state |
frameNo | : The frame index used to create the state snapshot |
nodeQualifiedName | : The qualified name of the root group under which all sub-node attribute values will be captured in the snapshot. |
RigState::~RigState | ( | ) |
|
slot |
Add node attributes to the current RigState snapshot.
This example creates an empty RigState and then adds the POSITION attribute for the Master-P node.
sNodePath | : The node qualified name to add. |
sAttrArray | : An array of attribute names to add. |
frameNo | : The frame number to use while fetching attribute values. |
|
slot |
Apply the values of the current snapshot to the scene, at the specified frame.
The example below transfers the properties of all nodes under the group "Top/CH001_Beaver/head_neck" from frame 15 to frame 20.
frameNo | : The destination frame number, where the RigState snapshot values are applied. |
|
slot |
Get a copy of the NodeState contained in the current RigState object at the specified index.
This example iterates all node states.
index | : The index of the node state to retrieve. Must be within [0-nodeCount[. |
Create a new RigState, by linearly interpolating the current one with the other one given in argument.
The example below interpolates poseA with poseB, giving a weight of 75% to pose A and 25% to poseB.
a | : The normalized weight given to pose b. |
b | : The pose to interpolate the current one with |
Create a new RigState, 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 pose of the bilinear interpolation |
c | : The third pose of the bilinear interpolation |
d | : The fourth pose of the bilinear interpolation |
|
slot |
Restore a RigState from a previously generated RigState string representation.
This example loads a string representation from a saved file and restores the original RigState.
sData | : The string containing the pose data. |
nPos | : The start index in the string |
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 |
|
slot |
Generate a string representation of the current RigState data.
This example creates a new 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 source frame number associated to the current RigState snapshot, at creation. Note : interpolated states have no source frame number.
|
readwrite |
The given name of the current RigState snapshot.