24 #ifndef PXR_USD_USD_SKEL_UTILS_H
25 #define PXR_USD_USD_SKEL_UTILS_H
33 #include "pxr/usd/usdSkel/api.h"
46 #include "pxr/usd/sdf/path.h"
51 #include "pxr/usd/usdSkel/bakeSkinning.h"
54 PXR_NAMESPACE_OPEN_SCOPE
142 const VtMatrix4dArray& xforms,
143 const VtMatrix4dArray& inverseXforms,
144 VtMatrix4dArray* jointLocalXforms,
155 const VtMatrix4dArray& xforms,
156 VtMatrix4dArray* jointLocalXforms,
204 const VtMatrix4dArray& jointLocalXforms,
205 VtMatrix4dArray* xforms,
223 template <
typename Matrix4>
229 const Matrix4* rootXform=
nullptr);
238 VtVec3fArray* extent,
249 VtVec3fArray* extent,
265 template <
typename Matrix4>
274 template <
typename Matrix4>
306 VtVec3fArray* translations,
307 VtQuatfArray* rotations,
308 VtVec3hArray* scales);
324 template <
typename Matrix4>
333 template <
typename Matrix4>
365 const VtQuatfArray& rotations,
366 const VtVec3hArray& scales,
367 VtMatrix4dArray* xforms);
407 int numInfluencesPerComponent);
414 int numInfluencesPerComponent);
441 int srcNumInfluencesPerComponent,
442 int newNumInfluencesPerComponent);
448 int srcNumInfluencesPerComponent,
449 int newNumInfluencesPerComponent);
480 int numInfluencesPerPoint,
482 bool inSerial=
false);
491 int numInfluencesPerPoint,
493 bool inSerial=
false);
502 int numInfluencesPerPoint,
504 bool inSerial=
false);
512 int numInfluencesPerPoint,
514 bool inSerial=
false);
522 const VtMatrix4dArray& jointXforms,
523 const VtIntArray& jointIndices,
524 const VtFloatArray& jointWeights,
525 int numInfluencesPerPoint,
526 VtVec3fArray* points);
536 const int* jointIndices,
537 const float* jointWeights,
538 size_t numInfluences,
539 int numInfluencesPerPoint,
542 bool inSerial=
false);
560 int numInfluencesPerPoint,
562 bool inSerial=
false);
572 int numInfluencesPerPoint,
574 bool inSerial=
false);
583 int numInfluencesPerPoint,
585 bool inSerial=
false);
594 int numInfluencesPerPoint,
596 bool inSerial=
false);
645 const int* jointIndices,
646 const float* jointWeights,
647 size_t numInfluences,
664 PXR_NAMESPACE_CLOSE_SCOPE
667 #endif // PXR_USD_USD_SKEL_UTILS_H
USDSKEL_API bool UsdSkelInterleaveInfluences(const TfSpan< const int > &indices, const TfSpan< const float > &weights, TfSpan< GfVec2f > interleavedInfluences)
Combine arrays of joint indices and weights into interleaved (index,weight) vectors.
Stores a 4x4 matrix of float elements.
Object holding information describing skeleton topology.
Basic type for a vector of 3 float components.
USDSKEL_API bool UsdSkelIsSkinnablePrim(const UsdPrim &prim)
Returns true if prim is considered to be a skinnable primitive.
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients...
USDSKEL_API bool UsdSkelExpandConstantInfluencesToVarying(VtIntArray *indices, size_t size)
Convert an array of constant influences (joint weights or indices) to an array of varying influences...
USDSKEL_API bool UsdSkelResizeInfluences(VtIntArray *indices, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
Resize the number of influences per component in a weight or indices array, which initially has srcNu...
USDSKEL_API bool UsdSkelNormalizeWeights(TfSpan< float > weights, int numInfluencesPerComponent)
Helper method to normalize weight values across each consecutive run of numInfluencesPerComponent ele...
Stores a 3x3 matrix of float elements.
Stores a 4x4 matrix of double elements.
Represents a range of contiguous elements.
Basic type: 3-dimensional floating point range.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
USDSKEL_API bool UsdSkelSortInfluences(TfSpan< int > indices, TfSpan< float > weights, int numInfluencesPerComponent)
Sort joint influences such that highest weight values come first.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
USDSKEL_API bool UsdSkelApplyBlendShape(const float weight, const TfSpan< const GfVec3f > offsets, const TfSpan< const int > indices, TfSpan< GfVec3f > points)
Apply a single blend shape to points.
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined...
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
USDSKEL_API bool UsdSkelSkinTransformLBS(const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4d *xform)
Skin a transform using linear blend skinning (LBS).
USDSKEL_API bool UsdSkelSkinPointsLBS(const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
Skin points using linear blend skinning (LBS).
Stores a 3x3 matrix of double elements.
USDSKEL_API bool UsdSkelSkinNormalsLBS(const GfMatrix3d &geomBindTransform, TfSpan< const GfMatrix3d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
Skin normals using linear blend skinning (LBS).
USDSKEL_API bool UsdSkelIsSkelAnimationPrim(const UsdPrim &prim)
Returns true if prim is a valid skel animation source.
Basic type: 3-space rotation specification.
Basic type for a vector of 3 GfHalf components.