HDK
|
#include <bindingAPI.h>
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 bool | CanApply (const UsdPrim &prim, std::string *whyNot=nullptr) |
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 TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::SingleApplyAPI |
Static Public Attributes inherited from UsdAPISchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Static Public Attributes inherited from UsdSchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Protected Member Functions | |
USDSKEL_API UsdSchemaKind | _GetSchemaKind () 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 | |
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 | |
Static Protected Member Functions inherited from UsdAPISchemaBase | |
static USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
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.
For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdSkelTokens. So to set an attribute to the value "rightHanded", use UsdSkelTokens->rightHanded as the value.
Definition at line 72 of file bindingAPI.h.
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 84 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 92 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 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.
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.
USDSKEL_API UsdRelationship UsdSkelBindingAPI::CreateSkeletonRel | ( | ) | const |
See GetSkeletonRel(), and also Usd_Create_Or_Get_Property for when to use Get vs Create
USDSKEL_API UsdAttribute UsdSkelBindingAPI::CreateSkinningMethodAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetSkinningMethodAttr(), 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
.
|
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 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.
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.
|
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 UsdAttribute UsdSkelBindingAPI::GetSkinningMethodAttr | ( | ) | const |
The skinningMethod specifies the skinning method for the prim.
Declaration | uniform token primvars:skel:skinningMethod = "classicLinear" |
C++ Type | TfToken |
Usd Type | SdfValueTypeNames->Token |
Variability | SdfVariabilityUniform |
Allowed Values | classicLinear, dualQuaternion |
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 |
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.
|
friend |
Definition at line 170 of file bindingAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 78 of file bindingAPI.h.