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" 41 PXR_NAMESPACE_OPEN_SCOPE
62 const VtTokenArray& skelJointOrder,
63 const VtTokenArray& blendShapeOrder,
73 bool IsValid()
const {
return bool(_prim); }
76 explicit operator bool()
const {
return IsValid(); }
78 const UsdPrim& GetPrim()
const {
return _prim; }
94 return _numInfluencesPerComponent;
97 const TfToken& GetInterpolation()
const {
return _interpolation; }
105 return _skinningMethodAttr;
109 return _geomBindTransformAttr;
113 return _jointIndicesPrimvar;
117 return _jointWeightsPrimvar;
125 return _blendShapeTargets;
139 const UsdSkelAnimMapperRefPtr&
GetMapper()
const {
return _jointMapper; }
149 return _blendShapeMapper;
175 std::vector<double>* times)
const;
183 VtFloatArray* weights,
195 VtFloatArray* weights,
206 template <
typename Matrix4>
209 VtVec3fArray* points,
220 template <
typename Matrix4>
223 VtVec3fArray* points,
236 template <
typename Matrix4>
248 template <
typename Matrix4>
254 TfToken GetSkinningMethod()
const;
261 std::string GetDescription()
const;
265 void _InitializeJointInfluenceBindings(
269 void _InitializeBlendShapeBindings(
274 int _numInfluencesPerComponent = 1;
284 UsdSkelAnimMapperRefPtr _jointMapper;
285 UsdSkelAnimMapperRefPtr _blendShapeMapper;
286 boost::optional<VtTokenArray> _jointOrder;
287 boost::optional<VtTokenArray> _blendShapeOrder;
290 PXR_NAMESPACE_CLOSE_SCOPE
292 #endif // PXR_USD_USD_SKEL_SKINNING_QUERY_H 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 float ComputeExtentsPadding(const VtArray< Matrix4 > &skelRestXforms, const UsdGeomBoundable &boundable) const
Helper for computing an approximate padding for use in extents computations.
Object used for querying resolved bindings for skinning.
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 GetBlendShapeOrder(VtTokenArray *blendShapes) const
Get the blend shapes for this skinning site, if any.
USDSKEL_API bool ComputeJointInfluences(VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for computing joint influences.
USDSKEL_API bool HasBlendShapes() const
Returns true if there are blend shapes associated with this prim.
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Token for efficient comparison, assignment, and hashing of known strings.
Stores a 4x4 matrix of double elements.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
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...
Boundable introduces the ability for a prim to persistently cache a rectilinear, local-space,...
bool IsValid() const
Returns true if this query is valid.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
A basic mathematical interval class.
Represents an arbitrary dimensional rectangular container class.
int GetNumInfluencesPerComponent() const
Returns the number of influences encoded for each component.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
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...
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
const UsdSkelAnimMapperRefPtr & GetMapper() const
USDSKEL_API bool IsRigidlyDeformed() const
Returns true if the held prim has the same joint influences across all points, or false otherwise.
USDSKEL_API bool GetTimeSamples(std::vector< double > *times) const
Populate times with the union of time samples for all properties that affect skinning,...
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars.
USDSKEL_API bool GetJointOrder(VtTokenArray *jointOrder) const
Get the custom joint order for this skinning site, if any.
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 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 HasJointInfluences() const
Returns true if joint influence data is associated with this prim.