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

#include <skeletonQuery.h>

Public Member Functions

 UsdSkelSkeletonQuery ()
 
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
 
USDSKEL_API bool HasRestPose () const
 
USDSKEL_API UsdPrim GetPrim () const
 
USDSKEL_API const UsdSkelSkeletonGetSkeleton () const
 Returns the bound skeleton instance, if any. More...
 
USDSKEL_API const
UsdSkelAnimQuery
GetAnimQuery () const
 
USDSKEL_API const UsdSkelTopologyGetTopology () const
 Returns the topology of the bound skeleton instance, if any. More...
 
USDSKEL_API const
UsdSkelAnimMapper
GetMapper () const
 
USDSKEL_API VtTokenArray GetJointOrder () const
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointLocalTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointSkelTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time, bool atRest=false) const
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointRestRelativeTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time) const
 
template<typename Matrix4 >
USDSKEL_API bool ComputeJointWorldTransforms (VtArray< Matrix4 > *xforms, UsdGeomXformCache *xfCache, bool atRest=false) const
 
template<typename Matrix4 >
USDSKEL_API bool ComputeSkinningTransforms (VtArray< Matrix4 > *xforms, UsdTimeCode time) const
 
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)
 
bool operator!= (const UsdSkelSkeletonQuery &lhs, const UsdSkelSkeletonQuery &rhs)
 
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.

Constructor & Destructor Documentation

UsdSkelSkeletonQuery::UsdSkelSkeletonQuery ( )
inline

Definition at line 73 of file skeletonQuery.h.

Member Function Documentation

template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::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.

template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::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
template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::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.

template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::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.

template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::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& UsdSkelSkeletonQuery::GetAnimQuery ( ) const

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

USDSKEL_API std::string UsdSkelSkeletonQuery::GetDescription ( ) const
USDSKEL_API VtTokenArray UsdSkelSkeletonQuery::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
template<typename Matrix4 >
USDSKEL_API bool UsdSkelSkeletonQuery::GetJointWorldBindTransforms ( VtArray< Matrix4 > *  xforms) const

Returns the world space joint transforms at bind time.

USDSKEL_API const UsdSkelAnimMapper& UsdSkelSkeletonQuery::GetMapper ( ) const

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

USDSKEL_API UsdPrim UsdSkelSkeletonQuery::GetPrim ( ) const

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

USDSKEL_API const UsdSkelSkeleton& UsdSkelSkeletonQuery::GetSkeleton ( ) const

Returns the bound skeleton instance, if any.

USDSKEL_API const UsdSkelTopology& UsdSkelSkeletonQuery::GetTopology ( ) const

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

USDSKEL_API bool UsdSkelSkeletonQuery::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 UsdSkelSkeletonQuery::HasRestPose ( ) const

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

bool UsdSkelSkeletonQuery::IsValid ( ) const
inline

Return true if this query is valid.

Definition at line 76 of file skeletonQuery.h.

UsdSkelSkeletonQuery::operator bool ( ) const
inlineexplicit

Boolean conversion operator. Equivalent to IsValid().

Definition at line 79 of file skeletonQuery.h.

Friends And Related Function Documentation

USDSKEL_API friend size_t hash_value ( const UsdSkelSkeletonQuery query)
friend
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.

friend class UsdSkel_CacheImpl
friend

Definition at line 238 of file skeletonQuery.h.


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