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

#include <blendShapeQuery.h>

Public Member Functions

 UsdSkelBlendShapeQuery ()=default
 
USDSKEL_API UsdSkelBlendShapeQuery (const UsdSkelBindingAPI &binding)
 
bool IsValid () const
 Return true if this query is valid. More...
 
 operator bool () const
 Boolean conversion operator. Equivalent to IsValid(). More...
 
const UsdPrimGetPrim () const
 Returns the prim the blend shapes apply to. More...
 
USDSKEL_API UsdSkelBlendShape GetBlendShape (size_t blendShapeIndex) const
 Returns the blend shape corresponding to blendShapeIndex. More...
 
USDSKEL_API UsdSkelInbetweenShape GetInbetween (size_t subShapeIndex) const
 Returns the inbetween shape corresponding to sub-shape i, if any. More...
 
USDSKEL_API size_t GetBlendShapeIndex (size_t subShapeIndex) const
 Returns the blend shape index corresponding to the i'th sub-shape. More...
 
size_t GetNumBlendShapes () const
 
size_t GetNumSubShapes () const
 
USDSKEL_API std::vector
< VtIntArray > 
ComputeBlendShapePointIndices () const
 
USDSKEL_API std::vector
< VtVec3fArray > 
ComputeSubShapePointOffsets () const
 
USDSKEL_API std::vector
< VtVec3fArray > 
ComputeSubShapeNormalOffsets () const
 
USDSKEL_API bool ComputeSubShapeWeights (const TfSpan< const float > &weights, VtFloatArray *subShapeWeights, VtUIntArray *blendShapeIndices, VtUIntArray *subShapeIndices) const
 
USDSKEL_API bool ComputeFlattenedSubShapeWeights (const TfSpan< const float > &weights, VtFloatArray *subShapeWeights) const
 Compute a flattened array of weights for all sub-shapes. More...
 
USDSKEL_API bool ComputeDeformedPoints (const TfSpan< const float > subShapeWeights, const TfSpan< const unsigned > blendShapeIndices, const TfSpan< const unsigned > subShapeIndices, const std::vector< VtIntArray > &blendShapePointIndices, const std::vector< VtVec3fArray > &subShapePointOffsets, TfSpan< GfVec3f > points) const
 
USDSKEL_API bool ComputeDeformedNormals (const TfSpan< const float > subShapeWeights, const TfSpan< const unsigned > blendShapeIndices, const TfSpan< const unsigned > subShapeIndices, const std::vector< VtIntArray > &blendShapePointIndices, const std::vector< VtVec3fArray > &subShapeNormalOffsets, TfSpan< GfVec3f > noramls) const
 
USDSKEL_API bool ComputePackedShapeTable (VtVec4fArray *offsets, VtVec2iArray *ranges) const
 
USDSKEL_API std::string GetDescription () const
 

Detailed Description

Helper class used to resolve blend shape weights, including inbetweens.

Definition at line 49 of file blendShapeQuery.h.

Constructor & Destructor Documentation

UsdSkelBlendShapeQuery::UsdSkelBlendShapeQuery ( )
default
USDSKEL_API UsdSkelBlendShapeQuery::UsdSkelBlendShapeQuery ( const UsdSkelBindingAPI binding)

Member Function Documentation

USDSKEL_API std::vector<VtIntArray> UsdSkelBlendShapeQuery::ComputeBlendShapePointIndices ( ) const

Compute an array holding the point indices of all shapes. This is indexed by the blendShapeIndices returned by ComputeSubShapes(). Since the pointIndices property of blend shapes is optional, some of the arrays may be empty.

USDSKEL_API bool UsdSkelBlendShapeQuery::ComputeDeformedNormals ( const TfSpan< const float subShapeWeights,
const TfSpan< const unsigned >  blendShapeIndices,
const TfSpan< const unsigned >  subShapeIndices,
const std::vector< VtIntArray > &  blendShapePointIndices,
const std::vector< VtVec3fArray > &  subShapeNormalOffsets,
TfSpan< GfVec3f noramls 
) const

Deform normals using the resolved sub-shapes given by subShapeWeights, blendShapeIndices and subShapeIndices. The blendShapePointIndices and blendShapeNormalOffsets arrays both provide the pre-computed normal offsets and indices of each sub-shape, as computed by ComputeBlendShapePointIndices() and ComputeSubShapeNormalOffsets(). This is equivalent to ComputeDeformedPoints(), except that the resulting points are normalized after deformation.

USDSKEL_API bool UsdSkelBlendShapeQuery::ComputeDeformedPoints ( const TfSpan< const float subShapeWeights,
const TfSpan< const unsigned >  blendShapeIndices,
const TfSpan< const unsigned >  subShapeIndices,
const std::vector< VtIntArray > &  blendShapePointIndices,
const std::vector< VtVec3fArray > &  subShapePointOffsets,
TfSpan< GfVec3f points 
) const

Deform points using the resolved sub-shapes given by subShapeWeights, blendShapeIndices and subShapeIndices. The blendShapePointIndices and blendShapePointOffsets arrays both provide the pre-computed point offsets and indices of each sub-shape, as computed by ComputeBlendShapePointIndices() and ComputeSubShapePointOffsets().

USDSKEL_API bool UsdSkelBlendShapeQuery::ComputeFlattenedSubShapeWeights ( const TfSpan< const float > &  weights,
VtFloatArray *  subShapeWeights 
) const

Compute a flattened array of weights for all sub-shapes.

USDSKEL_API bool UsdSkelBlendShapeQuery::ComputePackedShapeTable ( VtVec4fArray *  offsets,
VtVec2iArray *  ranges 
) const

Compute a packed shape table combining all sub-shapes. This is intended to help encode blend shapes in a GPU-friendly form. The resulting offsets array holds contiguous runs of offsets for every point. The array holds all of the offsets of every blend shape for point 0, followed by the offset of every blend shape for point 1, and so forth. Offsets are stored as a GfVec4f. The first three components of each offset holds the actual offset value, while the last value holds the sub-shape index, as a float. The sub-shape index can be used to lookup a corresponding weight value in the 'subShapeWeights' array returned by ComputeSubShapeWeights.

USDSKEL_API std::vector<VtVec3fArray> UsdSkelBlendShapeQuery::ComputeSubShapeNormalOffsets ( ) const

Compute an array holding the normal offsets of all sub-shapes. This includes offsets of both primary shapes – those stored directly on a BlendShape primitive – as well as those of inbetween shapes. This is indexed by the subShapeIndices returned by ComputeSubShapeWeights(). Normal offsets are optional. An empty array is stored for shapes that do not specify normal offsets.

USDSKEL_API std::vector<VtVec3fArray> UsdSkelBlendShapeQuery::ComputeSubShapePointOffsets ( ) const

Compute an array holding the point offsets of all sub-shapes. This includes offsets of both primary shapes – those stored directly on a BlendShape primitive – as well as those of inbetween shapes. This is indexed by the subShapeIndices returned by ComputeSubShapeWeights().

USDSKEL_API bool UsdSkelBlendShapeQuery::ComputeSubShapeWeights ( const TfSpan< const float > &  weights,
VtFloatArray *  subShapeWeights,
VtUIntArray *  blendShapeIndices,
VtUIntArray *  subShapeIndices 
) const

Compute the resolved weights for all sub-shapes bound to this prim. The weights values are initial weight values, ordered according to the skel:blendShapeTargets relationship of the prim this query is associated with. If there are any inbetween shapes, a new set of weights is computed, providing weighting of the relevant inbetweens.

All computed arrays shared the same size. Elements of the same index identify which sub-shape of which blend shape a given weight value is mapped to.

USDSKEL_API UsdSkelBlendShape UsdSkelBlendShapeQuery::GetBlendShape ( size_t  blendShapeIndex) const

Returns the blend shape corresponding to blendShapeIndex.

USDSKEL_API size_t UsdSkelBlendShapeQuery::GetBlendShapeIndex ( size_t  subShapeIndex) const

Returns the blend shape index corresponding to the i'th sub-shape.

USDSKEL_API std::string UsdSkelBlendShapeQuery::GetDescription ( ) const
USDSKEL_API UsdSkelInbetweenShape UsdSkelBlendShapeQuery::GetInbetween ( size_t  subShapeIndex) const

Returns the inbetween shape corresponding to sub-shape i, if any.

size_t UsdSkelBlendShapeQuery::GetNumBlendShapes ( ) const
inline

Definition at line 75 of file blendShapeQuery.h.

size_t UsdSkelBlendShapeQuery::GetNumSubShapes ( ) const
inline

Definition at line 77 of file blendShapeQuery.h.

const UsdPrim& UsdSkelBlendShapeQuery::GetPrim ( ) const
inline

Returns the prim the blend shapes apply to.

Definition at line 64 of file blendShapeQuery.h.

bool UsdSkelBlendShapeQuery::IsValid ( ) const
inline

Return true if this query is valid.

Definition at line 58 of file blendShapeQuery.h.

UsdSkelBlendShapeQuery::operator bool ( ) const
inlineexplicit

Boolean conversion operator. Equivalent to IsValid().

Definition at line 61 of file blendShapeQuery.h.


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