This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Joint Influence Utils

Collection of methods for working joint influences, as stored through UsdSkelBindingAPI. More...

+ Collaboration diagram for Joint Influence Utils:

Functions

USDSKEL_API bool UsdSkelNormalizeWeights (TfSpan< float > weights, int numInfluencesPerComponent, float eps=std::numeric_limits< float >::epsilon())
 Helper method to normalize weight values across each consecutive run of numInfluencesPerComponent elements.
 
USDSKEL_API bool UsdSkelNormalizeWeights (VtFloatArray *weights, int numInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSortInfluences (TfSpan< int > indices, TfSpan< float > weights, int numInfluencesPerComponent)
 Sort joint influences such that highest weight values come first.
 
USDSKEL_API bool UsdSkelSortInfluences (VtIntArray *indices, VtFloatArray *weights, int numInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelExpandConstantInfluencesToVarying (VtIntArray *indices, size_t size)
 Convert an array of constant influences (joint weights or indices) to an array of varying influences.
 
USDSKEL_API bool UsdSkelExpandConstantInfluencesToVarying (VtFloatArray *weights, size_t size)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelResizeInfluences (VtIntArray *indices, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
 Resize the number of influences per component in a weight or indices array, which initially has srcNumInfluencesPerComponent influences to have no more than newNumInfluencesPerComponent influences per component.
 
USDSKEL_API bool UsdSkelResizeInfluences (VtFloatArray *weights, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelInterleaveInfluences (const TfSpan< const int > &indices, const TfSpan< const float > &weights, TfSpan< GfVec2f > interleavedInfluences)
 Combine arrays of joint indices and weights into interleaved (index,weight) vectors.
 

Detailed Description

Collection of methods for working joint influences, as stored through UsdSkelBindingAPI.

`

Function Documentation

◆ UsdSkelExpandConstantInfluencesToVarying() [1/2]

USDSKEL_API bool UsdSkelExpandConstantInfluencesToVarying ( VtFloatArray *  weights,
size_t  size 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ UsdSkelExpandConstantInfluencesToVarying() [2/2]

USDSKEL_API bool UsdSkelExpandConstantInfluencesToVarying ( VtIntArray *  indices,
size_t  size 
)

Convert an array of constant influences (joint weights or indices) to an array of varying influences.

The size should match the size of required for 'vertex' interpolation on the type geometry primitive. Typically, this is the number of points. This is a convenience function for clients that don't understand constant (rigid) weighting.

◆ UsdSkelInterleaveInfluences()

USDSKEL_API bool UsdSkelInterleaveInfluences ( const TfSpan< const int > &  indices,
const TfSpan< const float > &  weights,
TfSpan< GfVec2f interleavedInfluences 
)

Combine arrays of joint indices and weights into interleaved (index,weight) vectors.

◆ UsdSkelNormalizeWeights() [1/2]

USDSKEL_API bool UsdSkelNormalizeWeights ( TfSpan< float >  weights,
int  numInfluencesPerComponent,
float  eps = std::numeric_limits< float >::epsilon() 
)

Helper method to normalize weight values across each consecutive run of numInfluencesPerComponent elements.

If the total weight for a run of elements is smaller than eps, the elements' weights are set to zero.

◆ UsdSkelNormalizeWeights() [2/2]

USDSKEL_API bool UsdSkelNormalizeWeights ( VtFloatArray *  weights,
int  numInfluencesPerComponent 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Deprecated:
Use form that takes a TfSpan.

◆ UsdSkelResizeInfluences() [1/2]

USDSKEL_API bool UsdSkelResizeInfluences ( VtFloatArray *  weights,
int  srcNumInfluencesPerComponent,
int  newNumInfluencesPerComponent 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ UsdSkelResizeInfluences() [2/2]

USDSKEL_API bool UsdSkelResizeInfluences ( VtIntArray *  indices,
int  srcNumInfluencesPerComponent,
int  newNumInfluencesPerComponent 
)

Resize the number of influences per component in a weight or indices array, which initially has srcNumInfluencesPerComponent influences to have no more than newNumInfluencesPerComponent influences per component.

If the size decreases, influences are additionally re-normalized. This is a convenience method for clients that require a fixed number of of influences.

◆ UsdSkelSortInfluences() [1/2]

USDSKEL_API bool UsdSkelSortInfluences ( TfSpan< int >  indices,
TfSpan< float >  weights,
int  numInfluencesPerComponent 
)

Sort joint influences such that highest weight values come first.

◆ UsdSkelSortInfluences() [2/2]

USDSKEL_API bool UsdSkelSortInfluences ( VtIntArray *  indices,
VtFloatArray *  weights,
int  numInfluencesPerComponent 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Deprecated:
Use form that takes TfSpan arguments.