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

Primary interface to reading bound skeleton data. More...

#include <skeletonQuery.h>

Public Member Functions

bool IsValid () const
 Return true if this query is valid.
 
 operator bool () const
 Boolean conversion operator. Equivalent to IsValid().
 
USDSKEL_API bool HasBindPose () const
 Returns true if the size of the array returned by skeleton::GetBindTransformsAttr() matches the number of joints in the skeleton.
 
USDSKEL_API bool HasRestPose () const
 Returns true if the size of the array returned by skeleton::GetRestTransformsAttr() matches the number of joints in the skeleton.
 
USDSKEL_API UsdPrim GetPrim () const
 Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any.
 
USDSKEL_API const UsdSkelSkeletonGetSkeleton () const
 Returns the bound skeleton instance, if any.
 
USDSKEL_API const UsdSkelAnimQueryGetAnimQuery () const
 Returns the animation query that provides animation for the bound skeleton instance, if any.
 
USDSKEL_API const UsdSkelTopologyGetTopology () const
 Returns the topology of the bound skeleton instance, if any.
 
USDSKEL_API const UsdSkelAnimMapper & GetMapper () const
 Returns a mapper for remapping from the bound animation, if any, to the Skeleton.
 
USDSKEL_API VtTokenArray GetJointOrder () const
 Returns an array of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointLocalTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
 Compute joint transforms in joint-local space, at time.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointSkelTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
 Compute joint transforms in skeleton space, at time.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointRestRelativeTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time) const
 Compute joint transforms which, when concatenated against the rest pose, produce joint transforms in joint-local space.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointWorldTransforms (VtArray< Matrix4 > *xforms, UsdGeomXformCache *xfCache, bool atRest=false) const
 Compute joint transforms in world space, at whatever time is configured on xfCache.
 
template<typename Matrix4 >
USDSKEL_API bool ComputeSkinningTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time) const
 Compute transforms representing the change in transformation of a joint from its rest pose, in skeleton space.
 
template<typename Matrix4 >
USDSKEL_API bool GetJointWorldBindTransforms (VtArray< Matrix4 > *xforms) const
 Returns the world space joint transforms at bind time.
 
USDSKEL_API std::string GetDescription () const
 

Friends

class UsdSkel_CacheImpl
 
bool operator== (const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
 Equality comparison.
 
bool operator!= (const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
 Inequality comparison.
 
USDSKEL_API friend size_t hash_value (const UsdSkelSkeletonQuery &query)
 

Detailed Description

Primary interface to reading bound skeleton data.

This is used to query properties such as resolved transforms and animation bindings, as bound through the UsdSkelBindingAPI.

A UsdSkelSkeletonQuery can not be constructed directly, and instead must be constructed through a UsdSkelCache instance. This is done as follows:

// Global cache, intended to persist.
UsdSkelCache skelCache;
// Populate the cache for a skel root.
skelCache.Populate(UsdSkelRoot(skelRootPrim));
if (UsdSkelSkeletonQuery skelQuery = skelCache.GetSkelQuery(skelPrim)) {
...
}
Thread-safe cache for accessing query objects for evaluating skeletal data.
Definition: cache.h:41
USDSKEL_API UsdSkelSkeletonQuery GetSkelQuery(const UsdSkelSkeleton &skel) const
Get a skel query for computing properties of skel.
USDSKEL_API bool Populate(const UsdSkelRoot &root, Usd_PrimFlagsPredicate predicate) const
Populate the cache for the skeletal data beneath prim root, as traversed using predicate.
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined.
Definition: root.h:47
Primary interface to reading bound skeleton data.
Definition: skeletonQuery.h:54

Definition at line 53 of file skeletonQuery.h.

Constructor & Destructor Documentation

◆ UsdSkelSkeletonQuery()

Definition at line 56 of file skeletonQuery.h.

Member Function Documentation

◆ ComputeJointLocalTransforms()

USDSKEL_API bool ComputeJointLocalTransforms ( VtArray< Matrix4 > *  xforms,
UsdTimeCode  time,
bool  atRest = false 
) const

Compute joint transforms in joint-local space, at time.

This returns transforms in joint order of the skeleton. If atRest is false and an animation source is bound, local transforms defined by the animation are mapped into the skeleton's joint order. Any transforms not defined by the animation source use the transforms from the rest pose as a fallback value. If valid transforms cannot be computed for the animation source, the xforms are instead set to the rest transforms.

◆ ComputeJointRestRelativeTransforms()

USDSKEL_API bool ComputeJointRestRelativeTransforms ( VtArray< Matrix4 > *  xforms,
UsdTimeCode  time 
) const

Compute joint transforms which, when concatenated against the rest pose, produce joint transforms in joint-local space.

More specifically, this computes restRelativeTransform in:

restRelativeTransform * restTransform = jointLocalTransform

◆ ComputeJointSkelTransforms()

USDSKEL_API bool ComputeJointSkelTransforms ( VtArray< Matrix4 > *  xforms,
UsdTimeCode  time,
bool  atRest = false 
) const

Compute joint transforms in skeleton space, at time.

This concatenates joint transforms as computed from ComputeJointLocalTransforms(). If atRest is true, any bound animation source is ignored, and transforms are computed from the rest pose. The skeleton-space transforms of the rest pose are cached internally.

◆ ComputeJointWorldTransforms()

USDSKEL_API bool ComputeJointWorldTransforms ( VtArray< Matrix4 > *  xforms,
UsdGeomXformCache xfCache,
bool  atRest = false 
) const

Compute joint transforms in world space, at whatever time is configured on xfCache.

This is equivalent to computing skel-space joint transforms with CmoputeJointSkelTransforms(), and then concatenating all transforms by the local-to-world transform of the Skeleton prim. If atRest is true, any bound animation source is ignored, and transforms are computed from the rest pose.

◆ ComputeSkinningTransforms()

USDSKEL_API bool ComputeSkinningTransforms ( VtArray< Matrix4 > *  xforms,
UsdTimeCode  time 
) const

Compute transforms representing the change in transformation of a joint from its rest pose, in skeleton space.

I.e.,

inverse(bindTransform)*jointTransform

These are the transforms usually required for skinning.

◆ GetAnimQuery()

USDSKEL_API const UsdSkelAnimQuery & GetAnimQuery ( ) const

Returns the animation query that provides animation for the bound skeleton instance, if any.

◆ GetJointOrder()

USDSKEL_API VtTokenArray GetJointOrder ( ) const

Returns an array of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton.

See also
UsdSkelSkeleton::GetJointOrder

◆ GetJointWorldBindTransforms()

USDSKEL_API bool GetJointWorldBindTransforms ( VtArray< Matrix4 > *  xforms) const

Returns the world space joint transforms at bind time.

◆ GetMapper()

USDSKEL_API const UsdSkelAnimMapper & GetMapper ( ) const

Returns a mapper for remapping from the bound animation, if any, to the Skeleton.

◆ GetPrim()

USDSKEL_API UsdPrim GetPrim ( ) const

Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any.

◆ GetSkeleton()

USDSKEL_API const UsdSkelSkeleton & GetSkeleton ( ) const

Returns the bound skeleton instance, if any.

◆ GetTopology()

USDSKEL_API const UsdSkelTopology & GetTopology ( ) const

Returns the topology of the bound skeleton instance, if any.

◆ HasBindPose()

USDSKEL_API bool HasBindPose ( ) const

Returns true if the size of the array returned by skeleton::GetBindTransformsAttr() matches the number of joints in the skeleton.

◆ HasRestPose()

USDSKEL_API bool HasRestPose ( ) const

Returns true if the size of the array returned by skeleton::GetRestTransformsAttr() matches the number of joints in the skeleton.

◆ IsValid()

bool IsValid ( ) const
inline

Return true if this query is valid.

Definition at line 59 of file skeletonQuery.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Boolean conversion operator. Equivalent to IsValid().

Definition at line 62 of file skeletonQuery.h.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const UsdSkelSkeletonQuery lhs,
const UsdSkelSkeletonQuery rhs 
)
friend

Inequality comparison.

Return false if lhs and rhs represent the same UsdSkelSkeletonQuery, true otherwise.

Definition at line 74 of file skeletonQuery.h.

◆ operator==

bool operator== ( const UsdSkelSkeletonQuery lhs,
const UsdSkelSkeletonQuery rhs 
)
friend

Equality comparison.

Return true if lhs and rhs represent the same UsdSkelSkeletonQuery, false otherwise.

Definition at line 66 of file skeletonQuery.h.

◆ UsdSkel_CacheImpl

friend class UsdSkel_CacheImpl
friend

Definition at line 221 of file skeletonQuery.h.


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