HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_LinearSkinDeformer Class Reference

Performs linear blend skinning of geometry. More...

#include <GU_LinearSkinDeformer.h>

+ Inheritance diagram for GU_LinearSkinDeformer:

Public Types

enum  Method { DEFORM_LINEAR, DEFORM_DUALQUAT, DEFORM_DUALQUAT_BLEND }
 
typedef UT_Array
< GA_AttributeUPtr
AttribPtrArray
 
typedef GU_DualQuatXformT< floatDualQuatXformF
 

Public Member Functions

 GU_LinearSkinDeformer ()
 
void reset ()
 Reset all state. More...
 
bool init (GU_Detail &dst, const GA_Range &pt_range, const GU_LinearSkinDeformerSourceWeights &src_weights, const GU_LinearSkinDeformerSourceAttribs &src_attribs, Method method=DEFORM_LINEAR, bool create_missing_attribs=false, const char *blend_attrib=nullptr)
 
int numRegions () const
 
const UT_StringHolderregionName (int i) const
 
void clearNumTransformsSet ()
 
void setRegionTransform (int region_idx, const UT_Matrix4F &xform)
 
void setFullRegionTransform (int region_idx, const UT_Matrix4F &xform)
 
bool setRegionTransformsFromGeo (const GU_Detail &anim_skel)
 
void spawnDeformTasks (UT_TaskGroup &tasks)
 
void spawnInverseDeformTasks (UT_TaskGroup &tasks)
 
void deform ()
 
void inverseDeform ()
 

Static Public Member Functions

static bool getGlobalAttribMethod (const GU_Detail *igdp, Method &type)
 
static bool getGlobalAttribBlendAttrib (const GU_Detail *igdp, UT_StringHolder &blend_attrib)
 

Static Public Attributes

static const char * SKIN_LINEAR
 
static const char * SKIN_DUAL_QUATERNION
 
static const char * SKIN_BLEND_DUAL_QUATERNION_AND_LINEAR
 

Detailed Description

Performs linear blend skinning of geometry.

Definition at line 254 of file GU_LinearSkinDeformer.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
DEFORM_LINEAR 
DEFORM_DUALQUAT 
DEFORM_DUALQUAT_BLEND 

Definition at line 262 of file GU_LinearSkinDeformer.h.

Constructor & Destructor Documentation

GU_LinearSkinDeformer::GU_LinearSkinDeformer ( )

Member Function Documentation

void GU_LinearSkinDeformer::clearNumTransformsSet ( )
inline

For debugging purposes, call this before making your setRegionTransform() calls to avoid asserts about missing transforms.

Definition at line 289 of file GU_LinearSkinDeformer.h.

void GU_LinearSkinDeformer::deform ( )

Do the deform.

The necessary steps in this specific order:

  1. N = GU_LinearSkinDeformerSource::init() for the point geometry you want to deform
  2. GU_LinearSkinDeformerSource::appendAttrib() for each src attribute you want to deform
  3. GU_LinearSkinDeformer::init() to set up where to put the results
  4. Call setRegionTransform() N times for each of the cregions
  5. Call deform()
static bool GU_LinearSkinDeformer::getGlobalAttribBlendAttrib ( const GU_Detail igdp,
UT_StringHolder blend_attrib 
)
static
static bool GU_LinearSkinDeformer::getGlobalAttribMethod ( const GU_Detail igdp,
Method type 
)
static
bool GU_LinearSkinDeformer::init ( GU_Detail dst,
const GA_Range pt_range,
const GU_LinearSkinDeformerSourceWeights src_weights,
const GU_LinearSkinDeformerSourceAttribs src_attribs,
Method  method = DEFORM_LINEAR,
bool  create_missing_attribs = false,
const char *  blend_attrib = nullptr 
)

Setup the destination geometry. Fails if the destination is missing attributes that were appended to deform. A reference to the src is maintained until reset() is called.

void GU_LinearSkinDeformer::inverseDeform ( )

Do the deform.

The necessary steps in this specific order:

  1. N = GU_LinearSkinDeformerSource::init() for the point geometry you want to deform
  2. GU_LinearSkinDeformerSource::appendAttrib() for each src attribute you want to deform
  3. GU_LinearSkinDeformer::init() to set up where to put the results
  4. Call setRegionTransform() N times for each of the cregions
  5. Call deform()
int GU_LinearSkinDeformer::numRegions ( ) const
inline

Definition at line 281 of file GU_LinearSkinDeformer.h.

const UT_StringHolder& GU_LinearSkinDeformer::regionName ( int  i) const
inline

Definition at line 284 of file GU_LinearSkinDeformer.h.

void GU_LinearSkinDeformer::reset ( )

Reset all state.

void GU_LinearSkinDeformer::setFullRegionTransform ( int  region_idx,
const UT_Matrix4F xform 
)

Set deforming transform for region_idx. To apply the capture region's transform use setRegionTransform(). init() must have been called first.

void GU_LinearSkinDeformer::setRegionTransform ( int  region_idx,
const UT_Matrix4F xform 
)

Set deforming transform for region_idx, which matches indices found in the capture weight attribute. init() must have been called first.

bool GU_LinearSkinDeformer::setRegionTransformsFromGeo ( const GU_Detail anim_skel)

Set transforms relative to capture region transforms from P,name,transform attributes. This matches with GU_LinearSkinDeformerSourceWeights::setRegionXformsFromGeo()

void GU_LinearSkinDeformer::spawnDeformTasks ( UT_TaskGroup tasks)

Spawn tasks that will perform the deformation. The tasks will have references to this object, so they must be executed before this object is destroyed.

The necessary steps in this specific order:

  1. N = GU_LinearSkinDeformerSource::init() for the point geometry you want to deform
  2. GU_LinearSkinDeformerSource::appendAttrib() for each src attribute you want to deform
  3. GU_LinearSkinDeformer::init() to set up where to put the results
  4. Call setRegionTransform() N times for each of the cregions
  5. Call spawnDeformTasks()
  6. When done with the task list, spawn them: tasks.spawnRootAndWait();
void GU_LinearSkinDeformer::spawnInverseDeformTasks ( UT_TaskGroup tasks)

Spawn tasks that will perform the deformation. The tasks will have references to this object, so they must be executed before this object is destroyed.

The necessary steps in this specific order:

  1. N = GU_LinearSkinDeformerSource::init() for the point geometry you want to deform
  2. GU_LinearSkinDeformerSource::appendAttrib() for each src attribute you want to deform
  3. GU_LinearSkinDeformer::init() to set up where to put the results
  4. Call setRegionTransform() N times for each of the cregions
  5. Call spawnDeformTasks()
  6. When done with the task list, spawn them: tasks.spawnRootAndWait();

Member Data Documentation

const char* GU_LinearSkinDeformer::SKIN_BLEND_DUAL_QUATERNION_AND_LINEAR
static

Definition at line 353 of file GU_LinearSkinDeformer.h.

const char* GU_LinearSkinDeformer::SKIN_DUAL_QUATERNION
static

Definition at line 352 of file GU_LinearSkinDeformer.h.

const char* GU_LinearSkinDeformer::SKIN_LINEAR
static

Definition at line 351 of file GU_LinearSkinDeformer.h.


The documentation for this class was generated from the following file: