usdrt::UsdSkelBindingAPI
Defined in usdrt/scenegraph/usd/usdSkel/bindingAPI.h
-
class UsdSkelBindingAPI : public usdrt::UsdAPISchemaBase
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.
Public Functions
-
inline explicit UsdSkelBindingAPI(const UsdPrim &prim = UsdPrim())
Construct a UsdSkelBindingAPI on UsdPrim
prim
. Equivalent to UsdSkelBindingAPI::Get(prim.GetStage(), prim.GetPath()) for a validprim
, but will not immediately throw an error for an invalidprim
.
-
inline explicit UsdSkelBindingAPI(const UsdSchemaBase &schemaObj)
Construct a UsdSkelBindingAPI on the prim held by
schemaObj
. Should be preferred over UsdSkelBindingAPI(schemaObj.GetPrim()), as it preserves SchemaBase state.
-
inline virtual ~UsdSkelBindingAPI()
Destructor.
-
inline 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
-
inline UsdAttribute CreateGeomBindTransformAttr() 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline 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
-
inline UsdAttribute CreateJointsAttr() 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline 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
-
inline UsdAttribute CreateJointIndicesAttr() 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline 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
-
inline UsdAttribute CreateJointWeightsAttr() 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetSkinningMethodAttr() const
Different calculation method for skinning. LBS, DQ, and blendWeight.
Declaration
uniform token skel:skinningMethod = "ClassicLinear"
C++ Type
Usd Type
SdfValueTypeNames->Token
Variability
SdfVariabilityUniform
Allowed Values
ClassicLinear, DualQuaternion, WeightedBlend
-
inline UsdAttribute CreateSkinningMethodAttr() const
See GetSkinningMethodAttr(), 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdAttribute GetSkinningBlendWeightsAttr() const
Weights for weighted blend skinning method. The primvar can have either constant or vertex interpolation. Constant interpolation means every vertex share the same single blend weight. Vertex interpolation means every vertex has their own blend weight. The element size should match the vertices count in this case.
Declaration
uniform float[] primvars:skel:skinningBlendWeights
C++ Type
VtArray<float>
Usd Type
SdfValueTypeNames->FloatArray
Variability
SdfVariabilityUniform
-
inline UsdAttribute CreateSkinningBlendWeightsAttr() const
See GetSkinningBlendWeightsAttr(), 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline 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
-
inline UsdAttribute CreateBlendShapesAttr() 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) ifwriteSparsely
istrue
- the default forwriteSparsely
isfalse
.
-
inline UsdRelationship GetAnimationSourceRel() const
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.
-
inline UsdRelationship CreateAnimationSourceRel() const
See GetAnimationSourceRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline 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.
-
inline UsdRelationship CreateSkeletonRel() const
See GetSkeletonRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline 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.
-
inline UsdRelationship CreateBlendShapeTargetsRel() const
See GetBlendShapeTargetsRel(), and also Create vs Get Property Methods for when to use Get vs Create.
-
inline explicit operator bool() const
Check if this schema object is compatible with it’s held prim and that the prim is valid.
A typed schema object is compatible if the held prim’s type is or is a subtype of the schema’s type. Based on
prim.IsA()
.An API schema object is compatible if the API is of type SingleApplyAPI or UsdSchemaType::MultipleApplyAPI, and the schema has been applied to the prim. Based on
prim.HasAPI
.This method invokes polymorphic behaviour.
See also
- Returns
True if the help prim is valid, and the schema object is compatible with its held prim.
Public Static Functions
-
static inline UsdSkelBindingAPI Apply(const UsdPrim &prim)
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.See also
See also
See also
See also
- 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.
Public Static Attributes
-
static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI
Compile time constant representing what kind of schema this class is.
See also
Protected Functions
-
inline const TfToken &_GetInstanceName() const
Returns the instance name of the API schema object belonging to a multiple-apply API schema.
The returned instance name will be empty for non-applied and single-apply API schemas.
-
inline virtual bool _IsCompatible() const
Check whether this APISchema object is valid for the currently held prim.
If this is an applied API schema, this returns true if the held prim is valid and already has the API schema applied to it, along with the instanceName (in the case of multiple-apply). The instanceName should not be empty in the case of a multiple-apply API schema.
This check is performed when clients invoke the explicit bool conversion operator, implemented in UsdSchemaBase.
See also
-
inline explicit UsdSkelBindingAPI(const UsdPrim &prim = UsdPrim())