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< UT_UniquePtr
< GA_Attribute > > 
AttribPtrArray
 
typedef GU_DualQuatXformT< float > DualQuatXformF
 

Public Member Functions

 GU_LinearSkinDeformer ()
 
void reset ()
 Reset all state. More...
 
bool init (GU_Detail &dst, const GA_Range &pt_range, const GU_LinearSkinDeformerSource &src, Method method=DEFORM_LINEAR, bool create_missing_attribs=false, const char *blend_attrib=nullptr)
 
int numRegions () const
 
const char * regionName (int i) const
 
void clearNumTransformsSet ()
 
void setRegionTransform (int region_idx, const UT_Matrix4F &xform)
 
void setFullRegionTransform (int region_idx, const UT_Matrix4F &xform)
 
void appendDeformTasks (UT_TaskList &tasks)
 
void appendInverseDeformTasks (UT_TaskList &tasks)
 
void deform ()
 
void inverse_deform ()
 

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 192 of file GU_LinearSkinDeformer.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
DEFORM_LINEAR 
DEFORM_DUALQUAT 
DEFORM_DUALQUAT_BLEND 

Definition at line 200 of file GU_LinearSkinDeformer.h.

Constructor & Destructor Documentation

GU_LinearSkinDeformer::GU_LinearSkinDeformer ( )

Member Function Documentation

void GU_LinearSkinDeformer::appendDeformTasks ( UT_TaskList tasks)

Append UT_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 appendDeformTasks()
  6. When done with the task list, spawn them: tasks.spawnRootAndWait();
void GU_LinearSkinDeformer::appendInverseDeformTasks ( UT_TaskList tasks)
void GU_LinearSkinDeformer::clearNumTransformsSet ( )
inline

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

Definition at line 226 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_LinearSkinDeformerSource src,
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::inverse_deform ( )
int GU_LinearSkinDeformer::numRegions ( ) const
inline

Definition at line 218 of file GU_LinearSkinDeformer.h.

const char* GU_LinearSkinDeformer::regionName ( int  i) const
inline

Definition at line 221 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.

Member Data Documentation

const char* GU_LinearSkinDeformer::SKIN_BLEND_DUAL_QUATERNION_AND_LINEAR
static

Definition at line 280 of file GU_LinearSkinDeformer.h.

const char* GU_LinearSkinDeformer::SKIN_DUAL_QUATERNION
static

Definition at line 279 of file GU_LinearSkinDeformer.h.

const char* GU_LinearSkinDeformer::SKIN_LINEAR
static

Definition at line 278 of file GU_LinearSkinDeformer.h.


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