7#ifndef PXR_USD_USD_SKEL_SKINNING_QUERY_H
8#define PXR_USD_USD_SKEL_SKINNING_QUERY_H
13#include "pxr/usd/usdSkel/api.h"
15#include "pxr/usd/usd/attribute.h"
17#include "pxr/usd/usd/relationship.h"
19#include "pxr/usd/usdGeom/primvar.h"
25PXR_NAMESPACE_OPEN_SCOPE
46 const VtTokenArray& skelJointOrder,
47 const VtTokenArray& blendShapeOrder,
57 bool IsValid()
const {
return bool(_prim); }
60 explicit operator bool()
const {
return IsValid(); }
62 const UsdPrim& GetPrim()
const {
return _prim; }
78 return _numInfluencesPerComponent;
81 const TfToken& GetInterpolation()
const {
return _interpolation; }
89 return _skinningMethodAttr;
93 return _geomBindTransformAttr;
97 return _jointIndicesPrimvar;
101 return _jointWeightsPrimvar;
109 return _blendShapeTargets;
123 const UsdSkelAnimMapperRefPtr&
GetMapper()
const {
return _jointMapper; }
133 return _blendShapeMapper;
159 std::vector<double>* times)
const;
167 VtFloatArray* weights,
179 VtFloatArray* weights,
190 template <
typename Matrix4>
193 VtVec3fArray* points,
204 template <
typename Matrix4>
207 VtVec3fArray* points,
220 template <
typename Matrix4>
232 template <
typename Matrix4>
238 TfToken GetSkinningMethod()
const;
245 std::string GetDescription()
const;
249 void _InitializeJointInfluenceBindings(
253 void _InitializeBlendShapeBindings(
258 int _numInfluencesPerComponent = 1;
268 UsdSkelAnimMapperRefPtr _jointMapper;
269 UsdSkelAnimMapperRefPtr _blendShapeMapper;
270 std::optional<VtTokenArray> _jointOrder;
271 std::optional<VtTokenArray> _blendShapeOrder;
274PXR_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.