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
UsdSkelSkinningQuery Class Reference

Object used for querying resolved bindings for skinning. More...

#include <skinningQuery.h>

Public Member Functions

USDSKEL_API UsdSkelSkinningQuery (const UsdPrim &prim, const VtTokenArray &skelJointOrder, const VtTokenArray &blendShapeOrder, const UsdAttribute &jointIndices, const UsdAttribute &jointWeights, const UsdAttribute &skinningMethod, const UsdAttribute &geomBindTransform, const UsdAttribute &joints, const UsdAttribute &blendShapes, const UsdRelationship &blendShapeTargets)
 Construct a new skining query for the resolved properties set through the UsdSkelBindingAPI, as inherited on prim.
 
bool IsValid () const
 Returns true if this query is valid.
 
 operator bool () const
 Boolean conversion operator. Equivalent to IsValid().
 
const UsdPrimGetPrim () const
 
USDSKEL_API bool HasBlendShapes () const
 Returns true if there are blend shapes associated with this prim.

 
USDSKEL_API bool HasJointInfluences () const
 Returns true if joint influence data is associated with this prim.
 
int GetNumInfluencesPerComponent () const
 Returns the number of influences encoded for each component.
 
const TfTokenGetInterpolation () const
 
USDSKEL_API bool IsRigidlyDeformed () const
 Returns true if the held prim has the same joint influences across all points, or false otherwise.
 
const UsdAttributeGetSkinningMethodAttr () const
 
const UsdAttributeGetGeomBindTransformAttr () const
 
const UsdGeomPrimvarGetJointIndicesPrimvar () const
 
const UsdGeomPrimvarGetJointWeightsPrimvar () const
 
const UsdAttributeGetBlendShapesAttr () const
 
const UsdRelationshipGetBlendShapeTargetsRel () const
 
const UsdSkelAnimMapperRefPtr & GetJointMapper () const
 Return a mapper for remapping from the joint order of the skeleton to the local joint order of this prim, if any.
 
const UsdSkelAnimMapperRefPtr & GetMapper () const
 
const UsdSkelAnimMapperRefPtr & GetBlendShapeMapper () const
 Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local blend shape order of this prim.
 
USDSKEL_API bool GetJointOrder (VtTokenArray *jointOrder) const
 Get the custom joint order for this skinning site, if any.
 
USDSKEL_API bool GetBlendShapeOrder (VtTokenArray *blendShapes) const
 Get the blend shapes for this skinning site, if any.
 
USDSKEL_API bool GetTimeSamples (std::vector< double > *times) const
 Populate times with the union of time samples for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).
 
USDSKEL_API bool GetTimeSamplesInInterval (const GfInterval &interval, std::vector< double > *times) const
 Populate times with the union of time samples within interval, for all properties that affect skinning, independent of joint
transforms and any other prim-specific properties (such as points).
 
USDSKEL_API bool ComputeJointInfluences (VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
 Convenience method for computing joint influences.
 
USDSKEL_API bool ComputeVaryingJointInfluences (size_t numPoints, VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
 Convenience method for computing joint influence, where constant influences are expanded to hold values per point.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeSkinnedPoints (const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
 Compute skinned points using specified skinning method attr (fallback to linear blend skinning if not specified) Both xforms and points are given in skeleton space, using the joint order of the bound skeleton.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeSkinnedNormals (const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
 Compute skinned normals using specified skinning method attr (fallback to linear blend skinning if not specified) Both xforms and points are given in skeleton space, using the joint order of the bound skeleton.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeSkinnedTransform (const VtArray< Matrix4 > &xforms, Matrix4 *xform, UsdTimeCode time=UsdTimeCode::Default()) const
 Compute a skinning transform using specified skinning method attr (fallback to linear blend skinning if not specified) The xforms are given in skeleton space, using the joint order of the bound skeleton.
 
template<typename Matrix4 >
USDSKEL_API float ComputeExtentsPadding (const VtArray< Matrix4 > &skelRestXforms, const UsdGeomBoundable &boundable) const
 Helper for computing an approximate padding for use in extents computations.
 
USDSKEL_API TfToken GetSkinningMethod () const
 
USDSKEL_API GfMatrix4d GetGeomBindTransform (UsdTimeCode time=UsdTimeCode::Default()) const
 
USDSKEL_API std::string GetDescription () const
 

Detailed Description

Object used for querying resolved bindings for skinning.

Definition at line 34 of file skinningQuery.h.

Constructor & Destructor Documentation

◆ UsdSkelSkinningQuery()

USDSKEL_API UsdSkelSkinningQuery ( const UsdPrim prim,
const VtTokenArray &  skelJointOrder,
const VtTokenArray &  blendShapeOrder,
const UsdAttribute jointIndices,
const UsdAttribute jointWeights,
const UsdAttribute skinningMethod,
const UsdAttribute geomBindTransform,
const UsdAttribute joints,
const UsdAttribute blendShapes,
const UsdRelationship blendShapeTargets 
)

Construct a new skining query for the resolved properties set through the UsdSkelBindingAPI, as inherited on prim.

The resulting query will be marked valid only if the inherited properties provide proper valid joint influences.

Member Function Documentation

◆ ComputeExtentsPadding()

USDSKEL_API float ComputeExtentsPadding ( const VtArray< Matrix4 > &  skelRestXforms,
const UsdGeomBoundable boundable 
) const

Helper for computing an approximate padding for use in extents computations.

The padding is computed as the difference between the pivots of the skelRestXformsskeleton space joint transforms at rest – and the extents of the skinned primitive. This is intended to provide a suitable, constant metric for padding joint extents as computed by UsdSkelComputeJointsExtent.

◆ ComputeJointInfluences()

USDSKEL_API bool ComputeJointInfluences ( VtIntArray *  indices,
VtFloatArray *  weights,
UsdTimeCode  time = UsdTimeCode::Default() 
) const

Convenience method for computing joint influences.

In addition to querying influences, this will also perform validation of the basic form of the weight data – although the array contents is not validated.

◆ ComputeSkinnedNormals()

USDSKEL_API bool ComputeSkinnedNormals ( const VtArray< Matrix4 > &  xforms,
VtVec3fArray *  points,
UsdTimeCode  time = UsdTimeCode::Default() 
) const

Compute skinned normals using specified skinning method attr (fallback to linear blend skinning if not specified) Both xforms and points are given in skeleton space, using the joint order of the bound skeleton.

Joint influences and the (optional) binding transform are computed at time time (which will typically be unvarying).

See also
UsdSkelSkeletonQuery::ComputeSkinningTransforms

◆ ComputeSkinnedPoints()

USDSKEL_API bool ComputeSkinnedPoints ( const VtArray< Matrix4 > &  xforms,
VtVec3fArray *  points,
UsdTimeCode  time = UsdTimeCode::Default() 
) const

Compute skinned points using specified skinning method attr (fallback to linear blend skinning if not specified) Both xforms and points are given in skeleton space, using the joint order of the bound skeleton.

Joint influences and the (optional) binding transform are computed at time time (which will typically be unvarying).

See also
UsdSkelSkeletonQuery::ComputeSkinningTransforms

◆ ComputeSkinnedTransform()

USDSKEL_API bool ComputeSkinnedTransform ( const VtArray< Matrix4 > &  xforms,
Matrix4 *  xform,
UsdTimeCode  time = UsdTimeCode::Default() 
) const

Compute a skinning transform using specified skinning method attr (fallback to linear blend skinning if not specified) The xforms are given in skeleton space, using the joint order of the bound skeleton.

Joint influences and the (optional) binding transform are computed at time time (which will typically be unvarying). If this skinning query holds non-constant joint influences, no transform will be computed, and the function will return false.

See also
UsdSkelSkeletonQuery::ComputeSkinningTransforms

◆ ComputeVaryingJointInfluences()

USDSKEL_API bool ComputeVaryingJointInfluences ( size_t  numPoints,
VtIntArray *  indices,
VtFloatArray *  weights,
UsdTimeCode  time = UsdTimeCode::Default() 
) const

Convenience method for computing joint influence, where constant influences are expanded to hold values per point.

In addition to querying influences, this will also perform validation of the basic form of the weight data – although the array contents is not validated.

◆ GetBlendShapeMapper()

const UsdSkelAnimMapperRefPtr & GetBlendShapeMapper ( ) const
inline

Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local blend shape order of this prim.

Returns a null reference if the underlying prim has no blend shapes. The mapper maps data from the order given by the blendShapes order on the SkelAnimation to the order given by the skel:blendShapes property, as set through the UsdSkelBindingAPI.

Definition at line 132 of file skinningQuery.h.

◆ GetBlendShapeOrder()

USDSKEL_API bool GetBlendShapeOrder ( VtTokenArray *  blendShapes) const

Get the blend shapes for this skinning site, if any.

◆ GetBlendShapesAttr()

const UsdAttribute & GetBlendShapesAttr ( ) const
inline

Definition at line 104 of file skinningQuery.h.

◆ GetBlendShapeTargetsRel()

const UsdRelationship & GetBlendShapeTargetsRel ( ) const
inline

Definition at line 108 of file skinningQuery.h.

◆ GetGeomBindTransformAttr()

const UsdAttribute & GetGeomBindTransformAttr ( ) const
inline

Definition at line 92 of file skinningQuery.h.

◆ GetInterpolation()

const TfToken & GetInterpolation ( ) const
inline

Definition at line 81 of file skinningQuery.h.

◆ GetJointIndicesPrimvar()

const UsdGeomPrimvar & GetJointIndicesPrimvar ( ) const
inline

Definition at line 96 of file skinningQuery.h.

◆ GetJointMapper()

const UsdSkelAnimMapperRefPtr & GetJointMapper ( ) const
inline

Return a mapper for remapping from the joint order of the skeleton to the local joint order of this prim, if any.

Returns a null pointer if the prim has no custom joint orer. The mapper maps data from the order given by the joints order on the Skeleton to the order given by the skel:joints property, as optionally set through the UsdSkelBindingAPI.

Definition at line 118 of file skinningQuery.h.

◆ GetJointOrder()

USDSKEL_API bool GetJointOrder ( VtTokenArray *  jointOrder) const

Get the custom joint order for this skinning site, if any.

◆ GetJointWeightsPrimvar()

const UsdGeomPrimvar & GetJointWeightsPrimvar ( ) const
inline

Definition at line 100 of file skinningQuery.h.

◆ GetMapper()

const UsdSkelAnimMapperRefPtr & GetMapper ( ) const
inline
Deprecated:
Use GetJointMapper.

Definition at line 123 of file skinningQuery.h.

◆ GetNumInfluencesPerComponent()

int GetNumInfluencesPerComponent ( ) const
inline

Returns the number of influences encoded for each component.

If the prim defines rigid joint influences, then this returns the number of influences that map to every point. Otherwise, this provides the number of influences per point.

See also
IsRigidlyDeformed

Definition at line 77 of file skinningQuery.h.

◆ GetPrim()

const UsdPrim & GetPrim ( ) const
inline

Definition at line 62 of file skinningQuery.h.

◆ GetSkinningMethodAttr()

const UsdAttribute & GetSkinningMethodAttr ( ) const
inline

Definition at line 88 of file skinningQuery.h.

◆ GetTimeSamples()

USDSKEL_API bool GetTimeSamples ( std::vector< double > *  times) const

Populate times with the union of time samples for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).

See also
UsdAttribute::GetTimeSamples

◆ GetTimeSamplesInInterval()

USDSKEL_API bool GetTimeSamplesInInterval ( const GfInterval interval,
std::vector< double > *  times 
) const

Populate times with the union of time samples within interval, for all properties that affect skinning, independent of joint
transforms and any other prim-specific properties (such as points).

See also
UsdAttribute::GetTimeSamplesInInterval

◆ HasBlendShapes()

USDSKEL_API bool HasBlendShapes ( ) const

Returns true if there are blend shapes associated with this prim.

◆ HasJointInfluences()

USDSKEL_API bool HasJointInfluences ( ) const

Returns true if joint influence data is associated with this prim.

◆ IsRigidlyDeformed()

USDSKEL_API bool IsRigidlyDeformed ( ) const

Returns true if the held prim has the same joint influences across all points, or false otherwise.

◆ IsValid()

bool IsValid ( ) const
inline

Returns true if this query is valid.

Definition at line 57 of file skinningQuery.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Boolean conversion operator. Equivalent to IsValid().

Definition at line 60 of file skinningQuery.h.


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