Xflow operator list

Christian edited this page Mar 19, 2015 · 5 revisions

Table of Contents

Basic Operations

xflow.add

Adds two float3 with each other, component wise.

result = value1 + value2

Signature

 result = xflow.add(value1, value2)
 @param float3      value1       first float3 value
 @param float3      value2       second float3 value
 @return float3     result       float3 of value: value1 + value2

xflow.sub

Substract two float3 with each other, component wise.

result = value1 - value2

Signature

 result = xflow.sub(value1, value2)
 @param float3      value1       first float3 value
 @param float3      value2       second float3 value
 @return float3     result       float3 of value: value1 - value2

xflow.normalize

Normalize a float3 value.

Signature

 result = xflow.normalize(value)
 @param float3      value       float3 value
 @return float3     result      normalized float3 value

xflow.mul (Matrix)

Multiply two Transformations (float4x4). When using the resulting transformation on a vector, value1 is applied FIRST and value2 SECOND.

Signature

 result = xflow.mul(value1, value2)
 @param  float4x4 value1  first transformation
 @param  float4x4 value2  second transformation
 @return float4x4 result  multiplied transformation

xflow.flipNormal

Invert the supplied normals

Signature

 result = xflow.flipNormal(value)
 @param float3      value       float3 value
 @return float3     result      value * -1

Transformations

xflow.createTransform

Compute transformation matrix from basic transformation steps.

Signature

 result = xflow.createTransform(translation, rotation, scale, center, scaleOrientation)
 @param float3      translation       translation of transformation (optional)
 @param float4      rotation          rotation of transformation (quarternion)(optional)
 @param float3      scale             scale of transformation (optional)
 @param float3      center            origin of rotation and scale (optional)
 @param float4      scaleOrientation  orientation of scaling (quarternion) (optional)
 @return float4x4[] result            final transformation (optional)

xflow.createTransformInv

Compute inverse transformation matrix from basic transformation steps.

Signature

 result = xflow.createTransformInv(translation, rotation, scale, center, scaleOrientation)
 @param float3      translation       translation of transformation (optional)
 @param float4      rotation          rotation of transformation (quarternion) (optional)
 @param float3      scale             scale of transformation (optional)
 @param float3      center            origin of rotation and scale (optional)
 @param float4      scaleOrientation  orientation of scaling (quarternion) (optional)
 @return float4x4[] result            final inverse transformation (optional)

Morphing

xflow.morph

morph a float3 value, by adding a weighted offset value.

result = value + valueAdd * weight

Signature

 result = xflow.morph(value, valueAdd, weight)
 @param  float3 value     The base float3 value
 @param  float3 valueAdd  A delta value that is added to the base value
 @param  float  weight    weight that is multiplied with valueAdd before being added
 @return float3 result    result = value + weight * valueAdd       

Sequences

xflow.lerpSeq

Linear interpolation of float3 values Output is a linear interpolation of two float3 of the sequence depending on the input key.

Signature

 result = xflow.lerpSeq(sequence, key)
 @param  float3 sequence  The sequence values
 @param  float  key       determines two values of the sequence that are interpolated
 @return float3 result    interpolated position of the sequence 

xflow.slerpSeq

Spherical Linear interpolation (slerp) of rotation values. Output is a linear interpolation of two rotations of the sequence depending on the input key.

Signature

 result = xflow.slerpSeq(sequence, key)
 @param  float4 sequence The base position value - this is expected to be a sequence
 @param  float  key      determines two values of the sequence that are interpolated
 @return float4 result   interpolated rotation of the sequence

Skinning

xflow.skinPosition

Signature

 result = xflow.skinPosition(pos, boneIndices, boneWeights, boneXform)
 @param  float3      pos         position to be skinned
 @param  int4        boneIndices 4 indicies referring bone transformations in boneXfm - indices must be >= 0
 @param  float4      boneWeights 4 weights for each bone transformation - sum of all weights has to be one
 @param  float4x4[]  boneXform   an array of transformations, one for each bone
 @return float3      result      the skinned position

xflow.skinDirection

Signature

 result = xflow.skinDirection(dir, boneIndices, boneWeights, boneXform)
 @param  float3      dir         direction to be skinned
 @param  int4        boneIndices 4 indicies referring bone transformations in boneXfm - indices must be >= 0
 @param  float4      boneWeights 4 weights for each bone transformation - sum of all weights has to be one
 @param  float4x4[]  boneXform   an array of transformations, one for each bone
 @return float3      result      the skinned position

xflow.forwardKinematics

This converts a relative transformation hierarchy into an array of absolute transformations. As input the script takes an array of transformations that represent a flattened hierarchy with the field transform. The field parent provides the necessary information which joint is the parent of a given joint. The result of the script is the flattened transformation array where each transformation is the accumulation of all transformation from the bone to the root.

Signature

 result = xflow.forwardKinematics(parent, xform)
 @param int[]       parent  described the parent of each bone by index
 @param float4x4[]  xform   transformation of each bone (local)
 @return float4x4[] result  accumulated transformations (with transformations of ancestors)

xflow.forwardKinematicsInv

Same as xflow.flattenBoneTransform, only produces the inverse transformation, by accumulating the transformations in the inverse order.

Signature

 result = xflow.forwardKinematicsInv(parent, xform)
 @param int[]       parent  described the parent of each bone by index
 @param float4x4[]  xform   transformation of each bone (local and inverse) 
 @return float4x4[] result  accumulated inverse transformations (with transformations of ancestors)

Debugging

xflow.debug.createSkinCubes (available in develop branch)

This operators generates a cube mesh from skeleton data. There is will be one cube of the specified size for each bone. Use this to check your skeleton animation without any mesh.

Signature

 (index, position, normal, boneIndices , boneWeights) = xflow.debug.createSkinCubes(bindTransforms, size)
 @param float4x4[] bindTransforms The (accumulated) bind pose transforms. Note: These transforms are NOT inverted! If your skinning data comes with an accumulated, inverted bindPose, you need to invert the transformations.
 @param float[]    size The size of each cube 
 @return int[]     index The index of the cubes
 @return float3[]  position The position of the cubes
 @return float3[]  normal The normal of the cubes
 @return int4[]    boneIndices The bone indices of the cubes
 @return float4[]  boneWeights The bone weights of the cubes
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.