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

#include <bindingAPI.h>

+ Inheritance diagram for UsdSkelBindingAPI:

Public Member Functions

 UsdSkelBindingAPI (const UsdPrim &prim=UsdPrim())
 
 UsdSkelBindingAPI (const UsdSchemaBase &schemaObj)
 
virtual USDSKEL_API ~UsdSkelBindingAPI ()
 Destructor. More...
 
USDSKEL_API UsdAttribute GetGeomBindTransformAttr () const
 
USDSKEL_API UsdAttribute CreateGeomBindTransformAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDSKEL_API UsdAttribute GetJointsAttr () const
 
USDSKEL_API UsdAttribute CreateJointsAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDSKEL_API UsdAttribute GetJointIndicesAttr () const
 
USDSKEL_API UsdAttribute CreateJointIndicesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDSKEL_API UsdAttribute GetJointWeightsAttr () const
 
USDSKEL_API UsdAttribute CreateJointWeightsAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDSKEL_API UsdAttribute GetBlendShapesAttr () const
 
USDSKEL_API UsdAttribute CreateBlendShapesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
 
USDSKEL_API UsdRelationship GetAnimationSourceRel () const
 
USDSKEL_API UsdRelationship CreateAnimationSourceRel () const
 
USDSKEL_API UsdRelationship GetSkeletonRel () const
 
USDSKEL_API UsdRelationship CreateSkeletonRel () const
 
USDSKEL_API UsdRelationship GetBlendShapeTargetsRel () const
 
USDSKEL_API UsdRelationship CreateBlendShapeTargetsRel () const
 
USDSKEL_API UsdGeomPrimvar GetJointIndicesPrimvar () const
 
USDSKEL_API UsdGeomPrimvar CreateJointIndicesPrimvar (bool constant, int elementSize=-1) const
 
USDSKEL_API UsdGeomPrimvar GetJointWeightsPrimvar () const
 
USDSKEL_API UsdGeomPrimvar CreateJointWeightsPrimvar (bool constant, int elementSize=-1) const
 
USDSKEL_API bool SetRigidJointInfluence (int jointIndex, float weight=1) const
 
USDSKEL_API bool GetSkeleton (UsdSkelSkeleton *skel) const
 
USDSKEL_API bool GetAnimationSource (UsdPrim *prim) const
 
USDSKEL_API UsdSkelSkeleton GetInheritedSkeleton () const
 Returns the skeleton bound at this prim, or one of its ancestors. More...
 
USDSKEL_API UsdPrim GetInheritedAnimationSource () const
 
- Public Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim=UsdPrim())
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj)
 
virtual USD_API ~UsdAPISchemaBase ()=0
 Destructor. More...
 
- Public Member Functions inherited from UsdSchemaBase
bool IsConcrete () const
 
bool IsTyped () const
 
bool IsAPISchema () const
 Returns whether this is an API schema or not. More...
 
bool IsAppliedAPISchema () const
 
bool IsMultipleApplyAPISchema () const
 
UsdSchemaType GetSchemaType () const
 
USD_API UsdSchemaBase (const UsdPrim &prim=UsdPrim())
 Construct and store prim as the held prim. More...
 
USD_API UsdSchemaBase (const UsdSchemaBase &otherSchema)
 Construct and store for the same prim held by otherSchema. More...
 
virtual USD_API ~UsdSchemaBase ()
 Destructor. More...
 
USD_API operator bool () const
 
UsdPrim GetPrim () const
 Return this schema object's held prim. More...
 
SdfPath GetPath () const
 Shorthand for GetPrim()->GetPath(). More...
 
USD_API const UsdPrimDefinitionGetSchemaClassPrimDefinition () const
 

Static Public Member Functions

static USDSKEL_API const
TfTokenVector
GetSchemaAttributeNames (bool includeInherited=true)
 
static USDSKEL_API
UsdSkelBindingAPI 
Get (const UsdStagePtr &stage, const SdfPath &path)
 
static USDSKEL_API
UsdSkelBindingAPI 
Apply (const UsdPrim &prim)
 
static USDSKEL_API bool ValidateJointIndices (TfSpan< const int > indices, size_t numJoints, std::string *reason=nullptr)
 
- Static Public Member Functions inherited from UsdAPISchemaBase
static USD_API const
TfTokenVector
GetSchemaAttributeNames (bool includeInherited=true)
 
- Static Public Member Functions inherited from UsdSchemaBase
static const TfTokenVectorGetSchemaAttributeNames (bool includeInherited=true)
 

Static Public Attributes

static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI
 
- Static Public Attributes inherited from UsdAPISchemaBase
static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
 
- Static Public Attributes inherited from UsdSchemaBase
static const UsdSchemaType schemaType = UsdSchemaType::AbstractBase
 

Protected Member Functions

USDSKEL_API UsdSchemaType _GetSchemaType () const override
 
- Protected Member Functions inherited from UsdAPISchemaBase
 UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName)
 
 UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName)
 
const TfToken_GetInstanceName () const
 
USD_API bool _IsCompatible () const override
 
- Protected Member Functions inherited from UsdSchemaBase
const TfType_GetType () const
 
USD_API UsdAttribute _CreateAttr (TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const
 

Friends

class UsdSchemaRegistry
 

Additional Inherited Members

- Static Protected Member Functions inherited from UsdAPISchemaBase
template<typename APISchemaType >
static APISchemaType _ApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName)
 
template<typename APISchemaType >
static APISchemaType _MultipleApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName, const TfToken &instanceName)
 

Detailed Description

Provides API for authoring and extracting all the skinning-related data that lives in the "geometry hierarchy" of prims and models that want to be skeletally deformed.

See the extended UsdSkelBindingAPI schema documentation for more about bindings and how they apply in a scene graph.

Definition at line 67 of file bindingAPI.h.

Constructor & Destructor Documentation

UsdSkelBindingAPI::UsdSkelBindingAPI ( const UsdPrim prim = UsdPrim())
inlineexplicit

Construct a UsdSkelBindingAPI on UsdPrim prim . Equivalent to UsdSkelBindingAPI::Get(prim.GetStage(), prim.GetPath()) for a valid prim, but will not immediately throw an error for an invalid prim

Definition at line 79 of file bindingAPI.h.

UsdSkelBindingAPI::UsdSkelBindingAPI ( const UsdSchemaBase schemaObj)
inlineexplicit

Construct a UsdSkelBindingAPI on the prim held by schemaObj . Should be preferred over UsdSkelBindingAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.

Definition at line 87 of file bindingAPI.h.

virtual USDSKEL_API UsdSkelBindingAPI::~UsdSkelBindingAPI ( )
virtual

Destructor.

Member Function Documentation

USDSKEL_API UsdSchemaType UsdSkelBindingAPI::_GetSchemaType ( ) const
overrideprotectedvirtual

Returns the type of schema this class belongs to.

See Also
UsdSchemaType

Reimplemented from UsdAPISchemaBase.

static USDSKEL_API UsdSkelBindingAPI UsdSkelBindingAPI::Apply ( const UsdPrim prim)
static

Applies this single-apply API schema to the given prim. This information is stored by adding "SkelBindingAPI" to the token-valued, listOp metadata apiSchemas on the prim.

Returns
A valid UsdSkelBindingAPI object is returned upon success. An invalid (or empty) UsdSkelBindingAPI object is returned upon failure. See UsdPrim::ApplyAPI() for conditions resulting in failure.
See Also
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
USDSKEL_API UsdRelationship UsdSkelBindingAPI::CreateAnimationSourceRel ( ) const

See GetAnimationSourceRel(), and also Usd_Create_Or_Get_Property for when to use Get vs Create

USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateBlendShapesAttr ( VtValue const defaultValue = VtValue(),
bool  writeSparsely = false 
) const

See GetBlendShapesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. If specified, author defaultValue as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

USDSKEL_API UsdRelationship UsdSkelBindingAPI::CreateBlendShapeTargetsRel ( ) const

See GetBlendShapeTargetsRel(), and also Usd_Create_Or_Get_Property for when to use Get vs Create

USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateGeomBindTransformAttr ( VtValue const defaultValue = VtValue(),
bool  writeSparsely = false 
) const

See GetGeomBindTransformAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. If specified, author defaultValue as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateJointIndicesAttr ( VtValue const defaultValue = VtValue(),
bool  writeSparsely = false 
) const

See GetJointIndicesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. If specified, author defaultValue as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

USDSKEL_API UsdGeomPrimvar UsdSkelBindingAPI::CreateJointIndicesPrimvar ( bool  constant,
int  elementSize = -1 
) const

Convenience function to create the jointIndices primvar, optionally specifying elementSize. If constant is true, the resulting primvar is configured with 'constant' interpolation, and describes a rigid deformation. Otherwise, the primvar is configured with 'vertex' interpolation, and describes joint influences that vary per point.

See Also
CreateJointIndicesAttr(), GetJointIndicesPrimvar()
USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateJointsAttr ( VtValue const defaultValue = VtValue(),
bool  writeSparsely = false 
) const

See GetJointsAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. If specified, author defaultValue as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateJointWeightsAttr ( VtValue const defaultValue = VtValue(),
bool  writeSparsely = false 
) const

See GetJointWeightsAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. If specified, author defaultValue as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely is true - the default for writeSparsely is false.

USDSKEL_API UsdGeomPrimvar UsdSkelBindingAPI::CreateJointWeightsPrimvar ( bool  constant,
int  elementSize = -1 
) const

Convenience function to create the jointWeights primvar, optionally specifying elementSize. If constant is true, the resulting primvar is configured with 'constant' interpolation, and describes a rigid deformation. Otherwise, the primvar is configured with 'vertex' interpolation, and describes joint influences that vary per point.

See Also
CreateJointWeightsAttr(), GetJointWeightsPrimvar()
USDSKEL_API UsdRelationship UsdSkelBindingAPI::CreateSkeletonRel ( ) const

See GetSkeletonRel(), and also Usd_Create_Or_Get_Property for when to use Get vs Create

static USDSKEL_API UsdSkelBindingAPI UsdSkelBindingAPI::Get ( const UsdStagePtr &  stage,
const SdfPath path 
)
static

Return a UsdSkelBindingAPI holding the prim adhering to this schema at path on stage. If no prim exists at path on stage, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:

UsdSkelBindingAPI(stage->GetPrimAtPath(path));
USDSKEL_API bool UsdSkelBindingAPI::GetAnimationSource ( UsdPrim prim) const

Convenience method to query the animation source bound on this prim. Returns true if an animation source binding is defined, and sets prim to the target prim. The resulting primitive may still be invalid, if the prim has been explicitly unbound.

This does not resolved inherited animation source bindings.

USDSKEL_API UsdRelationship UsdSkelBindingAPI::GetAnimationSourceRel ( ) const

Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.

USDSKEL_API UsdAttribute UsdSkelBindingAPI::GetBlendShapesAttr ( ) const

An array of tokens defining the order onto which blend shape weights from an animation source map onto the skel:blendShapeTargets rel of a binding site. If authored, the number of elements must be equal to the number of targets in the blendShapeTargets rel. This property is not inherited hierarchically, and is expected to be authored directly on the skinnable primitive to which the blend shapes apply.

Declaration uniform token[] skel:blendShapes
C++ Type VtArray<TfToken>
Usd Type SdfValueTypeNames->TokenArray
Variability SdfVariabilityUniform
USDSKEL_API UsdRelationship UsdSkelBindingAPI::GetBlendShapeTargetsRel ( ) const

Ordered list of all target blend shapes. This property is not inherited hierarchically, and is expected to be authored directly on the skinnable primitive to which the the blend shapes apply.

USDSKEL_API UsdAttribute UsdSkelBindingAPI::GetGeomBindTransformAttr ( ) const

Encodes the bind-time world space transforms of the prim. If the transform is identical for a group of gprims that share a common ancestor, the transform may be authored on the ancestor, to "inherit" down to all the leaf gprims. If this transform is unset, an identity transform is used instead.

Declaration matrix4d primvars:skel:geomBindTransform
C++ Type GfMatrix4d
Usd Type SdfValueTypeNames->Matrix4d
USDSKEL_API UsdPrim UsdSkelBindingAPI::GetInheritedAnimationSource ( ) const

Returns the animation source bound at this prim, or one of its ancestors.

USDSKEL_API UsdSkelSkeleton UsdSkelBindingAPI::GetInheritedSkeleton ( ) const

Returns the skeleton bound at this prim, or one of its ancestors.

USDSKEL_API UsdAttribute UsdSkelBindingAPI::GetJointIndicesAttr ( ) const

Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point of a PointBased gprim. The primvar can have either constant or vertex interpolation. This primvar's elementSize will determine how many joint influences apply to each point. Indices must point be valid. Null influences should be defined by setting values in jointWeights to zero. See UsdGeomPrimvar for more information on interpolation and elementSize.

Declaration int[] primvars:skel:jointIndices
C++ Type VtArray<int>
Usd Type SdfValueTypeNames->IntArray
USDSKEL_API UsdGeomPrimvar UsdSkelBindingAPI::GetJointIndicesPrimvar ( ) const

Convenience function to get the jointIndices attribute as a primvar.

See Also
GetJointIndicesAttr, GetInheritedJointWeightsPrimvar
USDSKEL_API UsdAttribute UsdSkelBindingAPI::GetJointsAttr ( ) const

An (optional) array of tokens defining the list of joints to which jointIndices apply. If not defined, jointIndices applies to the ordered list of joints defined in the bound Skeleton's joints attribute. If undefined on a primitive, the primitive inherits the value of the nearest ancestor prim, if any.

Declaration uniform token[] skel:joints
C++ Type VtArray<TfToken>
Usd Type SdfValueTypeNames->TokenArray
Variability SdfVariabilityUniform
USDSKEL_API UsdAttribute UsdSkelBindingAPI::GetJointWeightsAttr ( ) const

Weights for the joints that affect each point of a PointBased gprim. The primvar can have either constant or vertex interpolation. This primvar's elementSize will determine how many joints influences apply to each point. The length, interpolation, and elementSize of jointWeights must match that of jointIndices. See UsdGeomPrimvar for more information on interpolation and elementSize.

Declaration float[] primvars:skel:jointWeights
C++ Type VtArray<float>
Usd Type SdfValueTypeNames->FloatArray
USDSKEL_API UsdGeomPrimvar UsdSkelBindingAPI::GetJointWeightsPrimvar ( ) const

Convenience function to get the jointWeights attribute as a primvar.

See Also
GetJointWeightsAttr, GetInheritedJointWeightsPrimvar
static USDSKEL_API const TfTokenVector& UsdSkelBindingAPI::GetSchemaAttributeNames ( bool  includeInherited = true)
static

Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. Does not include attributes that may be authored by custom/extended methods of the schemas involved.

USDSKEL_API bool UsdSkelBindingAPI::GetSkeleton ( UsdSkelSkeleton skel) const

Convenience method to query the Skeleton bound on this prim. Returns true if a Skeleton binding is defined, and sets skel to the target skel. The resulting Skeleton may still be invalid, if the Skeleton has been explicitly unbound.

This does not resolved inherited skeleton bindings.

USDSKEL_API UsdRelationship UsdSkelBindingAPI::GetSkeletonRel ( ) const

Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joints of the identified Skeleton.

USDSKEL_API bool UsdSkelBindingAPI::SetRigidJointInfluence ( int  jointIndex,
float  weight = 1 
) const

Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint.

static USDSKEL_API bool UsdSkelBindingAPI::ValidateJointIndices ( TfSpan< const int indices,
size_t  numJoints,
std::string reason = nullptr 
)
static

Validate an array of joint indices. This ensures that all indices are the in the range [0, numJoints). Returns true if the indices are valid, or false otherwise. If invalid and reason is non-null, an error message describing the first validation error will be set.

Friends And Related Function Documentation

friend class UsdSchemaRegistry
friend

Definition at line 144 of file bindingAPI.h.

Member Data Documentation

const UsdSchemaType UsdSkelBindingAPI::schemaType = UsdSchemaType::SingleApplyAPI
static

Compile time constant representing what kind of schema this class is.

See Also
UsdSchemaType

Definition at line 73 of file bindingAPI.h.


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