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
61 UsdSkelSkinningQuery(
const UsdPrim& prim,
62 const VtTokenArray& skelJointOrder,
63 const VtTokenArray& blendShapeOrder,
72 bool IsValid()
const {
return bool(_prim); }
75 explicit operator bool()
const {
return IsValid(); }
77 const UsdPrim& GetPrim()
const {
return _prim; }
93 return _numInfluencesPerComponent;
96 const TfToken& GetInterpolation()
const {
return _interpolation; }
104 return _geomBindTransformAttr;
108 return _jointIndicesPrimvar;
112 return _jointWeightsPrimvar;
120 return _blendShapeTargets;
134 const UsdSkelAnimMapperRefPtr&
GetMapper()
const {
return _jointMapper; }
144 return _blendShapeMapper;
170 std::vector<double>* times)
const;
178 VtFloatArray* weights,
190 VtFloatArray* weights,
200 template <
typename Matrix4>
203 VtVec3fArray* points,
213 template <
typename Matrix4>
216 VtVec3fArray* points,
228 template <
typename Matrix4>
240 template <
typename Matrix4>
250 std::string GetDescription()
const;
254 void _InitializeJointInfluenceBindings(
258 void _InitializeBlendShapeBindings(
263 int _numInfluencesPerComponent = 1;
272 UsdSkelAnimMapperRefPtr _jointMapper;
273 UsdSkelAnimMapperRefPtr _blendShapeMapper;
274 boost::optional<VtTokenArray> _jointOrder;
275 boost::optional<VtTokenArray> _blendShapeOrder;
278 PXR_NAMESPACE_CLOSE_SCOPE
280 #endif // PXR_USD_USD_SKEL_SKINNING_QUERY_H
Object used for querying resolved bindings for skinning.
const UsdSkelAnimMapperRefPtr & GetBlendShapeMapper() const
Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local b...
int GetNumInfluencesPerComponent() const
Returns the number of influences encoded for each component.
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 HasJointInfluences() const
Returns true if joint influence data is associated with this prim.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
USDSKEL_API bool GetJointOrder(VtTokenArray *jointOrder) const
Get the custom joint order for this skinning site, if any.
USDSKEL_API bool ComputeSkinnedNormals(const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
Compute skinned normals using linear blend skinning.
Token for efficient comparison, assignment, and hashing of known strings.
USDSKEL_API bool IsRigidlyDeformed() const
Returns true if the held prim has the same joint influences across all points, or false otherwise...
Stores a 4x4 matrix of double elements.
USDSKEL_API bool HasBlendShapes() const
Returns true if there are blend shapes associated with this prim.
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Boundable introduces the ability for a prim to persistently cache a rectilinear, local-space, extent.
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.
USDSKEL_API bool ComputeSkinnedTransform(const VtArray< Matrix4 > &xforms, Matrix4 *xform, UsdTimeCode time=UsdTimeCode::Default()) const
Compute a skinning transform using linear blend skinning.
USDSKEL_API bool GetBlendShapeOrder(VtTokenArray *blendShapes) const
Get the blend shapes for this skinning site, if any.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
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 float ComputeExtentsPadding(const VtArray< Matrix4 > &skelRestXforms, const UsdGeomBoundable &boundable) const
Helper for computing an approximate padding for use in extents computations.
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
bool IsValid() const
Returns true if this query is valid.
USDSKEL_API bool ComputeSkinnedPoints(const VtArray< Matrix4 > &xforms, VtVec3fArray *points, UsdTimeCode time=UsdTimeCode::Default()) const
Compute skinned points using linear blend skinning.
USDSKEL_API bool ComputeJointInfluences(VtIntArray *indices, VtFloatArray *weights, UsdTimeCode time=UsdTimeCode::Default()) const
Convenience method for computing joint influences.
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are primvars...
const UsdSkelAnimMapperRefPtr & GetMapper() const
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 GetTimeSamples(std::vector< double > *times) const
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).