Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef PXR_USD_USD_SKEL_UTILS_H
25#define PXR_USD_USD_SKEL_UTILS_H
26
31
32#include "pxr/pxr.h"
33#include "pxr/usd/usdSkel/api.h"
34
35#include "pxr/base/gf/quatf.h"
40#include "pxr/base/gf/vec3h.h"
41#include "pxr/base/gf/vec3h.h"
42#include "pxr/base/tf/span.h"
43#include "pxr/base/vt/array.h"
44#include "pxr/base/vt/types.h"
45
46#include "pxr/usd/sdf/path.h"
47
48#include <cstddef>
49
50// XXX: Included for backwards compatibility.
51#include "pxr/usd/usdSkel/bakeSkinning.h"
52
53
54PXR_NAMESPACE_OPEN_SCOPE
55
56
57class GfMatrix3f;
58class GfRange3f;
59class GfRotation;
60class UsdPrim;
61class UsdPrimRange;
62class UsdRelationship;
63class UsdSkelRoot;
64class UsdSkelTopology;
65
66
69
70
72USDSKEL_API
73bool
75
76
80USDSKEL_API
81bool
83
84
88
89
102USDSKEL_API
103bool
106 TfSpan<const GfMatrix4d> inverseXforms,
107 TfSpan<GfMatrix4d> jointLocalXforms,
108 const GfMatrix4d* rootInverseXform=nullptr);
109
111USDSKEL_API
112bool
115 TfSpan<const GfMatrix4f> inverseXforms,
116 TfSpan<GfMatrix4f> jointLocalXforms,
117 const GfMatrix4f* rootInverseXform=nullptr);
118
122USDSKEL_API
123bool
126 TfSpan<GfMatrix4d> jointLocalXforms,
127 const GfMatrix4d* rootInverseXform=nullptr);
128
129USDSKEL_API
130bool
133 TfSpan<GfMatrix4f> jointLocalXforms,
134 const GfMatrix4f* rootInverseXform=nullptr);
135
136
139USDSKEL_API
140bool
142 const VtMatrix4dArray& xforms,
143 const VtMatrix4dArray& inverseXforms,
144 VtMatrix4dArray* jointLocalXforms,
145 const GfMatrix4d* rootInverseXform=nullptr);
146
147
148
149
152USDSKEL_API
153bool
155 const VtMatrix4dArray& xforms,
156 VtMatrix4dArray* jointLocalXforms,
157 const GfMatrix4d* rootInverseXform=nullptr);
158
159
162USDSKEL_API
163bool
165 const GfMatrix4d* xforms,
166 const GfMatrix4d* inverseXforms,
167 GfMatrix4d* jointLocalXforms,
168 const GfMatrix4d* rootInverseXform=nullptr);
169
170
171
181USDSKEL_API
182bool
184 TfSpan<const GfMatrix4d> jointLocalXforms,
185 TfSpan<GfMatrix4d> xforms,
186 const GfMatrix4d* rootXform=nullptr);
187
188
190USDSKEL_API
191bool
193 TfSpan<const GfMatrix4f> jointLocalXforms,
194 TfSpan<GfMatrix4f> xforms,
195 const GfMatrix4f* rootXform=nullptr);
196
197
198
201USDSKEL_API
202bool
204 const VtMatrix4dArray& jointLocalXforms,
205 VtMatrix4dArray* xforms,
206 const GfMatrix4d* rootXform=nullptr);
207
208
211USDSKEL_API
212bool
214 const GfMatrix4d* jointLocalXforms,
215 GfMatrix4d* xforms,
216 const GfMatrix4d* rootXform=nullptr);
217
218
223template <typename Matrix4>
224USDSKEL_API
225bool
227 GfRange3f* extent,
228 float pad=0.0f,
229 const Matrix4* rootXform=nullptr);
230
231
232
235USDSKEL_API
236bool
237UsdSkelComputeJointsExtent(const VtMatrix4dArray& joints,
238 VtVec3fArray* extent,
239 float pad=0.0f,
240 const GfMatrix4d* rootXform=nullptr);
241
242
245USDSKEL_API
246bool
248 size_t numXforms,
249 VtVec3fArray* extent,
250 float pad=0.0f,
251 const GfMatrix4d* rootXform=nullptr);
252
253
255
256
261
262
265template <typename Matrix4>
266USDSKEL_API
267bool
268UsdSkelDecomposeTransform(const Matrix4& xform,
269 GfVec3f* translate,
270 GfRotation* rotate,
271 GfVec3h* scale);
272
274template <typename Matrix4>
275USDSKEL_API
276bool
277UsdSkelDecomposeTransform(const Matrix4& xform,
278 GfVec3f* translate,
279 GfQuatf* rotate,
280 GfVec3h* scale);
281
282
285USDSKEL_API
286bool
288 TfSpan<GfVec3f> translations,
289 TfSpan<GfQuatf> rotations,
290 TfSpan<GfVec3h> scales);
291
293USDSKEL_API
294bool
296 TfSpan<GfVec3f> translations,
297 TfSpan<GfQuatf> rotations,
298 TfSpan<GfVec3h> scales);
299
300
303USDSKEL_API
304bool
305UsdSkelDecomposeTransforms(const VtMatrix4dArray& xforms,
306 VtVec3fArray* translations,
307 VtQuatfArray* rotations,
308 VtVec3hArray* scales);
309
310
313USDSKEL_API
314bool
316 GfVec3f* translations,
317 GfQuatf* rotations,
318 GfVec3h* scales,
319 size_t count);
320
321
324template <typename Matrix4>
325USDSKEL_API
326void
328 const GfMatrix3f& rotate,
329 const GfVec3h& scale,
330 Matrix4* xform);
331
333template <typename Matrix4>
334USDSKEL_API
335void
337 const GfQuatf& rotate,
338 const GfVec3h& scale,
339 Matrix4* xform);
340
343USDSKEL_API
344bool
346 TfSpan<const GfQuatf> rotations,
348 TfSpan<GfMatrix4d> xforms);
349
350
352USDSKEL_API
353bool
355 TfSpan<const GfQuatf> rotations,
357 TfSpan<GfMatrix4f> xforms);
358
359
362USDSKEL_API
363bool
364UsdSkelMakeTransforms(const VtVec3fArray& translations,
365 const VtQuatfArray& rotations,
366 const VtVec3hArray& scales,
367 VtMatrix4dArray* xforms);
368
371USDSKEL_API
372bool
373UsdSkelMakeTransforms(const GfVec3f* translations,
374 const GfQuatf* rotations,
375 const GfVec3h* scales,
376 GfMatrix4d* xforms,
377 size_t count);
378
379
381
382
387
388
393USDSKEL_API
394bool
395UsdSkelNormalizeWeights(TfSpan<float> weights, int numInfluencesPerComponent,
396 float eps = std::numeric_limits<float>::epsilon());
397
398
401USDSKEL_API
402bool
403UsdSkelNormalizeWeights(VtFloatArray* weights, int numInfluencesPerComponent);
404
405
407USDSKEL_API
408bool
410 int numInfluencesPerComponent);
411
414USDSKEL_API
415bool
416UsdSkelSortInfluences(VtIntArray* indices, VtFloatArray* weights,
417 int numInfluencesPerComponent);
418
419
426USDSKEL_API
427bool
428UsdSkelExpandConstantInfluencesToVarying(VtIntArray* indices, size_t size);
429
431USDSKEL_API
432bool
433UsdSkelExpandConstantInfluencesToVarying(VtFloatArray* weights, size_t size);
434
441USDSKEL_API
442bool
443UsdSkelResizeInfluences(VtIntArray* indices,
444 int srcNumInfluencesPerComponent,
445 int newNumInfluencesPerComponent);
446
448USDSKEL_API
449bool
450UsdSkelResizeInfluences(VtFloatArray* weights,
451 int srcNumInfluencesPerComponent,
452 int newNumInfluencesPerComponent);
453
456USDSKEL_API
457bool
459 const TfSpan<const float>& weights,
460 TfSpan<GfVec2f> interleavedInfluences);
461
462
464
465
469
470
477USDSKEL_API
478bool
479UsdSkelSkinPoints(const TfToken& skinningMethod,
480 const GfMatrix4d& geomBindTransform,
481 TfSpan<const GfMatrix4d> jointXforms,
482 TfSpan<const int> jointIndices,
483 TfSpan<const float> jointWeights,
484 int numInfluencesPerPoint,
485 TfSpan<GfVec3f> points,
486 bool inSerial=false);
487
488
490USDSKEL_API
491bool
492UsdSkelSkinPoints(const TfToken& skinningMethod,
493 const GfMatrix4f& geomBindTransform,
494 TfSpan<const GfMatrix4f> jointXforms,
495 TfSpan<const int> jointIndices,
496 TfSpan<const float> jointWeights,
497 int numInfluencesPerPoint,
498 TfSpan<GfVec3f> points,
499 bool inSerial=false);
500
501
503USDSKEL_API
504bool
505UsdSkelSkinPoints(const TfToken& skinningMethod,
506 const GfMatrix4d& geomBindTransform,
507 TfSpan<const GfMatrix4d> jointXforms,
508 TfSpan<const GfVec2f> influences,
509 int numInfluencesPerPoint,
510 TfSpan<GfVec3f> points,
511 bool inSerial=false);
512
513
515USDSKEL_API
516bool
517UsdSkelSkinPoints(const TfToken& skinningMethod,
518 const GfMatrix4f& geomBindTransform,
519 TfSpan<const GfMatrix4f> jointXforms,
520 TfSpan<const GfVec2f> influences,
521 int numInfluencesPerPoint,
522 TfSpan<GfVec3f> points,
523 bool inSerial=false);
524
525
528USDSKEL_API
529bool
530UsdSkelSkinPoints(const TfToken& skinningMethod,
531 const GfMatrix4d& geomBindTransform,
532 const VtMatrix4dArray& jointXforms,
533 const VtIntArray& jointIndices,
534 const VtFloatArray& jointWeights,
535 int numInfluencesPerPoint,
536 VtVec3fArray* points);
537
538
541USDSKEL_API
542bool
543UsdSkelSkinPoints(const TfToken& skinningMethod,
544 const GfMatrix4d& geomBindTransform,
545 const GfMatrix4d* jointXforms,
546 size_t numJoints,
547 const int* jointIndices,
548 const float* jointWeights,
549 size_t numInfluences,
550 int numInfluencesPerPoint,
551 GfVec3f* points,
552 size_t numPoints,
553 bool inSerial=false);
554
555
556USDSKEL_API
557bool
558UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
559 TfSpan<const GfMatrix4d> jointXforms,
560 TfSpan<const int> jointIndices,
561 TfSpan<const float> jointWeights,
562 int numInfluencesPerPoint,
563 TfSpan<GfVec3f> points,
564 bool inSerial=false);
565
567USDSKEL_API
568bool
569UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
570 TfSpan<const GfMatrix4f> jointXforms,
571 TfSpan<const int> jointIndices,
572 TfSpan<const float> jointWeights,
573 int numInfluencesPerPoint,
574 TfSpan<GfVec3f> points,
575 bool inSerial=false);
576
577
579USDSKEL_API
580bool
581UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
582 TfSpan<const GfMatrix4d> jointXforms,
583 TfSpan<const GfVec2f> influences,
584 int numInfluencesPerPoint,
585 TfSpan<GfVec3f> points,
586 bool inSerial=false);
587
589USDSKEL_API
590bool
591UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
592 TfSpan<const GfMatrix4f> jointXforms,
593 TfSpan<const GfVec2f> influences,
594 int numInfluencesPerPoint,
595 TfSpan<GfVec3f> points,
596 bool inSerial=false);
597
598
601USDSKEL_API
602bool
603UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
604 const VtMatrix4dArray& jointXforms,
605 const VtIntArray& jointIndices,
606 const VtFloatArray& jointWeights,
607 int numInfluencesPerPoint,
608 VtVec3fArray* points);
609
610
613USDSKEL_API
614bool
615UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
616 const GfMatrix4d* jointXforms,
617 size_t numJoints,
618 const int* jointIndices,
619 const float* jointWeights,
620 size_t numInfluences,
621 int numInfluencesPerPoint,
622 GfVec3f* points,
623 size_t numPoints,
624 bool inSerial=false);
625
626
637USDSKEL_API
638bool
639UsdSkelSkinNormals(const TfToken& skinningMethod,
640 const GfMatrix3d& geomBindTransform,
641 TfSpan<const GfMatrix3d> jointXforms,
642 TfSpan<const int> jointIndices,
643 TfSpan<const float> jointWeights,
644 int numInfluencesPerPoint,
645 TfSpan<GfVec3f> normals,
646 bool inSerial=false);
647
648
650USDSKEL_API
651bool
652UsdSkelSkinNormals(const TfToken& skinningMethod,
653 const GfMatrix3f& geomBindTransform,
654 TfSpan<const GfMatrix3f> jointXforms,
655 TfSpan<const int> jointIndices,
656 TfSpan<const float> jointWeights,
657 int numInfluencesPerPoint,
658 TfSpan<GfVec3f> normals,
659 bool inSerial=false);
660
661
663USDSKEL_API
664bool
665UsdSkelSkinNormals(const TfToken& skinningMethod,
666 const GfMatrix3d& geomBindTransform,
667 TfSpan<const GfMatrix3d> jointXforms,
668 TfSpan<const GfVec2f> influences,
669 int numInfluencesPerPoint,
670 TfSpan<GfVec3f> normals,
671 bool inSerial=false);
672
673
675USDSKEL_API
676bool
677UsdSkelSkinNormals(const TfToken& skinningMethod,
678 const GfMatrix3f& geomBindTransform,
679 TfSpan<const GfMatrix3f> jointXforms,
680 TfSpan<const GfVec2f> influences,
681 int numInfluencesPerPoint,
682 TfSpan<GfVec3f> normals,
683 bool inSerial=false);
684
685
687USDSKEL_API
688bool
690 const GfMatrix3d& geomBindTransform,
691 TfSpan<const GfMatrix3d> jointXforms,
692 TfSpan<const int> jointIndices,
693 TfSpan<const float> jointWeights,
694 int numInfluencesPerPoint,
695 TfSpan<const int> faceVertexIndices,
696 TfSpan<GfVec3f> normals,
697 bool inSerial=false);
698
700USDSKEL_API
701bool
703 const GfMatrix3f& geomBindTransform,
704 TfSpan<const GfMatrix3f> jointXforms,
705 TfSpan<const int> jointIndices,
706 TfSpan<const float> jointWeights,
707 int numInfluencesPerPoint,
708 TfSpan<const int> faceVertexIndices,
709 TfSpan<GfVec3f> normals,
710 bool inSerial=false);
711
712
713USDSKEL_API
714bool
715UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
716 TfSpan<const GfMatrix3d> jointXforms,
717 TfSpan<const int> jointIndices,
718 TfSpan<const float> jointWeights,
719 int numInfluencesPerPoint,
720 TfSpan<GfVec3f> normals,
721 bool inSerial=false);
722
723
725USDSKEL_API
726bool
727UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
728 TfSpan<const GfMatrix3f> jointXforms,
729 TfSpan<const int> jointIndices,
730 TfSpan<const float> jointWeights,
731 int numInfluencesPerPoint,
732 TfSpan<GfVec3f> normals,
733 bool inSerial=false);
734
735
737USDSKEL_API
738bool
739UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
740 TfSpan<const GfMatrix3d> jointXforms,
741 TfSpan<const GfVec2f> influences,
742 int numInfluencesPerPoint,
743 TfSpan<GfVec3f> normals,
744 bool inSerial=false);
745
746
748USDSKEL_API
749bool
750UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
751 TfSpan<const GfMatrix3f> jointXforms,
752 TfSpan<const GfVec2f> influences,
753 int numInfluencesPerPoint,
754 TfSpan<GfVec3f> normals,
755 bool inSerial=false);
756
758USDSKEL_API
759bool
761 TfSpan<const GfMatrix3d> jointXforms,
762 TfSpan<const int> jointIndices,
763 TfSpan<const float> jointWeights,
764 int numInfluencesPerPoint,
765 TfSpan<const int> faceVertexIndices,
766 TfSpan<GfVec3f> normals,
767 bool inSerial=false);
768
770USDSKEL_API
771bool
773 TfSpan<const GfMatrix3f> jointXforms,
774 TfSpan<const int> jointIndices,
775 TfSpan<const float> jointWeights,
776 int numInfluencesPerPoint,
777 TfSpan<const int> faceVertexIndices,
778 TfSpan<GfVec3f> normals,
779 bool inSerial=false);
780
781
787USDSKEL_API
788bool
789UsdSkelSkinTransform(const TfToken& skinningMethod,
790 const GfMatrix4d& geomBindTransform,
791 TfSpan<const GfMatrix4d> jointXforms,
792 TfSpan<const int> jointIndices,
793 TfSpan<const float> jointWeights,
794 GfMatrix4d* xform);
795
797USDSKEL_API
798bool
799UsdSkelSkinTransform(const TfToken& skinningMethod,
800 const GfMatrix4f& geomBindTransform,
801 TfSpan<const GfMatrix4f> jointXforms,
802 TfSpan<const int> jointIndices,
803 TfSpan<const float> jointWeights,
804 GfMatrix4f* xform);
805
808USDSKEL_API
809bool
810UsdSkelSkinTransform(const TfToken& skinningMethod,
811 const GfMatrix4d& geomBindTransform,
812 TfSpan<const GfMatrix4d> jointXforms,
813 TfSpan<const GfVec2f> influences,
814 GfMatrix4d* xform);
815
817USDSKEL_API
818bool
819UsdSkelSkinTransform(const TfToken& skinningMethod,
820 const GfMatrix4f& geomBindTransform,
821 TfSpan<const GfMatrix4f> jointXforms,
822 TfSpan<const GfVec2f> influences,
823 GfMatrix4f* xform);
824
827USDSKEL_API
828bool
829UsdSkelSkinTransform(const TfToken& skinningMethod,
830 const GfMatrix4d& geomBindTransform,
831 const GfMatrix4d* jointXforms,
832 size_t numJoints,
833 const int* jointIndices,
834 const float* jointWeights,
835 size_t numInfluences,
836 GfMatrix4d* xform);
837
838
839USDSKEL_API
840bool
841UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
842 TfSpan<const GfMatrix4d> jointXforms,
843 TfSpan<const int> jointIndices,
844 TfSpan<const float> jointWeights,
845 GfMatrix4d* xform);
846
848USDSKEL_API
849bool
850UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
851 TfSpan<const GfMatrix4f> jointXforms,
852 TfSpan<const int> jointIndices,
853 TfSpan<const float> jointWeights,
854 GfMatrix4f* xform);
855
858USDSKEL_API
859bool
860UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
861 TfSpan<const GfMatrix4d> jointXforms,
862 TfSpan<const GfVec2f> influences,
863 GfMatrix4d* xform);
864
866USDSKEL_API
867bool
868UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
869 TfSpan<const GfMatrix4f> jointXforms,
870 TfSpan<const GfVec2f> influences,
871 GfMatrix4f* xform);
872
875USDSKEL_API
876bool
877UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
878 const GfMatrix4d* jointXforms,
879 size_t numJoints,
880 const int* jointIndices,
881 const float* jointWeights,
882 size_t numInfluences,
883 GfMatrix4d* xform);
884
885
891USDSKEL_API
892bool
893UsdSkelApplyBlendShape(const float weight,
894 const TfSpan<const GfVec3f> offsets,
895 const TfSpan<const int> indices,
896 TfSpan<GfVec3f> points);
897
898
899PXR_NAMESPACE_CLOSE_SCOPE
900
901
902#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:82
Stores a 3x3 matrix of float elements.
Definition: matrix3f.h:82
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Stores a 4x4 matrix of float elements.
Definition: matrix4f.h:88
Basic type: a quaternion, a complex number with a real coefficient and three imaginary coefficients,...
Definition: quatf.h:60
Basic type: 3-dimensional floating point range.
Definition: range3f.h:64
Basic type: 3-space rotation specification.
Definition: rotation.h:54
Basic type for a vector of 3 float components.
Definition: vec3f.h:63
Basic type for a vector of 3 GfHalf components.
Definition: vec3h.h:64
Represents a range of contiguous elements.
Definition: span.h:88
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:134
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
Definition: primRange.h:119
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
Boundable prim type used to identify a scope beneath which skeletally-posed primitives are defined.
Definition: root.h:64
Object holding information describing skeleton topology.
Definition: topology.h:46
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.