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);
396 float eps = std::numeric_limits<float>::epsilon());
410 int numInfluencesPerComponent);
417 int numInfluencesPerComponent);
444 int srcNumInfluencesPerComponent,
445 int newNumInfluencesPerComponent);
451 int srcNumInfluencesPerComponent,
452 int newNumInfluencesPerComponent);
484 int numInfluencesPerPoint,
486 bool inSerial=
false);
497 int numInfluencesPerPoint,
499 bool inSerial=
false);
509 int numInfluencesPerPoint,
511 bool inSerial=
false);
521 int numInfluencesPerPoint,
523 bool inSerial=
false);
532 const VtMatrix4dArray& jointXforms,
533 const VtIntArray& jointIndices,
534 const VtFloatArray& jointWeights,
535 int numInfluencesPerPoint,
536 VtVec3fArray* points);
547 const int* jointIndices,
548 const float* jointWeights,
549 size_t numInfluences,
550 int numInfluencesPerPoint,
553 bool inSerial=
false);
562 int numInfluencesPerPoint,
564 bool inSerial=
false);
573 int numInfluencesPerPoint,
575 bool inSerial=
false);
584 int numInfluencesPerPoint,
586 bool inSerial=
false);
594 int numInfluencesPerPoint,
596 bool inSerial=
false);
604 const VtMatrix4dArray& jointXforms,
605 const VtIntArray& jointIndices,
606 const VtFloatArray& jointWeights,
607 int numInfluencesPerPoint,
608 VtVec3fArray* points);
618 const int* jointIndices,
619 const float* jointWeights,
620 size_t numInfluences,
621 int numInfluencesPerPoint,
624 bool inSerial=
false);
644 int numInfluencesPerPoint,
646 bool inSerial=
false);
657 int numInfluencesPerPoint,
659 bool inSerial=
false);
669 int numInfluencesPerPoint,
671 bool inSerial=
false);
681 int numInfluencesPerPoint,
683 bool inSerial=
false);
694 int numInfluencesPerPoint,
697 bool inSerial=
false);
707 int numInfluencesPerPoint,
710 bool inSerial=
false);
719 int numInfluencesPerPoint,
721 bool inSerial=
false);
731 int numInfluencesPerPoint,
733 bool inSerial=
false);
742 int numInfluencesPerPoint,
744 bool inSerial=
false);
753 int numInfluencesPerPoint,
755 bool inSerial=
false);
764 int numInfluencesPerPoint,
767 bool inSerial=
false);
776 int numInfluencesPerPoint,
779 bool inSerial=
false);
833 const int* jointIndices,
834 const float* jointWeights,
835 size_t numInfluences,
880 const int* jointIndices,
881 const float* jointWeights,
882 size_t numInfluences,
899 PXR_NAMESPACE_CLOSE_SCOPE
902 #endif // PXR_USD_USD_SKEL_UTILS_H USDSKEL_API bool UsdSkelSkinPoints(const TfToken &skinningMethod, 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) or dual quaternion skinning (DQS).
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.
USDSKEL_API bool UsdSkelSkinPointsLBS(const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients,...
USDSKEL_API bool UsdSkelSkinFaceVaryingNormalsLBS(const GfMatrix3d &geomBindTransform, TfSpan< const GfMatrix3d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< const int > faceVertexIndices, TfSpan< GfVec3f > normals, bool inSerial=false)
Skin normals with faceVarying interpolation using linear blend skinning.
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...
Stores a 3x3 matrix of float elements.
Token for efficient comparison, assignment, and hashing of known strings.
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.
USDSKEL_API bool UsdSkelSkinNormalsLBS(const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
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 UsdSkelSkinFaceVaryingNormals(const TfToken &skinningMethod, const GfMatrix3d &geomBindTransform, TfSpan< const GfMatrix3d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< const int > faceVertexIndices, TfSpan< GfVec3f > normals, bool inSerial=false)
Skin normals with faceVarying interpolation using LBS or DQS.
USDSKEL_API bool UsdSkelSkinTransform(const TfToken &skinningMethod, 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) or dual quaternion skinning (DQS).
Stores a 3x3 matrix of double elements.
USDSKEL_API bool UsdSkelSkinNormals(const TfToken &skinningMethod, 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) or dual quaternion skinning (DQS), for normals with ve...
USDSKEL_API bool UsdSkelSkinTransformLBS(const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4f *xform)
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.
USDSKEL_API bool UsdSkelNormalizeWeights(TfSpan< float > weights, int numInfluencesPerComponent, float eps=std::numeric_limits< float >::epsilon())
Helper method to normalize weight values across each consecutive run of numInfluencesPerComponent ele...