7 #ifndef PXR_USD_USD_SKEL_UTILS_H
8 #define PXR_USD_USD_SKEL_UTILS_H
26 #include "pxr/base/vt/array.h"
125 const VtMatrix4dArray& xforms,
126 const VtMatrix4dArray& inverseXforms,
127 VtMatrix4dArray* jointLocalXforms,
138 const VtMatrix4dArray& xforms,
139 VtMatrix4dArray* jointLocalXforms,
187 const VtMatrix4dArray& jointLocalXforms,
188 VtMatrix4dArray* xforms,
206 template <
typename Matrix4>
212 const Matrix4* rootXform=
nullptr);
221 VtVec3fArray* extent,
232 VtVec3fArray* extent,
248 template <
typename Matrix4>
257 template <
typename Matrix4>
289 VtVec3fArray* translations,
290 VtQuatfArray* rotations,
291 VtVec3hArray* scales);
307 template <
typename Matrix4>
316 template <
typename Matrix4>
348 const VtQuatfArray& rotations,
349 const VtVec3hArray& scales,
350 VtMatrix4dArray* xforms);
379 float eps = std::numeric_limits<float>::epsilon());
393 int numInfluencesPerComponent);
400 int numInfluencesPerComponent);
427 int srcNumInfluencesPerComponent,
428 int newNumInfluencesPerComponent);
434 int srcNumInfluencesPerComponent,
435 int newNumInfluencesPerComponent);
467 int numInfluencesPerPoint,
469 bool inSerial=
false);
480 int numInfluencesPerPoint,
482 bool inSerial=
false);
492 int numInfluencesPerPoint,
494 bool inSerial=
false);
504 int numInfluencesPerPoint,
506 bool inSerial=
false);
515 const VtMatrix4dArray& jointXforms,
516 const VtIntArray& jointIndices,
517 const VtFloatArray& jointWeights,
518 int numInfluencesPerPoint,
530 const int* jointIndices,
531 const float* jointWeights,
532 size_t numInfluences,
533 int numInfluencesPerPoint,
536 bool inSerial=
false);
545 int numInfluencesPerPoint,
547 bool inSerial=
false);
556 int numInfluencesPerPoint,
558 bool inSerial=
false);
567 int numInfluencesPerPoint,
569 bool inSerial=
false);
577 int numInfluencesPerPoint,
579 bool inSerial=
false);
587 const VtMatrix4dArray& jointXforms,
588 const VtIntArray& jointIndices,
589 const VtFloatArray& jointWeights,
590 int numInfluencesPerPoint,
601 const int* jointIndices,
602 const float* jointWeights,
603 size_t numInfluences,
604 int numInfluencesPerPoint,
607 bool inSerial=
false);
627 int numInfluencesPerPoint,
629 bool inSerial=
false);
640 int numInfluencesPerPoint,
642 bool inSerial=
false);
652 int numInfluencesPerPoint,
654 bool inSerial=
false);
664 int numInfluencesPerPoint,
666 bool inSerial=
false);
677 int numInfluencesPerPoint,
680 bool inSerial=
false);
690 int numInfluencesPerPoint,
693 bool inSerial=
false);
702 int numInfluencesPerPoint,
704 bool inSerial=
false);
714 int numInfluencesPerPoint,
716 bool inSerial=
false);
725 int numInfluencesPerPoint,
727 bool inSerial=
false);
736 int numInfluencesPerPoint,
738 bool inSerial=
false);
747 int numInfluencesPerPoint,
750 bool inSerial=
false);
759 int numInfluencesPerPoint,
762 bool inSerial=
false);
816 const int* jointIndices,
817 const float* jointWeights,
818 size_t numInfluences,
863 const int* jointIndices,
864 const float* jointWeights,
865 size_t numInfluences,
888 #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)
USDSKEL_API bool UsdSkelInterleaveInfluences(const TfSpan< const int > &indices, const TfSpan< const float > &weights, TfSpan< GfVec2f > interleavedInfluences)
GLsizei GLenum const void * indices
GLdouble GLdouble GLint GLint const GLdouble * points
USDSKEL_API bool UsdSkelIsSkinnablePrim(const UsdPrim &prim)
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)
USDSKEL_API bool UsdSkelResizeInfluences(VtIntArray *indices, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
GLuint GLsizei const GLuint const GLintptr * offsets
GA_API const UT_StringHolder scale
GT_API const UT_StringHolder topology
UT_Matrix4T< Float > Matrix4
USDSKEL_API bool UsdSkelSortInfluences(TfSpan< int > indices, TfSpan< float > weights, int numInfluencesPerComponent)
Sort joint influences such that highest weight values come first.
ImageBuf OIIO_API rotate(const ImageBuf &src, float angle, string_view filtername=string_view(), float filterwidth=0.0f, bool recompute_roi=false, ROI roi={}, int nthreads=0)
USDSKEL_API bool UsdSkelApplyBlendShape(const float weight, const TfSpan< const GfVec3f > offsets, const TfSpan< const int > indices, TfSpan< GfVec3f > points)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
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 UsdSkelSkinTransformLBS(const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4d *xform)
#define PXR_NAMESPACE_CLOSE_SCOPE
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)
USDSKEL_API bool UsdSkelSkinTransform(const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4d *xform)
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)
PUGI__FN char_t * translate(char_t *buffer, const char_t *from, const char_t *to, size_t to_length)
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)
USDSKEL_API bool UsdSkelIsSkelAnimationPrim(const UsdPrim &prim)
Returns true if prim is a valid skel animation source.
USDSKEL_API bool UsdSkelNormalizeWeights(TfSpan< float > weights, int numInfluencesPerComponent, float eps=std::numeric_limits< float >::epsilon())