UsdSkel module
Summary: The UsdSkel module defines schemas and API that form a basis for interchanging skeletally-skinned meshes and joint animations.
Classes:
Class providing efficient queries of primitives that provide skel animation. |
|
Describes a skel animation, where joint animation is stored in a vectorized form. |
|
Helper object that describes the binding of a skeleton to a set of skinnable objects. |
|
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. |
|
Describes a target blend shape, possibly containing inbetween shapes. |
|
Helper class used to resolve blend shape weights, including inbetweens. |
|
Thread-safe cache for accessing query objects for evaluating skeletal data. |
|
Schema wrapper for UsdAttribute for authoring and introspecting attributes that serve as inbetween shapes of a UsdSkelBlendShape. |
|
Deprecated. |
|
Boundable prim type used to identify a scope beneath which skeletally- posed primitives are defined. |
|
Describes a skeleton. |
|
Primary interface to reading bound skeleton data. |
|
Object used for querying resolved bindings for skinning. |
|
Object holding information describing skeleton topology. |
- class pxr.UsdSkel.AnimMapper
Methods:
Returns true if this is an identity map.
IsNull
()Returns true if this is a null mapping.
IsSparse
()Returns true if this is a sparse mapping.
Remap
(source, target, elementSize, defaultValue)Typed remapping of data in an arbitrary, stl-like container.
RemapTransforms
(source, target, elementSize)Convenience method for the common task of remapping transform arrays.
- IsIdentity() bool
Returns true if this is an identity map.
The source and target orders of an identity map are identical.
- IsNull() bool
Returns true if this is a null mapping.
No source elements of a null map are mapped to the target.
- IsSparse() bool
Returns true if this is a sparse mapping.
A sparse mapping means that not all target values will be overridden by source values, when mapped with Remap().
- Remap(source, target, elementSize, defaultValue) bool
Typed remapping of data in an arbitrary, stl-like container.
The
source
array provides a run ofelementSize
for each path in the em sourceOrder. These elements are remapped and copied over thetarget
array. Prior to remapping, thetarget
array is resized to the size of the em targetOrder (as given at mapper construction time) multiplied by theelementSize
. New element created in the array are initialized todefaultValue
, if provided.- Parameters
source (Container) –
target (Container) –
elementSize (int) –
defaultValue (Container.value_type) –
Remap(source, target, elementSize, defaultValue) -> bool
Type-erased remapping of data from
source
intotarget
.The
source
array provides a run ofelementSize
elements for each path in the em sourceOrder. These elements are remapped and copied over thetarget
array. Prior to remapping, thetarget
array is resized to the size of the em targetOrder (as given at mapper construction time) multiplied by theelementSize
. New elements created in the array are initialized todefaultValue
, if provided. Remapping is supported for registered Sdf array value types only.- Parameters
source (VtValue) –
target (VtValue) –
elementSize (int) –
defaultValue (VtValue) –
- RemapTransforms(source, target, elementSize) bool
Convenience method for the common task of remapping transform arrays.
This performs the same operation as Remap(), but sets the matrix identity as the default value.
- Parameters
source (VtArray[Matrix4]) –
target (VtArray[Matrix4]) –
elementSize (int) –
- class pxr.UsdSkel.AnimQuery
Class providing efficient queries of primitives that provide skel animation.
Methods:
Return true if it possible, but not certain, that the blend shape weights computed through this animation query change over time, false otherwise.
ComputeBlendShapeWeights
(weights, time)- param weights
Compute translation,rotation,scale components of the joint transforms in joint-local space.
ComputeJointLocalTransforms
(xforms, time)Compute joint transforms in joint-local space.
Returns an array of tokens describing the ordering of blend shape channels in the animation.
Get the time samples at which values contributing to blend shape weights have been set.
Get the time samples at which values contributing to blend shape weights are set, over
interval
.Returns an array of tokens describing the ordering of joints in the animation.
GetJointTransformTimeSamples
(times)Get the time samples at which values contributing to joint transforms are set.
Get the time samples at which values contributing to joint transforms are set, over
interval
.GetPrim
()Return the primitive this anim query reads from.
Return true if it possible, but not certain, that joint transforms computed through this animation query change over time, false otherwise.
- BlendShapeWeightsMightBeTimeVarying() bool
Return true if it possible, but not certain, that the blend shape weights computed through this animation query change over time, false otherwise.
UsdAttribute::ValueMightBeTimeVayring
- ComputeBlendShapeWeights(weights, time) bool
- Parameters
weights (FloatArray) –
time (TimeCode) –
- ComputeJointLocalTransformComponents(translations, rotations, scales, time) bool
Compute translation,rotation,scale components of the joint transforms in joint-local space.
This is provided to facilitate direct streaming of animation data in a form that can efficiently be processed for animation blending.
- Parameters
translations (Vec3fArray) –
rotations (QuatfArray) –
scales (Vec3hArray) –
time (TimeCode) –
- ComputeJointLocalTransforms(xforms, time) bool
Compute joint transforms in joint-local space.
Transforms are returned in the order specified by the joint ordering of the animation primitive itself.
- Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
- GetBlendShapeOrder() TokenArray
Returns an array of tokens describing the ordering of blend shape channels in the animation.
- GetBlendShapeWeightTimeSamples(attrs) bool
Get the time samples at which values contributing to blend shape weights have been set.
UsdAttribute::GetTimeSamples
- Parameters
attrs (list[float]) –
- GetBlendShapeWeightTimeSamplesInInterval(interval, times) bool
Get the time samples at which values contributing to blend shape weights are set, over
interval
.UsdAttribute::GetTimeSamplesInInterval
- Parameters
interval (Interval) –
times (list[float]) –
- GetJointOrder() TokenArray
Returns an array of tokens describing the ordering of joints in the animation.
UsdSkelSkeleton::GetJointOrder
- GetJointTransformTimeSamples(times) bool
Get the time samples at which values contributing to joint transforms are set.
This only computes the time samples for sampling transforms in joint- local space, and does not include time samples affecting the root transformation.
UsdAttribute::GetTimeSamples
- Parameters
times (list[float]) –
- GetJointTransformTimeSamplesInInterval(interval, times) bool
Get the time samples at which values contributing to joint transforms are set, over
interval
.This only computes the time samples for sampling transforms in joint- local space, and does not include time samples affecting the root transformation.
UsdAttribute::GetTimeSamplesInInterval
- Parameters
interval (Interval) –
times (list[float]) –
- JointTransformsMightBeTimeVarying() bool
Return true if it possible, but not certain, that joint transforms computed through this animation query change over time, false otherwise.
UsdAttribute::ValueMightBeTimeVayring
- class pxr.UsdSkel.Animation
Describes a skel animation, where joint animation is stored in a vectorized form.
See the extended Skel Animation documentation for more information.
Methods:
CreateBlendShapeWeightsAttr
(defaultValue, ...)See GetBlendShapeWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateBlendShapesAttr
(defaultValue, ...)See GetBlendShapesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointsAttr
(defaultValue, writeSparsely)See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRotationsAttr
(defaultValue, writeSparsely)See GetRotationsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateScalesAttr
(defaultValue, writeSparsely)See GetScalesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTranslationsAttr
(defaultValue, ...)See GetTranslationsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
classmethod Define(stage, path) -> Animation
classmethod Get(stage, path) -> Animation
Array of weight values for each blend shape.
Array of tokens identifying which blend shapes this animation's data applies to.
Array of tokens identifying which joints this animation's data applies to.
Joint-local unit quaternion rotations of all affected joints, in 32-bit precision.
Joint-local scales of all affected joints, in 16 bit precision.
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
GetTransforms
(xforms, time)Convenience method for querying resolved transforms at
time
.Joint-local translations of all affected joints.
SetTransforms
(xforms, time)Convenience method for setting an array of transforms.
- CreateBlendShapeWeightsAttr(defaultValue, writeSparsely) Attribute
See GetBlendShapeWeightsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateBlendShapesAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointsAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateRotationsAttr(defaultValue, writeSparsely) Attribute
See GetRotationsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateScalesAttr(defaultValue, writeSparsely) Attribute
See GetScalesAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateTranslationsAttr(defaultValue, writeSparsely) Attribute
See GetTranslationsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- static Define()
classmethod Define(stage, path) -> Animation
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined() ) on this stage.If a prim adhering to this schema at
path
is already defined on this stage, return that prim. Otherwise author an SdfPrimSpec with specifier == SdfSpecifierDef and this schema’s prim type name for the prim atpath
at the current EditTarget. Author SdfPrimSpec s withspecifier
== SdfSpecifierDef and empty typeName at the current EditTarget for any nonexistent, or existing but not Defined ancestors.The given path must be an absolute prim path that does not contain any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for example, in case path cannot map to the current UsdEditTarget ‘s namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does not specify this schema class, in case a stronger typeName opinion overrides the opinion at the current EditTarget.
- static Get()
classmethod Get(stage, path) -> Animation
Return a UsdSkelAnimation holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdSkelAnimation(stage->GetPrimAtPath(path));
- GetBlendShapeWeightsAttr() Attribute
Array of weight values for each blend shape.
Each weight value is associated with the corresponding blend shape identified within the blendShapes token array, and therefore must have the same length as *blendShapes.
Declaration
float[] blendShapeWeights
C++ Type
VtArray<float>
Usd Type
SdfValueTypeNames->FloatArray
- GetBlendShapesAttr() Attribute
Array of tokens identifying which blend shapes this animation’s data applies to.
The tokens for blendShapes correspond to the tokens set in the skel:blendShapes binding property of the UsdSkelBindingAPI.
Declaration
uniform token[] blendShapes
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
- GetJointsAttr() Attribute
Array of tokens identifying which joints this animation’s data applies to.
The tokens for joints correspond to the tokens of Skeleton primitives. The order of the joints as listed here may vary from the order of joints on the Skeleton itself.
Declaration
uniform token[] joints
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
- GetRotationsAttr() Attribute
Joint-local unit quaternion rotations of all affected joints, in 32-bit precision.
Array length should match the size of the joints attribute.
Declaration
quatf[] rotations
C++ Type
VtArray<GfQuatf>
Usd Type
SdfValueTypeNames->QuatfArray
- GetScalesAttr() Attribute
Joint-local scales of all affected joints, in 16 bit precision.
Array length should match the size of the joints attribute.
Declaration
half3[] scales
C++ Type
VtArray<GfVec3h>
Usd Type
SdfValueTypeNames->Half3Array
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- GetTransforms(xforms, time) bool
Convenience method for querying resolved transforms at
time
.Note that it is more efficient to query transforms through UsdSkelAnimQuery or UsdSkelSkeletonQuery.
- Parameters
xforms (Matrix4dArray) –
time (TimeCode) –
- GetTranslationsAttr() Attribute
Joint-local translations of all affected joints.
Array length should match the size of the joints attribute.
Declaration
float3[] translations
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Float3Array
- SetTransforms(xforms, time) bool
Convenience method for setting an array of transforms.
The given transforms must be orthogonal.
- Parameters
xforms (Matrix4dArray) –
time (TimeCode) –
- class pxr.UsdSkel.Binding
Helper object that describes the binding of a skeleton to a set of skinnable objects. The set of skinnable objects is given as UsdSkelSkinningQuery prims, which can be used both to identify the skinned prim as well compute skinning properties of the prim.
Methods:
Returns the bound skeleton.
Returns the set skinning targets.
- GetSkinningTargets() VtArray[SkinningQuery]
Returns the set skinning targets.
- class pxr.UsdSkel.BindingAPI
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.
Methods:
classmethod Apply(prim) -> BindingAPI
classmethod CanApply(prim, whyNot) -> bool
See GetAnimationSourceRel() , and also Create vs Get Property Methods for when to use Get vs Create.
See GetBlendShapeTargetsRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateBlendShapesAttr
(defaultValue, ...)See GetBlendShapesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateGeomBindTransformAttr
(defaultValue, ...)See GetGeomBindTransformAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointIndicesAttr
(defaultValue, ...)See GetJointIndicesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointIndicesPrimvar
(constant, elementSize)Convenience function to create the jointIndices primvar, optionally specifying elementSize.
CreateJointWeightsAttr
(defaultValue, ...)See GetJointWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointWeightsPrimvar
(constant, elementSize)Convenience function to create the jointWeights primvar, optionally specifying elementSize.
CreateJointsAttr
(defaultValue, writeSparsely)See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
See GetSkeletonRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSkinningBlendWeightsAttr
(defaultValue, ...)See GetSkinningBlendWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSkinningMethodAttr
(defaultValue, ...)See GetSkinningMethodAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
classmethod Get(stage, path) -> BindingAPI
GetAnimationSource
(prim)Convenience method to query the animation source bound on this prim.
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.
Ordered list of all target blend shapes.
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.
Encodes the bind-time world space transforms of the prim.
Returns the animation source bound at this prim, or one of its ancestors.
Returns the skeleton bound at this prim, or one of its ancestors.
Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point of a PointBased gprim.
Convenience function to get the jointIndices attribute as a primvar.
Weights for the joints that affect each point of a PointBased gprim.
Convenience function to get the jointWeights attribute as a primvar.
An (optional) array of tokens defining the list of joints to which jointIndices apply.
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
GetSkeleton
(skel)Convenience method to query the Skeleton bound on this prim.
Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joints of the identified Skeleton.
Weights for weighted blend skinning method.
Different calculation method for skinning.
SetRigidJointInfluence
(jointIndex, weight)Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint.
classmethod ValidateJointIndices(indices, numJoints, reason) -> bool
- static Apply()
classmethod Apply(prim) -> BindingAPI
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.
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.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
- Parameters
prim (Prim) –
- static CanApply()
classmethod CanApply(prim, whyNot) -> bool
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.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
- Parameters
prim (Prim) –
whyNot (str) –
- CreateAnimationSourceRel() Relationship
See GetAnimationSourceRel() , and also Create vs Get Property Methods for when to use Get vs Create.
- CreateBlendShapeTargetsRel() Relationship
See GetBlendShapeTargetsRel() , and also Create vs Get Property Methods for when to use Get vs Create.
- CreateBlendShapesAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateGeomBindTransformAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointIndicesAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointIndicesPrimvar(constant, elementSize) Primvar
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.CreateJointIndicesAttr() , GetJointIndicesPrimvar()
- Parameters
constant (bool) –
elementSize (int) –
- CreateJointWeightsAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointWeightsPrimvar(constant, elementSize) Primvar
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.CreateJointWeightsAttr() , GetJointWeightsPrimvar()
- Parameters
constant (bool) –
elementSize (int) –
- CreateJointsAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateSkeletonRel() Relationship
See GetSkeletonRel() , and also Create vs Get Property Methods for when to use Get vs Create.
- CreateSkinningBlendWeightPrimvar()
- CreateSkinningBlendWeightsAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateSkinningMethodAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- static Get()
classmethod Get(stage, path) -> BindingAPI
Return a UsdSkelBindingAPI holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, 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));
- GetAnimationSource(prim) bool
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.
- Parameters
prim (Prim) –
- GetAnimationSourceRel() Relationship
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.
- GetBlendShapeTargetsRel() Relationship
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.
- GetBlendShapesAttr() Attribute
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
- GetGeomBindTransformAttr() Attribute
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
- GetInheritedAnimationSource() Prim
Returns the animation source bound at this prim, or one of its ancestors.
- GetJointIndicesAttr() Attribute
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
- GetJointIndicesPrimvar() Primvar
Convenience function to get the jointIndices attribute as a primvar.
GetJointIndicesAttr, GetInheritedJointWeightsPrimvar
- GetJointWeightsAttr() Attribute
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
- GetJointWeightsPrimvar() Primvar
Convenience function to get the jointWeights attribute as a primvar.
GetJointWeightsAttr, GetInheritedJointWeightsPrimvar
- GetJointsAttr() Attribute
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
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- GetSkeleton(skel) bool
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.
- Parameters
skel (Skeleton) –
- GetSkeletonRel() Relationship
Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joints of the identified Skeleton.
- GetSkinningBlendWeightPrimvar()
- GetSkinningBlendWeightsAttr() Attribute
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.
C++ Type: VtArray<float> Usd Type: SdfValueTypeNames->FloatArray Variability: SdfVariabilityUniform Fallback Value: No Fallback
- GetSkinningMethodAttr() Attribute
Different calculation method for skinning.
LBS, DQ, and blendWeight
C++ Type: TfToken Usd Type: SdfValueTypeNames->Token Variability: SdfVariabilityUniform Fallback Value: ClassicLinear Allowed Values : [ClassicLinear, DualQuaternion, WeightedBlend]
- SetRigidJointInfluence(jointIndex, weight) bool
Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint.
- Parameters
jointIndex (int) –
weight (float) –
- static ValidateJointIndices()
classmethod ValidateJointIndices(indices, numJoints, reason) -> bool
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.- Parameters
indices (TfSpan[int]) –
numJoints (int) –
reason (str) –
- class pxr.UsdSkel.BlendShape
Describes a target blend shape, possibly containing inbetween shapes.
See the extended Blend Shape Schema documentation for information.
Methods:
CreateInbetween
(name)Author scene description to create an attribute on this prim that will be recognized as an Inbetween (i.e.
CreateNormalOffsetsAttr
(defaultValue, ...)See GetNormalOffsetsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateOffsetsAttr
(defaultValue, writeSparsely)See GetOffsetsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreatePointIndicesAttr
(defaultValue, ...)See GetPointIndicesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
classmethod Define(stage, path) -> BlendShape
classmethod Get(stage, path) -> BlendShape
Like GetInbetweens() , but exclude inbetwens that have no authored scene / description.
GetInbetween
(name)Return the Inbetween corresponding to the attribute named
name
, which will be valid if an Inbetween attribute definition already exists.Return valid UsdSkelInbetweenShape objects for all defined Inbetweens on this prim.
Required property.
Required property.
Optional property.
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
HasInbetween
(name)Return true if there is a defined Inbetween named
name
on this prim.classmethod ValidatePointIndices(indices, numPoints, reason) -> bool
- CreateInbetween(name) InbetweenShape
Author scene description to create an attribute on this prim that will be recognized as an Inbetween (i.e.
will present as a valid UsdSkelInbetweenShape).
The name of the created attribute or may or may not be the specified
attrName
, due to the possible need to apply property namespacing. Creation may fail and return an invalid Inbetwen ifattrName
contains a reserved keyword.an invalid UsdSkelInbetweenShape if we failed to create a valid attribute, a valid UsdSkelInbetweenShape otherwise. It is not an error to create over an existing, compatible attribute.
UsdSkelInbetweenShape::IsInbetween()
- Parameters
name (str) –
- CreateNormalOffsetsAttr(defaultValue, writeSparsely) Attribute
See GetNormalOffsetsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateOffsetsAttr(defaultValue, writeSparsely) Attribute
See GetOffsetsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreatePointIndicesAttr(defaultValue, writeSparsely) Attribute
See GetPointIndicesAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- static Define()
classmethod Define(stage, path) -> BlendShape
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined() ) on this stage.If a prim adhering to this schema at
path
is already defined on this stage, return that prim. Otherwise author an SdfPrimSpec with specifier == SdfSpecifierDef and this schema’s prim type name for the prim atpath
at the current EditTarget. Author SdfPrimSpec s withspecifier
== SdfSpecifierDef and empty typeName at the current EditTarget for any nonexistent, or existing but not Defined ancestors.The given path must be an absolute prim path that does not contain any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for example, in case path cannot map to the current UsdEditTarget ‘s namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does not specify this schema class, in case a stronger typeName opinion overrides the opinion at the current EditTarget.
- static Get()
classmethod Get(stage, path) -> BlendShape
Return a UsdSkelBlendShape holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdSkelBlendShape(stage->GetPrimAtPath(path));
- GetAuthoredInbetweens() list[InbetweenShape]
Like GetInbetweens() , but exclude inbetwens that have no authored scene / description.
- GetInbetween(name) InbetweenShape
Return the Inbetween corresponding to the attribute named
name
, which will be valid if an Inbetween attribute definition already exists.Name lookup will account for Inbetween namespacing, which means that this method will succeed in some cases where
UsdSkelInbetweenShape (prim->GetAttribute(name))
will not, unlessname
has the proper namespace prefix.HasInbetween()
- Parameters
name (str) –
- GetInbetweens() list[InbetweenShape]
Return valid UsdSkelInbetweenShape objects for all defined Inbetweens on this prim.
- GetNormalOffsetsAttr() Attribute
Required property.
Normal offsets which, when added to the base pose, provides the normals of the target shape.
Declaration
uniform vector3f[] normalOffsets
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Vector3fArray
Variability
SdfVariabilityUniform
- GetOffsetsAttr() Attribute
Required property.
Position offsets which, when added to the base pose, provides the target shape.
Declaration
uniform vector3f[] offsets
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Vector3fArray
Variability
SdfVariabilityUniform
- GetPointIndicesAttr() Attribute
Optional property.
Indices into the original mesh that correspond to the values in offsets and of any inbetween shapes. If authored, the number of elements must be equal to the number of elements in the offsets array.
Declaration
uniform int[] pointIndices
C++ Type
VtArray<int>
Usd Type
SdfValueTypeNames->IntArray
Variability
SdfVariabilityUniform
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- HasInbetween(name) bool
Return true if there is a defined Inbetween named
name
on this prim.Name lookup will account for Inbetween namespacing.
GetInbetween()
- Parameters
name (str) –
- static ValidatePointIndices()
classmethod ValidatePointIndices(indices, numPoints, reason) -> bool
Validates a set of point indices for a given point count.
This ensures that all point indices are in the range [0, numPoints). 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.- Parameters
indices (TfSpan[int]) –
numPoints (int) –
reason (str) –
- class pxr.UsdSkel.BlendShapeQuery
Helper class used to resolve blend shape weights, including inbetweens.
Methods:
Compute an array holding the point indices of all shapes.
ComputeDeformedPoints
(subShapeWeights, ...)Deform
points
using the resolved sub-shapes given bysubShapeWeights
,blendShapeIndices
andsubShapeIndices
.Compute an array holding the point offsets of all sub-shapes.
ComputeSubShapeWeights
(weights, ...)Compute the resolved weights for all sub-shapes bound to this prim.
GetBlendShape
(blendShapeIndex)Returns the blend shape corresponding to
blendShapeIndex
.GetBlendShapeIndex
(subShapeIndex)Returns the blend shape index corresponding to the
i'th
sub-shape.GetInbetween
(subShapeIndex)Returns the inbetween shape corresponding to sub-shape
i
, if any.- ComputeBlendShapePointIndices() list[IntArray]
Compute an array holding the point indices of all shapes.
This is indexed by the blendShapeIndices returned by ComputeSubShapes(). Since the pointIndices property of blend shapes is optional, some of the arrays may be empty.
- ComputeDeformedPoints(subShapeWeights, blendShapeIndices, subShapeIndices, blendShapePointIndices, subShapePointOffsets, points) bool
Deform
points
using the resolved sub-shapes given bysubShapeWeights
,blendShapeIndices
andsubShapeIndices
.The
blendShapePointIndices
andblendShapePointOffsets
arrays both provide the pre-computed point offsets and indices of each sub- shape, as computed by ComputeBlendShapePointIndices() and ComputeSubShapePointOffsets() .- Parameters
subShapeWeights (TfSpan[float]) –
blendShapeIndices (TfSpan[unsigned]) –
subShapeIndices (TfSpan[unsigned]) –
blendShapePointIndices (list[IntArray]) –
subShapePointOffsets (list[Vec3fArray]) –
points (TfSpan[Vec3f]) –
- ComputeSubShapePointOffsets() list[Vec3fArray]
Compute an array holding the point offsets of all sub-shapes.
This includes offsets of both primary shapes those stored directly on a BlendShape primitive as well as those of inbetween shapes. This is indexed by the subShapeIndices returned by ComputeSubShapeWeights() .
- ComputeSubShapeWeights(weights, subShapeWeights, blendShapeIndices, subShapeIndices) bool
Compute the resolved weights for all sub-shapes bound to this prim.
The
weights
values are initial weight values, ordered according to the skel:blendShapeTargets relationship of the prim this query is associated with. If there are any inbetween shapes, a new set of weights is computed, providing weighting of the relevant inbetweens.All computed arrays shared the same size. Elements of the same index identify which sub-shape of which blend shape a given weight value is mapped to.
- Parameters
weights (TfSpan[float]) –
subShapeWeights (FloatArray) –
blendShapeIndices (UIntArray) –
subShapeIndices (UIntArray) –
- GetBlendShape(blendShapeIndex) BlendShape
Returns the blend shape corresponding to
blendShapeIndex
.- Parameters
blendShapeIndex (int) –
- GetBlendShapeIndex(subShapeIndex) int
Returns the blend shape index corresponding to the
i'th
sub-shape.- Parameters
subShapeIndex (int) –
- GetInbetween(subShapeIndex) InbetweenShape
Returns the inbetween shape corresponding to sub-shape
i
, if any.- Parameters
subShapeIndex (int) –
- GetNumBlendShapes() int
- GetNumSubShapes() int
- class pxr.UsdSkel.Cache
Thread-safe cache for accessing query objects for evaluating skeletal data.
This provides caching of major structural components, such as skeletal topology. In a streaming context, this cache is intended to persist.
Methods:
Clear
()ComputeSkelBinding
(skelRoot, skel, binding, ...)Compute the bindings corresponding to a single skeleton, bound beneath
skelRoot
, as discovered through a traversal usingpredicate
.ComputeSkelBindings
(skelRoot, bindings, ...)Compute the set of skeleton bindings beneath
skelRoot
, as discovered through a traversal usingpredicate
.GetAnimQuery
(anim)Get an anim query corresponding to
anim
.GetSkelQuery
(skel)Get a skel query for computing properties of
skel
.GetSkinningQuery
(prim)Get a skinning query at
prim
.Populate
(root, predicate)Populate the cache for the skeletal data beneath prim
root
, as traversed usingpredicate
.- ComputeSkelBinding(skelRoot, skel, binding, predicate) bool
Compute the bindings corresponding to a single skeleton, bound beneath
skelRoot
, as discovered through a traversal usingpredicate
.Skinnable prims are only discoverable by this method if Populate() has already been called for
skelRoot
, with an equivalent predicate.
- ComputeSkelBindings(skelRoot, bindings, predicate) bool
Compute the set of skeleton bindings beneath
skelRoot
, as discovered through a traversal usingpredicate
.Skinnable prims are only discoverable by this method if Populate() has already been called for
skelRoot
, with an equivalent predicate.
- GetAnimQuery(anim) AnimQuery
Get an anim query corresponding to
anim
.This does not require Populate() to be called on the cache.
- Parameters
anim (Animation) –
GetAnimQuery(prim) -> AnimQuery
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Deprecated
- Parameters
prim (Prim) –
- GetSkelQuery(skel) SkeletonQuery
Get a skel query for computing properties of
skel
.This does not require Populate() to be called on the cache.
- Parameters
skel (Skeleton) –
- GetSkinningQuery(prim) SkinningQuery
Get a skinning query at
prim
.Skinning queries are defined at any skinnable prims (I.e., boundable prims with fully defined joint influences).
The caller must first Populate() the cache with the skel root containing
prim
, with a predicate that will visitprim
, in order for a skinning query to be discoverable.- Parameters
prim (Prim) –
- Populate(root, predicate) bool
Populate the cache for the skeletal data beneath prim
root
, as traversed usingpredicate
.Population resolves inherited skel bindings set using the UsdSkelBindingAPI, making resolved bindings available through GetSkinningQuery() , ComputeSkelBdining() and ComputeSkelBindings() .
- Parameters
root (Root) –
predicate (_PrimFlagsPredicate) –
- class pxr.UsdSkel.InbetweenShape
Schema wrapper for UsdAttribute for authoring and introspecting attributes that serve as inbetween shapes of a UsdSkelBlendShape.
Inbetween shapes allow an explicit shape to be specified when the blendshape to which it’s bound is evaluated at a certain weight. For example, rather than performing piecewise linear interpolation between a primary shape and the rest shape at weight 0.5, an inbetween shape could be defined at the weight. For weight values greater than 0.5, a shape would then be resolved by linearly interpolating between the inbetween shape and the primary shape, while for weight values less than or equal to 0.5, the shape is resolved by linearly interpolating between the inbetween shape and the primary shape.
Methods:
CreateNormalOffsetsAttr
(defaultValue)Returns the existing normal offsets attribute if the shape has normal offsets, or creates a new one.
GetAttr
()Explicit UsdAttribute extractor.
GetNormalOffsets
(offsets)Get the normal offsets authored for this shape.
Returns a valid normal offsets attribute if the shape has normal offsets.
GetOffsets
(offsets)Get the point offsets corresponding to this shape.
GetWeight
(weight)Return the location at which the shape is applied.
Has a weight value been explicitly authored on this shape?
Return true if the wrapped UsdAttribute::IsDefined() , and in addition the attribute is identified as an Inbetween.
classmethod IsInbetween(attr) -> bool
SetNormalOffsets
(offsets)Set the normal offsets authored for this shape.
SetOffsets
(offsets)Set the point offsets corresponding to this shape.
SetWeight
(weight)Set the location at which the shape is applied.
- CreateNormalOffsetsAttr(defaultValue) Attribute
Returns the existing normal offsets attribute if the shape has normal offsets, or creates a new one.
- Parameters
defaultValue (VtValue) –
- GetNormalOffsets(offsets) bool
Get the normal offsets authored for this shape.
Normal offsets are optional, and may be left unspecified.
- Parameters
offsets (Vec3fArray) –
- GetNormalOffsetsAttr() Attribute
Returns a valid normal offsets attribute if the shape has normal offsets.
Returns an invalid attribute otherwise.
- GetOffsets(offsets) bool
Get the point offsets corresponding to this shape.
- Parameters
offsets (Vec3fArray) –
- GetWeight(weight) bool
Return the location at which the shape is applied.
- Parameters
weight (float) –
- HasAuthoredWeight() bool
Has a weight value been explicitly authored on this shape?
GetWeight()
- IsDefined() bool
Return true if the wrapped UsdAttribute::IsDefined() , and in addition the attribute is identified as an Inbetween.
- static IsInbetween()
classmethod IsInbetween(attr) -> bool
Test whether a given UsdAttribute represents a valid Inbetween, which implies that creating a UsdSkelInbetweenShape from the attribute will succeed.
Succes implies that
attr.IsDefined()
is true.- Parameters
attr (Attribute) –
- SetNormalOffsets(offsets) bool
Set the normal offsets authored for this shape.
- Parameters
offsets (Vec3fArray) –
- SetOffsets(offsets) bool
Set the point offsets corresponding to this shape.
- Parameters
offsets (Vec3fArray) –
- SetWeight(weight) bool
Set the location at which the shape is applied.
- Parameters
weight (float) –
- class pxr.UsdSkel.PackedJointAnimation
Deprecated. Please use SkelAnimation instead.
Methods:
classmethod Define(stage, path) -> PackedJointAnimation
classmethod Get(stage, path) -> PackedJointAnimation
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
- static Define()
classmethod Define(stage, path) -> PackedJointAnimation
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined() ) on this stage.If a prim adhering to this schema at
path
is already defined on this stage, return that prim. Otherwise author an SdfPrimSpec with specifier == SdfSpecifierDef and this schema’s prim type name for the prim atpath
at the current EditTarget. Author SdfPrimSpec s withspecifier
== SdfSpecifierDef and empty typeName at the current EditTarget for any nonexistent, or existing but not Defined ancestors.The given path must be an absolute prim path that does not contain any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for example, in case path cannot map to the current UsdEditTarget ‘s namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does not specify this schema class, in case a stronger typeName opinion overrides the opinion at the current EditTarget.
- static Get()
classmethod Get(stage, path) -> PackedJointAnimation
Return a UsdSkelPackedJointAnimation holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdSkelPackedJointAnimation(stage->GetPrimAtPath(path));
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- class pxr.UsdSkel.Root
Boundable prim type used to identify a scope beneath which skeletally- posed primitives are defined.
A SkelRoot must be defined at or above a skinned primitive for any skinning behaviors in UsdSkel.
See the extended Skel Root Schema documentation for more information.
Methods:
classmethod Define(stage, path) -> Root
classmethod Find(prim) -> Root
classmethod Get(stage, path) -> Root
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
- static Define()
classmethod Define(stage, path) -> Root
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined() ) on this stage.If a prim adhering to this schema at
path
is already defined on this stage, return that prim. Otherwise author an SdfPrimSpec with specifier == SdfSpecifierDef and this schema’s prim type name for the prim atpath
at the current EditTarget. Author SdfPrimSpec s withspecifier
== SdfSpecifierDef and empty typeName at the current EditTarget for any nonexistent, or existing but not Defined ancestors.The given path must be an absolute prim path that does not contain any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for example, in case path cannot map to the current UsdEditTarget ‘s namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does not specify this schema class, in case a stronger typeName opinion overrides the opinion at the current EditTarget.
- static Find()
classmethod Find(prim) -> Root
Returns the skel root at or above
prim
, or an invalid schema object if no ancestor prim is defined as a skel root.- Parameters
prim (Prim) –
- static Get()
classmethod Get(stage, path) -> Root
Return a UsdSkelRoot holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdSkelRoot(stage->GetPrimAtPath(path));
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- class pxr.UsdSkel.Skeleton
Describes a skeleton.
See the extended Skeleton Schema documentation for more information.
Methods:
CreateBindTransformsAttr
(defaultValue, ...)See GetBindTransformsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointNamesAttr
(defaultValue, writeSparsely)See GetJointNamesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointsAttr
(defaultValue, writeSparsely)See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRestTransformsAttr
(defaultValue, ...)See GetRestTransformsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
classmethod Define(stage, path) -> Skeleton
classmethod Get(stage, path) -> Skeleton
Specifies the bind-pose transforms of each joint in world space, in the ordering imposed by joints.
If authored, provides a unique name per joint.
An array of path tokens identifying the set of joints that make up the skeleton, and their order.
Specifies the rest-pose transforms of each joint in local space, in the ordering imposed by joints.
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
- CreateBindTransformsAttr(defaultValue, writeSparsely) Attribute
See GetBindTransformsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointNamesAttr(defaultValue, writeSparsely) Attribute
See GetJointNamesAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateJointsAttr(defaultValue, writeSparsely) Attribute
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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- CreateRestTransformsAttr(defaultValue, writeSparsely) Attribute
See GetRestTransformsAttr() , 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
.- Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
- static Define()
classmethod Define(stage, path) -> Skeleton
Attempt to ensure a UsdPrim adhering to this schema at
path
is defined (according to UsdPrim::IsDefined() ) on this stage.If a prim adhering to this schema at
path
is already defined on this stage, return that prim. Otherwise author an SdfPrimSpec with specifier == SdfSpecifierDef and this schema’s prim type name for the prim atpath
at the current EditTarget. Author SdfPrimSpec s withspecifier
== SdfSpecifierDef and empty typeName at the current EditTarget for any nonexistent, or existing but not Defined ancestors.The given path must be an absolute prim path that does not contain any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for example, in case path cannot map to the current UsdEditTarget ‘s namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does not specify this schema class, in case a stronger typeName opinion overrides the opinion at the current EditTarget.
- static Get()
classmethod Get(stage, path) -> Skeleton
Return a UsdSkelSkeleton holding the prim adhering to this schema at
path
onstage
.If no prim exists at
path
onstage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. This is shorthand for the following:UsdSkelSkeleton(stage->GetPrimAtPath(path));
- GetBindTransformsAttr() Attribute
Specifies the bind-pose transforms of each joint in world space, in the ordering imposed by joints.
Declaration
uniform matrix4d[] bindTransforms
C++ Type
VtArray<GfMatrix4d>
Usd Type
SdfValueTypeNames->Matrix4dArray
Variability
SdfVariabilityUniform
- GetJointNamesAttr() Attribute
If authored, provides a unique name per joint.
This may be optionally set to provide better names when translating to DCC apps that require unique joint names.
Declaration
uniform token[] jointNames
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
- GetJointsAttr() Attribute
An array of path tokens identifying the set of joints that make up the skeleton, and their order.
Each token in the array must be valid when parsed as an SdfPath. The parent-child relationships of the corresponding paths determine the parent-child relationships of each joint. It is not required that the name at the end of each path be unique, but rather only that the paths themselves be unique.
Declaration
uniform token[] joints
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
- GetRestTransformsAttr() Attribute
Specifies the rest-pose transforms of each joint in local space, in the ordering imposed by joints.
This provides fallback values for joint transforms when a Skeleton either has no bound animation source, or when that animation source only contains animation for a subset of a Skeleton’s joints.
Declaration
uniform matrix4d[] restTransforms
C++ Type
VtArray<GfMatrix4d>
Usd Type
SdfValueTypeNames->Matrix4dArray
Variability
SdfVariabilityUniform
- static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[str]
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.
- Parameters
includeInherited (bool) –
- class pxr.UsdSkel.SkeletonQuery
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)) { \.\.\. }
Methods:
ComputeJointLocalTransforms
(xforms, time, atRest)Compute joint transforms in joint-local space, at
time
.ComputeJointRestRelativeTransforms
(xforms, time)Compute joint transforms which, when concatenated against the rest pose, produce joint transforms in joint-local space.
ComputeJointSkelTransforms
(xforms, time, atRest)Compute joint transforms in skeleton space, at
time
.ComputeJointWorldTransforms
(xforms, xfCache, ...)Compute joint transforms in world space, at whatever time is configured on
xfCache
.ComputeSkinningTransforms
(xforms, time)Compute transforms representing the change in transformation of a joint from its rest pose, in skeleton space.
Returns the animation query that provides animation for the bound skeleton instance, if any.
Returns an array of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton.
GetJointWorldBindTransforms
(xforms)Returns the world space joint transforms at bind time.
Returns a mapper for remapping from the bound animation, if any, to the Skeleton.
GetPrim
()Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any.
Returns the bound skeleton instance, if any.
Returns the topology of the bound skeleton instance, if any.
Returns
true
if the size of the array returned by skeleton::GetBindTransformsAttr() matches the number of joints in the skeleton.Returns
true
if the size of the array returned by skeleton::GetRestTransformsAttr() matches the number of joints in the skeleton.- ComputeJointLocalTransforms(xforms, time, atRest) bool
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, thexforms
are instead set to the rest transforms.- Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
atRest (bool) –
- ComputeJointRestRelativeTransforms(xforms, time) bool
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
- Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
- ComputeJointSkelTransforms(xforms, time, atRest) bool
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.- Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
atRest (bool) –
- ComputeJointWorldTransforms(xforms, xfCache, atRest) bool
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.- Parameters
xforms (VtArray[Matrix4]) –
xfCache (XformCache) –
atRest (bool) –
- ComputeSkinningTransforms(xforms, time) bool
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.
- Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
- GetAnimQuery() AnimQuery
Returns the animation query that provides animation for the bound skeleton instance, if any.
- GetJointOrder() TokenArray
Returns an array of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton.
UsdSkelSkeleton::GetJointOrder
- GetJointWorldBindTransforms(xforms) bool
Returns the world space joint transforms at bind time.
- Parameters
xforms (VtArray[Matrix4]) –
- GetMapper() AnimMapper
Returns a mapper for remapping from the bound animation, if any, to the Skeleton.
- GetPrim() Prim
Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any.
- HasBindPose() bool
Returns
true
if the size of the array returned by skeleton::GetBindTransformsAttr() matches the number of joints in the skeleton.
- HasRestPose() bool
Returns
true
if the size of the array returned by skeleton::GetRestTransformsAttr() matches the number of joints in the skeleton.
- class pxr.UsdSkel.SkinningQuery
Object used for querying resolved bindings for skinning.
Methods:
ComputeExtentsPadding
(skelRestXforms, boundable)Helper for computing an approximate padding for use in extents computations.
ComputeJointInfluences
(indices, weights, time)Convenience method for computing joint influences.
ComputeSkinnedPoints
(xforms, points, time)Compute skinned points using linear blend skinning.
ComputeSkinnedTransform
(xforms, xform, time)Compute a skinning transform using linear blend skinning.
ComputeVaryingJointInfluences
(numPoints, ...)Convenience method for computing joint influence, where constant influences are expanded to hold values per point.
Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local blend shape order of this prim.
GetBlendShapeOrder
(blendShapes)Get the blend shapes for this skinning site, if any.
GetGeomBindTransform
(time)- param time
Return a mapper for remapping from the joint order of the skeleton to the local joint order of this prim, if any.
GetJointOrder
(jointOrder)Get the custom joint order for this skinning site, if any.
Deprecated
Returns the number of influences encoded for each component.
GetPrim
()GetTimeSamples
(times)Populate
times
with the union of time samples for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).GetTimeSamplesInInterval
(interval, times)Populate
times
with the union of time samples withininterval
, for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).Returns true if there are blend shapes associated with this prim.
Returns true if joint influence data is associated with this prim.
Returns true if the held prim has the same joint influences across all points, or false otherwise.
- ComputeExtentsPadding(skelRestXforms, boundable) float
Helper for computing an approximate padding for use in extents computations.
The padding is computed as the difference between the pivots of the
skelRestXforms
skeleton space joint transforms at rest and the extents of the skinned primitive. This is intended to provide a suitable, constant metric for padding joint extents as computed by UsdSkelComputeJointsExtent.- Parameters
skelRestXforms (VtArray[Matrix4]) –
boundable (Boundable) –
- ComputeJointInfluences(indices, weights, time) bool
Convenience method for computing joint influences.
In addition to querying influences, this will also perform validation of the basic form of the weight data although the array contents is not validated.
- Parameters
indices (IntArray) –
weights (FloatArray) –
time (TimeCode) –
- ComputeSkinnedPoints(xforms, points, time) bool
Compute skinned points using linear blend skinning.
Both
xforms
andpoints
are given in skeleton space, using the joint order of the bound skeleton. Joint influences and the (optional) binding transform are computed at timetime
(which will typically be unvarying).UsdSkelSkeletonQuery::ComputeSkinningTransforms
- Parameters
xforms (VtArray[Matrix4]) –
points (Vec3fArray) –
time (TimeCode) –
- ComputeSkinnedTransform(xforms, xform, time) bool
Compute a skinning transform using linear blend skinning.
The
xforms
are given in skeleton space, using the joint order of the bound skeleton. Joint influences and the (optional) binding transform are computed at timetime
(which will typically be unvarying). If this skinning query holds non-constant joint influences, no transform will be computed, and the function will return false.UsdSkelSkeletonQuery::ComputeSkinningTransforms
- Parameters
xforms (VtArray[Matrix4]) –
xform (Matrix4) –
time (TimeCode) –
- ComputeVaryingJointInfluences(numPoints, indices, weights, time) bool
Convenience method for computing joint influence, where constant influences are expanded to hold values per point.
In addition to querying influences, this will also perform validation of the basic form of the weight data although the array contents is not validated.
- Parameters
numPoints (int) –
indices (IntArray) –
weights (FloatArray) –
time (TimeCode) –
- GetBlendShapeMapper() AnimMapper
Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local blend shape order of this prim.
Returns a null reference if the underlying prim has no blend shapes. The mapper maps data from the order given by the blendShapes order on the SkelAnimation to the order given by the skel:blendShapes property, as set through the UsdSkelBindingAPI.
- GetBlendShapeOrder(blendShapes) bool
Get the blend shapes for this skinning site, if any.
- Parameters
blendShapes (TokenArray) –
- GetBlendShapeTargetsRel() Relationship
- GetInterpolation() str
- GetJointMapper() AnimMapper
Return a mapper for remapping from the joint order of the skeleton to the local joint order of this prim, if any.
Returns a null pointer if the prim has no custom joint orer. The mapper maps data from the order given by the joints order on the Skeleton to the order given by the skel:joints property, as optionally set through the UsdSkelBindingAPI.
- GetJointOrder(jointOrder) bool
Get the custom joint order for this skinning site, if any.
- Parameters
jointOrder (TokenArray) –
- GetMapper() AnimMapper
Deprecated
Use GetJointMapper.
- GetNumInfluencesPerComponent() int
Returns the number of influences encoded for each component.
If the prim defines rigid joint influences, then this returns the number of influences that map to every point. Otherwise, this provides the number of influences per point.
IsRigidlyDeformed
- GetTimeSamples(times) bool
Populate
times
with the union of time samples for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).UsdAttribute::GetTimeSamples
- Parameters
times (list[float]) –
- GetTimeSamplesInInterval(interval, times) bool
Populate
times
with the union of time samples withininterval
, for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).UsdAttribute::GetTimeSamplesInInterval
- Parameters
interval (Interval) –
times (list[float]) –
- HasBlendShapes() bool
Returns true if there are blend shapes associated with this prim.
- HasJointInfluences() bool
Returns true if joint influence data is associated with this prim.
- IsRigidlyDeformed() bool
Returns true if the held prim has the same joint influences across all points, or false otherwise.
- class pxr.UsdSkel.Tokens
Attributes:
- bindTransforms = 'bindTransforms'
- blendShapeWeights = 'blendShapeWeights'
- blendShapes = 'blendShapes'
- classicLinear = 'ClassicLinear'
- dualQuaternion = 'DualQuaternion'
- jointNames = 'jointNames'
- joints = 'joints'
- normalOffsets = 'normalOffsets'
- offsets = 'offsets'
- pointIndices = 'pointIndices'
- primvarsSkelGeomBindTransform = 'primvars:skel:geomBindTransform'
- primvarsSkelJointIndices = 'primvars:skel:jointIndices'
- primvarsSkelJointWeights = 'primvars:skel:jointWeights'
- primvarsSkelSkinningBlendWeights = 'primvars:skel:skinningBlendWeights'
- restTransforms = 'restTransforms'
- rotations = 'rotations'
- scales = 'scales'
- skelAnimationSource = 'skel:animationSource'
- skelBlendShapeTargets = 'skel:blendShapeTargets'
- skelBlendShapes = 'skel:blendShapes'
- skelJoints = 'skel:joints'
- skelSkeleton = 'skel:skeleton'
- skelSkinningMethod = 'skel:skinningMethod'
- translations = 'translations'
- weight = 'weight'
- weightedBlend = 'WeightedBlend'
- class pxr.UsdSkel.Topology
Object holding information describing skeleton topology. This provides the hierarchical information needed to reason about joint relationships in a manner suitable to computations.
Methods:
GetParent
(index)Returns the parent joint of the
index'th
joint, Returns -1 for joints with no parent (roots).IsRoot
(index)Returns true if the
index'th
joint is a root joint.Validate
(reason)Validate the topology.
- GetNumJoints() int
- GetParent(index) int
Returns the parent joint of the
index'th
joint, Returns -1 for joints with no parent (roots).- Parameters
index (int) –
- IsRoot(index) bool
Returns true if the
index'th
joint is a root joint.- Parameters
index (int) –
- Validate(reason) bool
Validate the topology.
If validation is unsuccessful, a reason why will be written to
reason
, if provided.- Parameters
reason (str) –