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

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

Public Member Functions

bool IsValid () const
 Return true if this query is valid. More...
 
 operator bool () const
 Boolean conversion operator. Equivalent to IsValid(). More...
 
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. More...
 
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. More...
 
USDSKEL_API UsdPrim GetPrim () const
 Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any. More...
 
USDSKEL_API const UsdSkelSkeletonGetSkeleton () const
 Returns the bound skeleton instance, if any. More...
 
USDSKEL_API const
UsdSkelAnimQuery
GetAnimQuery () const
 Returns the animation query that provides animation for the bound skeleton instance, if any. More...
 
USDSKEL_API const UsdSkelTopologyGetTopology () const
 Returns the topology of the bound skeleton instance, if any. More...
 
USDSKEL_API const
UsdSkelAnimMapper & 
GetMapper () const
 Returns a mapper for remapping from the bound animation, if any, to the Skeleton. More...
 
USDSKEL_API VtTokenArray GetJointOrder () const
 Returns an arrray of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton. More...
 
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. More...
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointSkelTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
 Compute joint transforms in skeleton space, at time. More...
 
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. More...
 
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. More...
 
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. More...
 
template<typename Matrix4 >
USDSKEL_API bool GetJointWorldBindTransforms (VtArray< Matrix4 > *xforms) const
 Returns the world space joint transforms at bind time. More...
 
USDSKEL_API std::string GetDescription () const
 

Friends

class UsdSkel_CacheImpl
 
bool operator== (const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
 Equality comparison. More...
 
bool operator!= (const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
 Inequality comparison. More...
 
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)) {
* ...
* }
*

Definition at line 70 of file skeletonQuery.h.

Member Function Documentation

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.

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
*
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.

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.

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.

USDSKEL_API const UsdSkelAnimQuery& GetAnimQuery ( ) const

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

USDSKEL_API VtTokenArray GetJointOrder ( ) const

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

See Also
UsdSkelSkeleton::GetJointOrder
USDSKEL_API bool GetJointWorldBindTransforms ( VtArray< Matrix4 > *  xforms) const

Returns the world space joint transforms at bind time.

USDSKEL_API const UsdSkelAnimMapper& GetMapper ( ) const

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

USDSKEL_API UsdPrim GetPrim ( ) const

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

USDSKEL_API const UsdSkelSkeleton& GetSkeleton ( ) const

Returns the bound skeleton instance, if any.

USDSKEL_API const UsdSkelTopology& GetTopology ( ) const

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

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.

bool IsValid ( ) const
inline

Return true if this query is valid.

Definition at line 76 of file skeletonQuery.h.

operator bool ( ) const
inlineexplicit

Boolean conversion operator. Equivalent to IsValid().

Definition at line 79 of file skeletonQuery.h.

Friends And Related Function Documentation

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 91 of file skeletonQuery.h.

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 83 of file skeletonQuery.h.


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