![]() |
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. More...
Public Member Functions | |
UsdSkelBindingAPI (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdSkelBindingAPI on UsdPrim prim . More... | |
UsdSkelBindingAPI (const UsdSchemaBase &schemaObj) | |
Construct a UsdSkelBindingAPI on the prim held by schemaObj . More... | |
virtual USDSKEL_API | ~UsdSkelBindingAPI () |
Destructor. More... | |
USDSKEL_API UsdAttribute | GetGeomBindTransformAttr () const |
Encodes the bind-time world space transforms of the prim. More... | |
USDSKEL_API UsdAttribute | CreateGeomBindTransformAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetGeomBindTransformAttr(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdAttribute | GetJointsAttr () const |
An (optional) array of tokens defining the list of joints to which jointIndices apply. More... | |
USDSKEL_API UsdAttribute | CreateJointsAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetJointsAttr(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdAttribute | GetJointIndicesAttr () const |
Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point of a PointBased gprim. More... | |
USDSKEL_API UsdAttribute | CreateJointIndicesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetJointIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdAttribute | GetJointWeightsAttr () const |
Weights for the joints that affect each point of a PointBased gprim. More... | |
USDSKEL_API UsdAttribute | CreateJointWeightsAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetJointWeightsAttr(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdAttribute | 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. More... | |
USDSKEL_API UsdAttribute | CreateBlendShapesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetBlendShapesAttr(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdRelationship | GetAnimationSourceRel () const |
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined. More... | |
USDSKEL_API UsdRelationship | CreateAnimationSourceRel () const |
See GetAnimationSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdRelationship | 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. More... | |
USDSKEL_API UsdRelationship | CreateSkeletonRel () const |
See GetSkeletonRel(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdRelationship | GetBlendShapeTargetsRel () const |
Ordered list of all target blend shapes. More... | |
USDSKEL_API UsdRelationship | CreateBlendShapeTargetsRel () const |
See GetBlendShapeTargetsRel(), and also Create vs Get Property Methods for when to use Get vs Create. More... | |
USDSKEL_API UsdGeomPrimvar | GetJointIndicesPrimvar () const |
Convenience function to get the jointIndices attribute as a primvar. More... | |
USDSKEL_API UsdGeomPrimvar | CreateJointIndicesPrimvar (bool constant, int elementSize=-1) const |
Convenience function to create the jointIndices primvar, optionally specifying elementSize. More... | |
USDSKEL_API UsdGeomPrimvar | GetJointWeightsPrimvar () const |
Convenience function to get the jointWeights attribute as a primvar. More... | |
USDSKEL_API UsdGeomPrimvar | CreateJointWeightsPrimvar (bool constant, int elementSize=-1) const |
Convenience function to create the jointWeights primvar, optionally specifying elementSize. More... | |
USDSKEL_API bool | SetRigidJointInfluence (int jointIndex, float weight=1) const |
Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint. More... | |
USDSKEL_API bool | GetSkeleton (UsdSkelSkeleton *skel) const |
Convenience method to query the Skeleton bound on this prim. More... | |
USDSKEL_API bool | GetAnimationSource (UsdPrim *prim) const |
Convenience method to query the animation source bound on this prim. More... | |
USDSKEL_API UsdSkelSkeleton | GetInheritedSkeleton () const |
Returns the skeleton bound at this prim, or one of its ancestors. More... | |
USDSKEL_API UsdPrim | GetInheritedAnimationSource () const |
Returns the animation source bound at this prim, or one of its ancestors. More... | |
![]() | |
UsdAPISchemaBase (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdAPISchemaBase on UsdPrim prim . More... | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj) | |
Construct a UsdAPISchemaBase on the prim held by schemaObj . More... | |
virtual USD_API | ~UsdAPISchemaBase ()=0 |
Destructor. More... | |
![]() | |
bool | IsConcrete () const |
Returns whether or not this class corresponds to a concrete instantiable prim type in scene description. More... | |
bool | IsTyped () const |
Returns whether or not this class inherits from UsdTyped. More... | |
bool | IsAPISchema () const |
Returns whether this is an API schema or not. More... | |
bool | IsAppliedAPISchema () const |
Returns whether this is an applied API schema or not. More... | |
bool | IsMultipleApplyAPISchema () const |
Returns whether this is an applied API schema or not. More... | |
UsdSchemaKind | GetSchemaKind () const |
Returns the kind of schema this class is. More... | |
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 UsdPrimDefinition * | GetSchemaClassPrimDefinition () const |
Return the prim definition associated with this schema instance if one exists, otherwise return null. More... | |
Static Public Member Functions | |
static USDSKEL_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More... | |
static USDSKEL_API UsdSkelBindingAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
Return a UsdSkelBindingAPI holding the prim adhering to this schema at path on stage . More... | |
static USDSKEL_API bool | CanApply (const UsdPrim &prim, std::string *whyNot=nullptr) |
Returns true if this single-apply API schema can be applied to the given prim . More... | |
static USDSKEL_API UsdSkelBindingAPI | Apply (const UsdPrim &prim) |
Applies this single-apply API schema to the given prim . More... | |
static USDSKEL_API bool | ValidateJointIndices (TfSpan< const int > indices, size_t numJoints, std::string *reason=nullptr) |
Validate an array of joint indices. More... | |
![]() | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More... | |
![]() | |
static const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::SingleApplyAPI |
Compile time constant representing what kind of schema this class is. More... | |
![]() | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. More... | |
![]() | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. More... | |
Protected Member Functions | |
USDSKEL_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. More... | |
![]() | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName . More... | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName . More... | |
const TfToken & | _GetInstanceName () const |
Returns the instance name of the API schema object belonging to a multiple-apply API schema. More... | |
USD_API bool | _IsCompatible () const override |
Check whether this APISchema object is valid for the currently held prim. More... | |
![]() | |
virtual UsdSchemaKind | _GetSchemaType () const |
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 | |
![]() | |
template<typename APISchemaType > | |
static APISchemaType | _ApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName) |
Helper method to apply a single-apply API schema with the given schema name apiSchemaName' and C++ type 'APISchemaType'. More... | |
template<typename APISchemaType > | |
static APISchemaType | _MultipleApplyAPISchema (const UsdPrim &prim, const TfToken &apiSchemaName, const TfToken &instanceName) |
Helper method to apply a multiple-apply API schema with the given schema name apiSchemaName' , C++ type 'APISchemaType' and instance name instanceName . More... | |
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.
|
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.
|
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 |
Destructor.
|
overrideprotectedvirtual |
Returns the kind of schema this class belongs to.
Reimplemented from UsdAPISchemaBase.
|
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.
|
static |
Returns true if this single-apply API schema can be applied to the given prim
.
If this schema can not be a applied to the prim, this returns false and, if provided, populates whyNot
with the reason it can not be applied.
Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.
USDSKEL_API UsdRelationship CreateAnimationSourceRel | ( | ) | const |
See GetAnimationSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute CreateBlendShapesAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetBlendShapesAttr(), and also Create vs Get Property Methods 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 CreateBlendShapeTargetsRel | ( | ) | const |
See GetBlendShapeTargetsRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDSKEL_API UsdAttribute CreateGeomBindTransformAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetGeomBindTransformAttr(), and also Create vs Get Property Methods 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 CreateJointIndicesAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetJointIndicesAttr(), and also Create vs Get Property Methods 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 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.
USDSKEL_API UsdAttribute CreateJointsAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetJointsAttr(), and also Create vs Get Property Methods 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 CreateJointWeightsAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetJointWeightsAttr(), and also Create vs Get Property Methods 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 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.
USDSKEL_API UsdRelationship CreateSkeletonRel | ( | ) | const |
See GetSkeletonRel(), and also Create vs Get Property Methods for when to use Get vs Create.
|
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:
USDSKEL_API bool 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 GetAnimationSourceRel | ( | ) | const |
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.
USDSKEL_API UsdAttribute 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 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 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 GetInheritedAnimationSource | ( | ) | const |
Returns the animation source bound at this prim, or one of its ancestors.
USDSKEL_API UsdSkelSkeleton GetInheritedSkeleton | ( | ) | const |
Returns the skeleton bound at this prim, or one of its ancestors.
USDSKEL_API UsdAttribute 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 GetJointIndicesPrimvar | ( | ) | const |
Convenience function to get the jointIndices attribute as a primvar.
USDSKEL_API UsdAttribute 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 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 GetJointWeightsPrimvar | ( | ) | const |
Convenience function to get the jointWeights attribute as a primvar.
|
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 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 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 SetRigidJointInfluence | ( | int | jointIndex, |
float | weight = 1 |
||
) | const |
Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint.
|
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.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 73 of file bindingAPI.h.