Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_USD_SKEL_UTILS_H
8#define PXR_USD_USD_SKEL_UTILS_H
9
14
15#include "pxr/pxr.h"
16#include "pxr/usd/usdSkel/api.h"
17
18#include "pxr/base/gf/quatf.h"
23#include "pxr/base/gf/vec3h.h"
24#include "pxr/base/gf/vec3h.h"
25#include "pxr/base/tf/span.h"
26#include "pxr/base/vt/array.h"
27#include "pxr/base/vt/types.h"
28
29#include "pxr/usd/sdf/path.h"
30
31#include <cstddef>
32
33// XXX: Included for backwards compatibility.
34#include "pxr/usd/usdSkel/bakeSkinning.h"
35
36
37PXR_NAMESPACE_OPEN_SCOPE
38
39
40class GfMatrix3f;
41class GfRange3f;
42class GfRotation;
43class UsdPrim;
44class UsdPrimRange;
45class UsdRelationship;
46class UsdSkelRoot;
47class UsdSkelTopology;
48
49
52
53
55USDSKEL_API
56bool
58
59
63USDSKEL_API
64bool
66
67
71
72
85USDSKEL_API
86bool
89 TfSpan<const GfMatrix4d> inverseXforms,
90 TfSpan<GfMatrix4d> jointLocalXforms,
91 const GfMatrix4d* rootInverseXform=nullptr);
92
94USDSKEL_API
95bool
98 TfSpan<const GfMatrix4f> inverseXforms,
99 TfSpan<GfMatrix4f> jointLocalXforms,
100 const GfMatrix4f* rootInverseXform=nullptr);
101
105USDSKEL_API
106bool
109 TfSpan<GfMatrix4d> jointLocalXforms,
110 const GfMatrix4d* rootInverseXform=nullptr);
111
112USDSKEL_API
113bool
116 TfSpan<GfMatrix4f> jointLocalXforms,
117 const GfMatrix4f* rootInverseXform=nullptr);
118
119
122USDSKEL_API
123bool
125 const VtMatrix4dArray& xforms,
126 const VtMatrix4dArray& inverseXforms,
127 VtMatrix4dArray* jointLocalXforms,
128 const GfMatrix4d* rootInverseXform=nullptr);
129
130
131
132
135USDSKEL_API
136bool
138 const VtMatrix4dArray& xforms,
139 VtMatrix4dArray* jointLocalXforms,
140 const GfMatrix4d* rootInverseXform=nullptr);
141
142
145USDSKEL_API
146bool
148 const GfMatrix4d* xforms,
149 const GfMatrix4d* inverseXforms,
150 GfMatrix4d* jointLocalXforms,
151 const GfMatrix4d* rootInverseXform=nullptr);
152
153
154
164USDSKEL_API
165bool
167 TfSpan<const GfMatrix4d> jointLocalXforms,
168 TfSpan<GfMatrix4d> xforms,
169 const GfMatrix4d* rootXform=nullptr);
170
171
173USDSKEL_API
174bool
176 TfSpan<const GfMatrix4f> jointLocalXforms,
177 TfSpan<GfMatrix4f> xforms,
178 const GfMatrix4f* rootXform=nullptr);
179
180
181
184USDSKEL_API
185bool
187 const VtMatrix4dArray& jointLocalXforms,
188 VtMatrix4dArray* xforms,
189 const GfMatrix4d* rootXform=nullptr);
190
191
194USDSKEL_API
195bool
197 const GfMatrix4d* jointLocalXforms,
198 GfMatrix4d* xforms,
199 const GfMatrix4d* rootXform=nullptr);
200
201
206template <typename Matrix4>
207USDSKEL_API
208bool
210 GfRange3f* extent,
211 float pad=0.0f,
212 const Matrix4* rootXform=nullptr);
213
214
215
218USDSKEL_API
219bool
220UsdSkelComputeJointsExtent(const VtMatrix4dArray& joints,
221 VtVec3fArray* extent,
222 float pad=0.0f,
223 const GfMatrix4d* rootXform=nullptr);
224
225
228USDSKEL_API
229bool
231 size_t numXforms,
232 VtVec3fArray* extent,
233 float pad=0.0f,
234 const GfMatrix4d* rootXform=nullptr);
235
236
238
239
244
245
248template <typename Matrix4>
249USDSKEL_API
250bool
251UsdSkelDecomposeTransform(const Matrix4& xform,
252 GfVec3f* translate,
253 GfRotation* rotate,
254 GfVec3h* scale);
255
257template <typename Matrix4>
258USDSKEL_API
259bool
260UsdSkelDecomposeTransform(const Matrix4& xform,
261 GfVec3f* translate,
262 GfQuatf* rotate,
263 GfVec3h* scale);
264
265
268USDSKEL_API
269bool
271 TfSpan<GfVec3f> translations,
272 TfSpan<GfQuatf> rotations,
273 TfSpan<GfVec3h> scales);
274
276USDSKEL_API
277bool
279 TfSpan<GfVec3f> translations,
280 TfSpan<GfQuatf> rotations,
281 TfSpan<GfVec3h> scales);
282
283
286USDSKEL_API
287bool
288UsdSkelDecomposeTransforms(const VtMatrix4dArray& xforms,
289 VtVec3fArray* translations,
290 VtQuatfArray* rotations,
291 VtVec3hArray* scales);
292
293
296USDSKEL_API
297bool
299 GfVec3f* translations,
300 GfQuatf* rotations,
301 GfVec3h* scales,
302 size_t count);
303
304
307template <typename Matrix4>
308USDSKEL_API
309void
311 const GfMatrix3f& rotate,
312 const GfVec3h& scale,
313 Matrix4* xform);
314
316template <typename Matrix4>
317USDSKEL_API
318void
320 const GfQuatf& rotate,
321 const GfVec3h& scale,
322 Matrix4* xform);
323
326USDSKEL_API
327bool
329 TfSpan<const GfQuatf> rotations,
331 TfSpan<GfMatrix4d> xforms);
332
333
335USDSKEL_API
336bool
338 TfSpan<const GfQuatf> rotations,
340 TfSpan<GfMatrix4f> xforms);
341
342
345USDSKEL_API
346bool
347UsdSkelMakeTransforms(const VtVec3fArray& translations,
348 const VtQuatfArray& rotations,
349 const VtVec3hArray& scales,
350 VtMatrix4dArray* xforms);
351
354USDSKEL_API
355bool
356UsdSkelMakeTransforms(const GfVec3f* translations,
357 const GfQuatf* rotations,
358 const GfVec3h* scales,
359 GfMatrix4d* xforms,
360 size_t count);
361
362
364
365
370
371
376USDSKEL_API
377bool
378UsdSkelNormalizeWeights(TfSpan<float> weights, int numInfluencesPerComponent,
379 float eps = std::numeric_limits<float>::epsilon());
380
381
384USDSKEL_API
385bool
386UsdSkelNormalizeWeights(VtFloatArray* weights, int numInfluencesPerComponent);
387
388
390USDSKEL_API
391bool
393 int numInfluencesPerComponent);
394
397USDSKEL_API
398bool
399UsdSkelSortInfluences(VtIntArray* indices, VtFloatArray* weights,
400 int numInfluencesPerComponent);
401
402
409USDSKEL_API
410bool
411UsdSkelExpandConstantInfluencesToVarying(VtIntArray* indices, size_t size);
412
414USDSKEL_API
415bool
416UsdSkelExpandConstantInfluencesToVarying(VtFloatArray* weights, size_t size);
417
424USDSKEL_API
425bool
426UsdSkelResizeInfluences(VtIntArray* indices,
427 int srcNumInfluencesPerComponent,
428 int newNumInfluencesPerComponent);
429
431USDSKEL_API
432bool
433UsdSkelResizeInfluences(VtFloatArray* weights,
434 int srcNumInfluencesPerComponent,
435 int newNumInfluencesPerComponent);
436
439USDSKEL_API
440bool
442 const TfSpan<const float>& weights,
443 TfSpan<GfVec2f> interleavedInfluences);
444
445
447
448
452
453
460USDSKEL_API
461bool
462UsdSkelSkinPoints(const TfToken& skinningMethod,
463 const GfMatrix4d& geomBindTransform,
464 TfSpan<const GfMatrix4d> jointXforms,
465 TfSpan<const int> jointIndices,
466 TfSpan<const float> jointWeights,
467 int numInfluencesPerPoint,
468 TfSpan<GfVec3f> points,
469 bool inSerial=false);
470
471
473USDSKEL_API
474bool
475UsdSkelSkinPoints(const TfToken& skinningMethod,
476 const GfMatrix4f& geomBindTransform,
477 TfSpan<const GfMatrix4f> jointXforms,
478 TfSpan<const int> jointIndices,
479 TfSpan<const float> jointWeights,
480 int numInfluencesPerPoint,
481 TfSpan<GfVec3f> points,
482 bool inSerial=false);
483
484
486USDSKEL_API
487bool
488UsdSkelSkinPoints(const TfToken& skinningMethod,
489 const GfMatrix4d& geomBindTransform,
490 TfSpan<const GfMatrix4d> jointXforms,
491 TfSpan<const GfVec2f> influences,
492 int numInfluencesPerPoint,
493 TfSpan<GfVec3f> points,
494 bool inSerial=false);
495
496
498USDSKEL_API
499bool
500UsdSkelSkinPoints(const TfToken& skinningMethod,
501 const GfMatrix4f& geomBindTransform,
502 TfSpan<const GfMatrix4f> jointXforms,
503 TfSpan<const GfVec2f> influences,
504 int numInfluencesPerPoint,
505 TfSpan<GfVec3f> points,
506 bool inSerial=false);
507
508
511USDSKEL_API
512bool
513UsdSkelSkinPoints(const TfToken& skinningMethod,
514 const GfMatrix4d& geomBindTransform,
515 const VtMatrix4dArray& jointXforms,
516 const VtIntArray& jointIndices,
517 const VtFloatArray& jointWeights,
518 int numInfluencesPerPoint,
519 VtVec3fArray* points);
520
521
524USDSKEL_API
525bool
526UsdSkelSkinPoints(const TfToken& skinningMethod,
527 const GfMatrix4d& geomBindTransform,
528 const GfMatrix4d* jointXforms,
529 size_t numJoints,
530 const int* jointIndices,
531 const float* jointWeights,
532 size_t numInfluences,
533 int numInfluencesPerPoint,
534 GfVec3f* points,
535 size_t numPoints,
536 bool inSerial=false);
537
538
539USDSKEL_API
540bool
541UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
542 TfSpan<const GfMatrix4d> jointXforms,
543 TfSpan<const int> jointIndices,
544 TfSpan<const float> jointWeights,
545 int numInfluencesPerPoint,
546 TfSpan<GfVec3f> points,
547 bool inSerial=false);
548
550USDSKEL_API
551bool
552UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
553 TfSpan<const GfMatrix4f> jointXforms,
554 TfSpan<const int> jointIndices,
555 TfSpan<const float> jointWeights,
556 int numInfluencesPerPoint,
557 TfSpan<GfVec3f> points,
558 bool inSerial=false);
559
560
562USDSKEL_API
563bool
564UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
565 TfSpan<const GfMatrix4d> jointXforms,
566 TfSpan<const GfVec2f> influences,
567 int numInfluencesPerPoint,
568 TfSpan<GfVec3f> points,
569 bool inSerial=false);
570
572USDSKEL_API
573bool
574UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
575 TfSpan<const GfMatrix4f> jointXforms,
576 TfSpan<const GfVec2f> influences,
577 int numInfluencesPerPoint,
578 TfSpan<GfVec3f> points,
579 bool inSerial=false);
580
581
584USDSKEL_API
585bool
586UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
587 const VtMatrix4dArray& jointXforms,
588 const VtIntArray& jointIndices,
589 const VtFloatArray& jointWeights,
590 int numInfluencesPerPoint,
591 VtVec3fArray* points);
592
593
596USDSKEL_API
597bool
598UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
599 const GfMatrix4d* jointXforms,
600 size_t numJoints,
601 const int* jointIndices,
602 const float* jointWeights,
603 size_t numInfluences,
604 int numInfluencesPerPoint,
605 GfVec3f* points,
606 size_t numPoints,
607 bool inSerial=false);
608
609
620USDSKEL_API
621bool
622UsdSkelSkinNormals(const TfToken& skinningMethod,
623 const GfMatrix3d& geomBindTransform,
624 TfSpan<const GfMatrix3d> jointXforms,
625 TfSpan<const int> jointIndices,
626 TfSpan<const float> jointWeights,
627 int numInfluencesPerPoint,
628 TfSpan<GfVec3f> normals,
629 bool inSerial=false);
630
631
633USDSKEL_API
634bool
635UsdSkelSkinNormals(const TfToken& skinningMethod,
636 const GfMatrix3f& geomBindTransform,
637 TfSpan<const GfMatrix3f> jointXforms,
638 TfSpan<const int> jointIndices,
639 TfSpan<const float> jointWeights,
640 int numInfluencesPerPoint,
641 TfSpan<GfVec3f> normals,
642 bool inSerial=false);
643
644
646USDSKEL_API
647bool
648UsdSkelSkinNormals(const TfToken& skinningMethod,
649 const GfMatrix3d& geomBindTransform,
650 TfSpan<const GfMatrix3d> jointXforms,
651 TfSpan<const GfVec2f> influences,
652 int numInfluencesPerPoint,
653 TfSpan<GfVec3f> normals,
654 bool inSerial=false);
655
656
658USDSKEL_API
659bool
660UsdSkelSkinNormals(const TfToken& skinningMethod,
661 const GfMatrix3f& geomBindTransform,
662 TfSpan<const GfMatrix3f> jointXforms,
663 TfSpan<const GfVec2f> influences,
664 int numInfluencesPerPoint,
665 TfSpan<GfVec3f> normals,
666 bool inSerial=false);
667
668
670USDSKEL_API
671bool
673 const GfMatrix3d& geomBindTransform,
674 TfSpan<const GfMatrix3d> jointXforms,
675 TfSpan<const int> jointIndices,
676 TfSpan<const float> jointWeights,
677 int numInfluencesPerPoint,
678 TfSpan<const int> faceVertexIndices,
679 TfSpan<GfVec3f> normals,
680 bool inSerial=false);
681
683USDSKEL_API
684bool
686 const GfMatrix3f& geomBindTransform,
687 TfSpan<const GfMatrix3f> jointXforms,
688 TfSpan<const int> jointIndices,
689 TfSpan<const float> jointWeights,
690 int numInfluencesPerPoint,
691 TfSpan<const int> faceVertexIndices,
692 TfSpan<GfVec3f> normals,
693 bool inSerial=false);
694
695
696USDSKEL_API
697bool
698UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
699 TfSpan<const GfMatrix3d> jointXforms,
700 TfSpan<const int> jointIndices,
701 TfSpan<const float> jointWeights,
702 int numInfluencesPerPoint,
703 TfSpan<GfVec3f> normals,
704 bool inSerial=false);
705
706
708USDSKEL_API
709bool
710UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
711 TfSpan<const GfMatrix3f> jointXforms,
712 TfSpan<const int> jointIndices,
713 TfSpan<const float> jointWeights,
714 int numInfluencesPerPoint,
715 TfSpan<GfVec3f> normals,
716 bool inSerial=false);
717
718
720USDSKEL_API
721bool
722UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
723 TfSpan<const GfMatrix3d> jointXforms,
724 TfSpan<const GfVec2f> influences,
725 int numInfluencesPerPoint,
726 TfSpan<GfVec3f> normals,
727 bool inSerial=false);
728
729
731USDSKEL_API
732bool
733UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
734 TfSpan<const GfMatrix3f> jointXforms,
735 TfSpan<const GfVec2f> influences,
736 int numInfluencesPerPoint,
737 TfSpan<GfVec3f> normals,
738 bool inSerial=false);
739
741USDSKEL_API
742bool
744 TfSpan<const GfMatrix3d> jointXforms,
745 TfSpan<const int> jointIndices,
746 TfSpan<const float> jointWeights,
747 int numInfluencesPerPoint,
748 TfSpan<const int> faceVertexIndices,
749 TfSpan<GfVec3f> normals,
750 bool inSerial=false);
751
753USDSKEL_API
754bool
756 TfSpan<const GfMatrix3f> jointXforms,
757 TfSpan<const int> jointIndices,
758 TfSpan<const float> jointWeights,
759 int numInfluencesPerPoint,
760 TfSpan<const int> faceVertexIndices,
761 TfSpan<GfVec3f> normals,
762 bool inSerial=false);
763
764
770USDSKEL_API
771bool
772UsdSkelSkinTransform(const TfToken& skinningMethod,
773 const GfMatrix4d& geomBindTransform,
774 TfSpan<const GfMatrix4d> jointXforms,
775 TfSpan<const int> jointIndices,
776 TfSpan<const float> jointWeights,
777 GfMatrix4d* xform);
778
780USDSKEL_API
781bool
782UsdSkelSkinTransform(const TfToken& skinningMethod,
783 const GfMatrix4f& geomBindTransform,
784 TfSpan<const GfMatrix4f> jointXforms,
785 TfSpan<const int> jointIndices,
786 TfSpan<const float> jointWeights,
787 GfMatrix4f* xform);
788
791USDSKEL_API
792bool
793UsdSkelSkinTransform(const TfToken& skinningMethod,
794 const GfMatrix4d& geomBindTransform,
795 TfSpan<const GfMatrix4d> jointXforms,
796 TfSpan<const GfVec2f> influences,
797 GfMatrix4d* xform);
798
800USDSKEL_API
801bool
802UsdSkelSkinTransform(const TfToken& skinningMethod,
803 const GfMatrix4f& geomBindTransform,
804 TfSpan<const GfMatrix4f> jointXforms,
805 TfSpan<const GfVec2f> influences,
806 GfMatrix4f* xform);
807
810USDSKEL_API
811bool
812UsdSkelSkinTransform(const TfToken& skinningMethod,
813 const GfMatrix4d& geomBindTransform,
814 const GfMatrix4d* jointXforms,
815 size_t numJoints,
816 const int* jointIndices,
817 const float* jointWeights,
818 size_t numInfluences,
819 GfMatrix4d* xform);
820
821
822USDSKEL_API
823bool
824UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
825 TfSpan<const GfMatrix4d> jointXforms,
826 TfSpan<const int> jointIndices,
827 TfSpan<const float> jointWeights,
828 GfMatrix4d* xform);
829
831USDSKEL_API
832bool
833UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
834 TfSpan<const GfMatrix4f> jointXforms,
835 TfSpan<const int> jointIndices,
836 TfSpan<const float> jointWeights,
837 GfMatrix4f* xform);
838
841USDSKEL_API
842bool
843UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
844 TfSpan<const GfMatrix4d> jointXforms,
845 TfSpan<const GfVec2f> influences,
846 GfMatrix4d* xform);
847
849USDSKEL_API
850bool
851UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
852 TfSpan<const GfMatrix4f> jointXforms,
853 TfSpan<const GfVec2f> influences,
854 GfMatrix4f* xform);
855
858USDSKEL_API
859bool
860UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
861 const GfMatrix4d* jointXforms,
862 size_t numJoints,
863 const int* jointIndices,
864 const float* jointWeights,
865 size_t numInfluences,
866 GfMatrix4d* xform);
867
868
874USDSKEL_API
875bool
876UsdSkelApplyBlendShape(const float weight,
877 const TfSpan<const GfVec3f> offsets,
878 const TfSpan<const int> indices,
879 TfSpan<GfVec3f> points);
880
882
884
885PXR_NAMESPACE_CLOSE_SCOPE
886
887
888#endif // PXR_USD_USD_SKEL_UTILS_H
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
Stores a 3x3 matrix of double elements.
Definition: matrix3d.h:65
Stores a 3x3 matrix of float elements.
Definition: matrix3f.h:65
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Stores a 4x4 matrix of float elements.
Definition: matrix4f.h:71
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients,...
Definition: quatf.h:43
Basic type: 3-dimensional floating point range.
Definition: range3f.h:47
Basic type: 3-space rotation specification.
Definition: rotation.h:37
Basic type for a vector of 3 float components.
Definition: vec3f.h:46
Basic type for a vector of 3 GfHalf components.
Definition: vec3h.h:47
Represents a range of contiguous elements.
Definition: span.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
Definition: primRange.h:102
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined.
Definition: root.h:47
Object holding information describing skeleton topology.
Definition: topology.h:29
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 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.
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 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...
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 UsdSkelComputeJointsExtent(TfSpan< const Matrix4 > joints, GfRange3f *extent, float pad=0.0f, const Matrix4 *rootXform=nullptr)
Compute an extent from a set of skel-space joint transform.
USDSKEL_API bool UsdSkelComputeJointLocalTransforms(const UsdSkelTopology &topology, TfSpan< const GfMatrix4d > xforms, TfSpan< const GfMatrix4d > inverseXforms, TfSpan< GfMatrix4d > jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
Compute joint transforms in joint-local space.
USDSKEL_API bool UsdSkelConcatJointTransforms(const UsdSkelTopology &topology, TfSpan< const GfMatrix4d > jointLocalXforms, TfSpan< GfMatrix4d > xforms, const GfMatrix4d *rootXform=nullptr)
Compute concatenated joint transforms.
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 UsdSkelApplyBlendShape(const float weight, const TfSpan< const GfVec3f > offsets, const TfSpan< const int > indices, TfSpan< GfVec3f > points)
Apply a single blend shape to points.
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).
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 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 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 void UsdSkelMakeTransform(const GfVec3f &translate, const GfMatrix3f &rotate, const GfVec3h &scale, Matrix4 *xform)
Create a transform from translate/rotate/scale components.
USDSKEL_API bool UsdSkelDecomposeTransforms(TfSpan< const GfMatrix4d > xforms, TfSpan< GfVec3f > translations, TfSpan< GfQuatf > rotations, TfSpan< GfVec3h > scales)
Decompose an array of transforms into translate/rotate/scale components.
USDSKEL_API bool UsdSkelMakeTransforms(TfSpan< const GfVec3f > translations, TfSpan< const GfQuatf > rotations, TfSpan< const GfVec3h > scales, TfSpan< GfMatrix4d > xforms)
Create transforms from arrays of components.
USDSKEL_API bool UsdSkelDecomposeTransform(const Matrix4 &xform, GfVec3f *translate, GfRotation *rotate, GfVec3h *scale)
Decompose a transform into translate/rotate/scale components.
USDSKEL_API bool UsdSkelIsSkinnablePrim(const UsdPrim &prim)
Returns true if prim is considered to be a skinnable primitive.
USDSKEL_API bool UsdSkelIsSkelAnimationPrim(const UsdPrim &prim)
Returns true if prim is a valid skel animation source.