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);
483 int numInfluencesPerPoint,
485 bool inSerial=
false);
494 int numInfluencesPerPoint,
496 bool inSerial=
false);
505 int numInfluencesPerPoint,
507 bool inSerial=
false);
515 int numInfluencesPerPoint,
517 bool inSerial=
false);
525 const VtMatrix4dArray& jointXforms,
526 const VtIntArray& jointIndices,
527 const VtFloatArray& jointWeights,
528 int numInfluencesPerPoint,
529 VtVec3fArray* points);
539 const int* jointIndices,
540 const float* jointWeights,
541 size_t numInfluences,
542 int numInfluencesPerPoint,
545 bool inSerial=
false);
564 int numInfluencesPerPoint,
566 bool inSerial=
false);
576 int numInfluencesPerPoint,
578 bool inSerial=
false);
587 int numInfluencesPerPoint,
589 bool inSerial=
false);
598 int numInfluencesPerPoint,
600 bool inSerial=
false);
609 int numInfluencesPerPoint,
612 bool inSerial=
false);
621 int numInfluencesPerPoint,
624 bool inSerial=
false);
673 const int* jointIndices,
674 const float* jointWeights,
675 size_t numInfluences,
692 PXR_NAMESPACE_CLOSE_SCOPE
695 #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 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.
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), for normals with vertex or varying interpolation.
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...