Harmony
Scripting Interface Documentation
DeformationUtils Namespace Reference

Deformation utility functions. More...

Functions

QScriptValue getDeformationComponentMatrix (QScriptContext *context, QScriptEngine *engine)
 Return the deformation matrix describing the parent deformation. More...
 
QScriptValue createVertexTransform (QScriptContext *context, QScriptEngine *engine)
 Return a VertexTransform to apply a deformation node transformation. More...
 

Detailed Description

Deformation utility functions.

Function Documentation

◆ createVertexTransform()

QScriptValue DeformationUtils::createVertexTransform ( QScriptContext *  context,
QScriptEngine *  engine 
)

Return a VertexTransform to apply a deformation node transformation.

var vertexTransform = createVertexTransform("Top/LastDeformationOfAChain");
var fieldOffset = node.getAttr("Top/myOffset", frame.current(), "offset").pos2dValue();
// Apply the deformation chain deformation to the offset point.
// By example, use this function to apply a deformation chain on another deformation chain.
var newFieldOffset = vertexTransform.applyVertexTransform(fieldOffset);
Parameters
nodethe path to the last node in a deformation chain (ex: "Top/LastDeformationOfAChain")

◆ getDeformationComponentMatrix()

QScriptValue DeformationUtils::getDeformationComponentMatrix ( QScriptContext *  context,
QScriptEngine *  engine 
)

Return the deformation matrix describing the parent deformation.

Parameters
nodethe path to the node (ex: "Top/MyDeformation")
framethe frame at which the parent transformation is evaluated Ex:
var parentMatrix = getDeformationComponentMatrix("Top/MyDeformation", frame.current());
var newPoint = parentMatrix.multiply(myPoint);