24#ifndef PXR_USD_USD_SKEL_SKINNING_QUERY_H
25#define PXR_USD_USD_SKEL_SKINNING_QUERY_H
30#include "pxr/usd/usdSkel/api.h"
32#include "pxr/usd/usd/attribute.h"
34#include "pxr/usd/usd/relationship.h"
36#include "pxr/usd/usdGeom/primvar.h"
42PXR_NAMESPACE_OPEN_SCOPE
63 const VtTokenArray& skelJointOrder,
64 const VtTokenArray& blendShapeOrder,
74 bool IsValid()
const {
return bool(_prim); }
77 explicit operator bool()
const {
return IsValid(); }
79 const UsdPrim& GetPrim()
const {
return _prim; }
95 return _numInfluencesPerComponent;
98 const TfToken& GetInterpolation()
const {
return _interpolation; }
106 return _skinningMethodAttr;
110 return _geomBindTransformAttr;
114 return _jointIndicesPrimvar;
118 return _jointWeightsPrimvar;
126 return _blendShapeTargets;
140 const UsdSkelAnimMapperRefPtr&
GetMapper()
const {
return _jointMapper; }
150 return _blendShapeMapper;
176 std::vector<double>* times)
const;
184 VtFloatArray* weights,
196 VtFloatArray* weights,
207 template <
typename Matrix4>
210 VtVec3fArray* points,
221 template <
typename Matrix4>
224 VtVec3fArray* points,
237 template <
typename Matrix4>
249 template <
typename Matrix4>
255 TfToken GetSkinningMethod()
const;
262 std::string GetDescription()
const;
266 void _InitializeJointInfluenceBindings(
270 void _InitializeBlendShapeBindings(
275 int _numInfluencesPerComponent = 1;
285 UsdSkelAnimMapperRefPtr _jointMapper;
286 UsdSkelAnimMapperRefPtr _blendShapeMapper;
287 std::optional<VtTokenArray> _jointOrder;
288 std::optional<VtTokenArray> _blendShapeOrder;
291PXR_NAMESPACE_CLOSE_SCOPE
A basic mathematical interval class.
Stores a 4x4 matrix of double elements.
Token for efficient comparison, assignment, and hashing of known strings.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Boundable introduces the ability for a prim to persistently cache a rectilinear, local-space,...
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Object used for querying resolved bindings for skinning.
USDSKEL_API bool HasBlendShapes() const
Returns true if there are blend shapes associated with this prim.
USDSKEL_API bool ComputeSkinnedNormals(const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
Compute skinned normals using specified skinning method attr (fallback to linear blend skinning if no...
USDSKEL_API bool GetBlendShapeOrder(VtTokenArray *blendShapes) const
Get the blend shapes for this skinning site, if any.
USDSKEL_API bool IsRigidlyDeformed() const
Returns true if the held prim has the same joint influences across all points, or false otherwise.
const UsdSkelAnimMapperRefPtr & GetJointMapper() const
Return a mapper for remapping from the joint order of the skeleton to the local joint order of this p...
USDSKEL_API bool GetTimeSamplesInInterval(const GfInterval &interval, std::vector< double > *times) const
Populate times with the union of time samples within interval, for all properties that affect skinnin...
USDSKEL_API bool ComputeJointInfluences(VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for computing joint influences.
USDSKEL_API float ComputeExtentsPadding(const VtArray< Matrix4 > &skelRestXforms, const UsdGeomBoundable &boundable) const
Helper for computing an approximate padding for use in extents computations.
int GetNumInfluencesPerComponent() const
Returns the number of influences encoded for each component.
const UsdSkelAnimMapperRefPtr & GetBlendShapeMapper() const
Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local b...
USDSKEL_API bool ComputeSkinnedPoints(const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
Compute skinned points using specified skinning method attr (fallback to linear blend skinning if not...
bool IsValid() const
Returns true if this query is valid.
const UsdSkelAnimMapperRefPtr & GetMapper() const
USDSKEL_API bool GetTimeSamples(std::vector< double > *times) const
Populate times with the union of time samples for all properties that affect skinning,...
USDSKEL_API bool ComputeSkinnedTransform(const VtArray< Matrix4 > &xforms, Matrix4 *xform, UsdTimeCode time=UsdTimeCode::Default()) const
Compute a skinning transform using specified skinning method attr (fallback to linear blend skinning ...
USDSKEL_API bool HasJointInfluences() const
Returns true if joint influence data is associated with this prim.
USDSKEL_API bool ComputeVaryingJointInfluences(size_t numPoints, VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for computing joint influence, where constant influences are expanded to hold valu...
USDSKEL_API bool GetJointOrder(VtTokenArray *jointOrder) const
Get the custom joint order for this skinning site, if any.
USDSKEL_API UsdSkelSkinningQuery(const UsdPrim &prim, const VtTokenArray &skelJointOrder, const VtTokenArray &blendShapeOrder, const UsdAttribute &jointIndices, const UsdAttribute &jointWeights, const UsdAttribute &skinningMethod, const UsdAttribute &geomBindTransform, const UsdAttribute &joints, const UsdAttribute &blendShapes, const UsdRelationship &blendShapeTargets)
Construct a new skining query for the resolved properties set through the UsdSkelBindingAPI,...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Represents an arbitrary dimensional rectangular container class.