HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
27 /// \file usdSkel/utils.h
28 ///
29 /// Collection of utility methods.
30 ///
31 
32 #include "pxr/pxr.h"
33 #include "pxr/usd/usdSkel/api.h"
34 
35 #include "pxr/base/gf/quatf.h"
36 #include "pxr/base/gf/matrix3d.h"
37 #include "pxr/base/gf/matrix3f.h"
38 #include "pxr/base/gf/matrix4d.h"
39 #include "pxr/base/gf/matrix4f.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.
52 
53 
55 
56 
57 class GfMatrix3f;
58 class GfRange3f;
59 class GfRotation;
60 class UsdPrim;
61 class UsdPrimRange;
62 class UsdRelationship;
63 class UsdSkelRoot;
64 class UsdSkelTopology;
65 
66 
67 /// \defgroup UsdSkel_Utils Utilities
68 /// @{
69 
70 
71 /// Returns true if \p prim is a valid skel animation source.
73 bool
75 
76 
77 /// Returns true if \p prim is considered to be a skinnable primitive.
78 /// Whether or not the prim is actually skinned additionally depends on whether
79 /// or not the prim has a bound skeleton, and prop joint influences.
81 bool
82 UsdSkelIsSkinnablePrim(const UsdPrim& prim);
83 
84 
85 /// \defgroup UsdSkel_JointTransformUtils Joint Transform Utilities
86 /// Utilities for working with vectorized joint transforms.
87 /// @{
88 
89 
90 /// Compute joint transforms in joint-local space.
91 /// Transforms are computed from \p xforms, holding concatenated
92 /// joint transforms, and \p inverseXforms, providing the inverse
93 /// of each of those transforms. The resulting local space transforms
94 /// are written to \p jointLocalXforms, which must be the same size
95 /// as \p topology.
96 /// If the root joints include an additional, external transformation
97 /// -- eg., such as the skel local-to-world transformation -- then the
98 /// inverse of that transform should be passed as \p rootInverseXform.
99 /// If no \p rootInverseXform is provided, then \p xform and \p inverseXforms
100 /// should be based on joint transforms computed in skeleton space.
101 /// Each transform array must be sized to the number of joints from \p topology.
103 bool
106  TfSpan<const GfMatrix4d> inverseXforms,
107  TfSpan<GfMatrix4d> jointLocalXforms,
108  const GfMatrix4d* rootInverseXform=nullptr);
109 
110 /// \overload
112 bool
115  TfSpan<const GfMatrix4f> inverseXforms,
116  TfSpan<GfMatrix4f> jointLocalXforms,
117  const GfMatrix4f* rootInverseXform=nullptr);
118 
119 /// Compute joint transforms in joint-local space.
120 /// This is a convenience overload, which computes the required inverse
121 /// transforms internally.
123 bool
126  TfSpan<GfMatrix4d> jointLocalXforms,
127  const GfMatrix4d* rootInverseXform=nullptr);
128 
130 bool
133  TfSpan<GfMatrix4f> jointLocalXforms,
134  const GfMatrix4f* rootInverseXform=nullptr);
135 
136 
137 /// \overload
138 /// \deprecated Use form that takes TfSpan arguments.
140 bool
142  const VtMatrix4dArray& xforms,
143  const VtMatrix4dArray& inverseXforms,
144  VtMatrix4dArray* jointLocalXforms,
145  const GfMatrix4d* rootInverseXform=nullptr);
146 
147 
148 
149 
150 /// \overload
151 /// \deprecated Use form that takes TfSpan arguments.
153 bool
155  const VtMatrix4dArray& xforms,
156  VtMatrix4dArray* jointLocalXforms,
157  const GfMatrix4d* rootInverseXform=nullptr);
158 
159 
160 /// \overload
161 /// \deprecated Use form that takes TfSpan arguments.
163 bool
165  const GfMatrix4d* xforms,
166  const GfMatrix4d* inverseXforms,
167  GfMatrix4d* jointLocalXforms,
168  const GfMatrix4d* rootInverseXform=nullptr);
169 
170 
171 
172 /// Compute concatenated joint transforms.
173 /// This concatenates transforms from \p jointLocalXforms, providing joint
174 /// transforms in joint-local space. The resulting transforms are written to
175 /// \p jointLocalXforms, which must be the same size as \p topology.
176 /// If \p rootXform is not provided, or is the identity, the resulting joint
177 /// transforms will be given in skeleton space. Any additional transformations
178 /// may be provided on \p rootXform if an additional level of transformation
179 /// -- such as the skel local to world transform -- are desired.
180 /// Each transform array must be sized to the number of joints from \p topology.
182 bool
184  TfSpan<const GfMatrix4d> jointLocalXforms,
185  TfSpan<GfMatrix4d> xforms,
186  const GfMatrix4d* rootXform=nullptr);
187 
188 
189 /// \overload
191 bool
193  TfSpan<const GfMatrix4f> jointLocalXforms,
194  TfSpan<GfMatrix4f> xforms,
195  const GfMatrix4f* rootXform=nullptr);
196 
197 
198 
199 /// \overload
200 /// \deprecated Use the function form that takes TfSpan arguments.
202 bool
204  const VtMatrix4dArray& jointLocalXforms,
205  VtMatrix4dArray* xforms,
206  const GfMatrix4d* rootXform=nullptr);
207 
208 
209 /// \overload
210 /// \deprecated Use the form that takes a TfSpan argument.
212 bool
214  const GfMatrix4d* jointLocalXforms,
215  GfMatrix4d* xforms,
216  const GfMatrix4d* rootXform=nullptr);
217 
218 
219 /// Compute an extent from a set of skel-space joint transform.
220 /// The \p rootXform may also be set to provide an additional root
221 /// transformation on top of all joints, which is useful for computing
222 /// extent relative to a different space.
223 template <typename Matrix4>
225 bool
227  GfRange3f* extent,
228  float pad=0.0f,
229  const Matrix4* rootXform=nullptr);
230 
231 
232 
233 /// \overload
234 /// \deprecated Use form that takes a TfSpan.
236 bool
237 UsdSkelComputeJointsExtent(const VtMatrix4dArray& joints,
238  VtVec3fArray* extent,
239  float pad=0.0f,
240  const GfMatrix4d* rootXform=nullptr);
241 
242 
243 /// \overload
244 /// \deprecated Use form that takes a TfSpan.
246 bool
248  size_t numXforms,
249  VtVec3fArray* extent,
250  float pad=0.0f,
251  const GfMatrix4d* rootXform=nullptr);
252 
253 
254 /// @}
255 
256 
257 /// \defgroup UsdSkel_TransformCompositionUtils Transform Composition Utils
258 /// Utiltiies for converting transforms to and from component (translate,
259 /// rotate, scale) form.
260 /// @{
261 
262 
263 /// Decompose a transform into translate/rotate/scale components.
264 /// The transform order for decomposition is scale, rotate, translate.
265 template <typename Matrix4>
267 bool
268 UsdSkelDecomposeTransform(const Matrix4& xform,
269  GfVec3f* translate,
271  GfVec3h* scale);
272 
273 /// \overload
274 template <typename Matrix4>
276 bool
277 UsdSkelDecomposeTransform(const Matrix4& xform,
278  GfVec3f* translate,
279  GfQuatf* rotate,
280  GfVec3h* scale);
281 
282 
283 /// Decompose an array of transforms into translate/rotate/scale components.
284 /// All spans must be the same size.
286 bool
288  TfSpan<GfVec3f> translations,
289  TfSpan<GfQuatf> rotations,
290  TfSpan<GfVec3h> scales);
291 
292 /// \overload
294 bool
296  TfSpan<GfVec3f> translations,
297  TfSpan<GfQuatf> rotations,
298  TfSpan<GfVec3h> scales);
299 
300 
301 /// \overload
302 /// \deprecated Use form that takes TfSpan arguments.
304 bool
305 UsdSkelDecomposeTransforms(const VtMatrix4dArray& xforms,
306  VtVec3fArray* translations,
307  VtQuatfArray* rotations,
308  VtVec3hArray* scales);
309 
310 
311 /// \overload
312 /// \deprecated Use form that takes TfSpan arguments.
314 bool
316  GfVec3f* translations,
317  GfQuatf* rotations,
318  GfVec3h* scales,
319  size_t count);
320 
321 
322 /// Create a transform from translate/rotate/scale components.
323 /// This performs the inverse of UsdSkelDecomposeTransform.
324 template <typename Matrix4>
326 void
328  const GfMatrix3f& rotate,
329  const GfVec3h& scale,
330  Matrix4* xform);
331 
332 /// \overload
333 template <typename Matrix4>
335 void
337  const GfQuatf& rotate,
338  const GfVec3h& scale,
339  Matrix4* xform);
340 
341 /// Create transforms from arrays of components.
342 /// All spans must be the same size.
344 bool
346  TfSpan<const GfQuatf> rotations,
347  TfSpan<const GfVec3h> scales,
348  TfSpan<GfMatrix4d> xforms);
349 
350 
351 /// \overload
353 bool
355  TfSpan<const GfQuatf> rotations,
356  TfSpan<const GfVec3h> scales,
357  TfSpan<GfMatrix4f> xforms);
358 
359 
360 /// \overload
361 /// \deprecated Use form that takes TfSpan arguments.
363 bool
364 UsdSkelMakeTransforms(const VtVec3fArray& translations,
365  const VtQuatfArray& rotations,
366  const VtVec3hArray& scales,
367  VtMatrix4dArray* xforms);
368 
369 /// \overload
370 /// \deprecated Use form that takes TfSpan arguments.
372 bool
373 UsdSkelMakeTransforms(const GfVec3f* translations,
374  const GfQuatf* rotations,
375  const GfVec3h* scales,
376  GfMatrix4d* xforms,
377  size_t count);
378 
379 
380 /// @}
381 
382 
383 /// \defgroup UsdSkel_JointInfluenceUtils Joint Influence Utils
384 /// Collection of methods for working \ref UsdSkel_Terminology_JointInfluences
385 /// "joint influences", as stored through UsdSkelBindingAPI.`
386 /// @{
387 
388 
389 /// Helper method to normalize weight values across each consecutive run of
390 /// \p numInfluencesPerComponent elements.
391 /// If the total weight for a run of elements is smaller than \p eps, the
392 /// elements' weights are set to zero.
394 bool
395 UsdSkelNormalizeWeights(TfSpan<float> weights, int numInfluencesPerComponent,
396  float eps = std::numeric_limits<float>::epsilon());
397 
398 
399 /// \overload
400 /// \deprecated Use form that takes a TfSpan.
402 bool
403 UsdSkelNormalizeWeights(VtFloatArray* weights, int numInfluencesPerComponent);
404 
405 
406 /// Sort joint influences such that highest weight values come first.
408 bool
410  int numInfluencesPerComponent);
411 
412 /// \overload
413 /// \deprecated Use form that takes TfSpan arguments.
415 bool
416 UsdSkelSortInfluences(VtIntArray* indices, VtFloatArray* weights,
417  int numInfluencesPerComponent);
418 
419 
420 /// Convert an array of constant influences (joint weights or indices)
421 /// to an array of varying influences.
422 /// The \p size should match the size of required for 'vertex' interpolation
423 /// on the type geometry primitive. Typically, this is the number of points.
424 /// This is a convenience function for clients that don't understand
425 /// constant (rigid) weighting.
427 bool
429 
430 /// \overload
432 bool
433 UsdSkelExpandConstantInfluencesToVarying(VtFloatArray* weights, size_t size);
434 
435 /// Resize the number of influences per component in a weight or indices array,
436 /// which initially has \p srcNumInfluencesPerComponent influences to have
437 /// no more than \p newNumInfluencesPerComponent influences per component.
438 /// If the size decreases, influences are additionally re-normalized.
439 /// This is a convenience method for clients that require a fixed number of
440 /// of influences.
442 bool
443 UsdSkelResizeInfluences(VtIntArray* indices,
444  int srcNumInfluencesPerComponent,
445  int newNumInfluencesPerComponent);
446 
447 /// \overload
449 bool
450 UsdSkelResizeInfluences(VtFloatArray* weights,
451  int srcNumInfluencesPerComponent,
452  int newNumInfluencesPerComponent);
453 
454 /// Combine arrays of joint indices and weights into interleaved
455 /// (index,weight) vectors.
457 bool
459  const TfSpan<const float>& weights,
460  TfSpan<GfVec2f> interleavedInfluences);
461 
462 
463 /// @}
464 
465 
466 /// \defgroup UsdSkel_SkinningUtils Skinning Implementations
467 /// Reference skinning implementations for skinning points and transforms.
468 /// @{
469 
470 
471 /// Skin points using linear blend skinning (LBS).
472 /// The \p jointXforms are \ref UsdSkel_Term_SkinningTransforms
473 /// "skinning transforms", given in _skeleton space_, while the
474 /// \p geomBindTransform provides the transform that transforms the initial
475 /// \p points into the same _skeleton space_ that the skinning transforms
476 /// were computed in.
478 bool
479 UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
480  TfSpan<const GfMatrix4d> jointXforms,
481  TfSpan<const int> jointIndices,
482  TfSpan<const float> jointWeights,
483  int numInfluencesPerPoint,
485  bool inSerial=false);
486 
487 /// \overload
489 bool
490 UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
491  TfSpan<const GfMatrix4f> jointXforms,
492  TfSpan<const int> jointIndices,
493  TfSpan<const float> jointWeights,
494  int numInfluencesPerPoint,
496  bool inSerial=false);
497 
498 
499 /// Skin points using linear blend skinning, with interleaved influences.
501 bool
502 UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
503  TfSpan<const GfMatrix4d> jointXforms,
504  TfSpan<const GfVec2f> influences,
505  int numInfluencesPerPoint,
507  bool inSerial=false);
508 
509 /// \overload
511 bool
512 UsdSkelSkinPointsLBS(const GfMatrix4f& geomBindTransform,
513  TfSpan<const GfMatrix4f> jointXforms,
514  TfSpan<const GfVec2f> influences,
515  int numInfluencesPerPoint,
517  bool inSerial=false);
518 
519 
520 /// \overload
521 /// \deprecated Use form that takes TfSpan arguments.
523 bool
524 UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
525  const VtMatrix4dArray& jointXforms,
526  const VtIntArray& jointIndices,
527  const VtFloatArray& jointWeights,
528  int numInfluencesPerPoint,
529  VtVec3fArray* points);
530 
531 
532 /// \overload
533 /// \deprecated Use form that takes TfSpan arguments.
535 bool
536 UsdSkelSkinPointsLBS(const GfMatrix4d& geomBindTransform,
537  const GfMatrix4d* jointXforms,
538  size_t numJoints,
539  const int* jointIndices,
540  const float* jointWeights,
541  size_t numInfluences,
542  int numInfluencesPerPoint,
543  GfVec3f* points,
544  size_t numPoints,
545  bool inSerial=false);
546 
547 
548 /// Skin normals using linear blend skinning (LBS), for normals with _vertex_
549 /// or _varying_ interpolation.
550 /// Use UsdSkelSkinFaceVaryingNormalsLBS() for normals with _faceVarying__
551 /// interpolation.
552 /// The \p jointXforms are the *inverse transposes* of the 3x3 component
553 /// of the \ref UsdSkel_Term_SkinningTransforms" "skinning transforms",
554 /// given in _skeleton space_. The \p geomBindTransform is the
555 /// *inverse transpose* of the matrix that transforms points from a
556 /// bind pose ino the same _skeleton space_ that the skinning tranforms
557 /// were computed in.
559 bool
560 UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
561  TfSpan<const GfMatrix3d> jointXforms,
562  TfSpan<const int> jointIndices,
563  TfSpan<const float> jointWeights,
564  int numInfluencesPerPoint,
565  TfSpan<GfVec3f> normals,
566  bool inSerial=false);
567 
568 
569 /// \overload
571 bool
572 UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
573  TfSpan<const GfMatrix3f> jointXforms,
574  TfSpan<const int> jointIndices,
575  TfSpan<const float> jointWeights,
576  int numInfluencesPerPoint,
577  TfSpan<GfVec3f> normals,
578  bool inSerial=false);
579 
580 
581 /// \overload
583 bool
584 UsdSkelSkinNormalsLBS(const GfMatrix3d& geomBindTransform,
585  TfSpan<const GfMatrix3d> jointXforms,
586  TfSpan<const GfVec2f> influences,
587  int numInfluencesPerPoint,
588  TfSpan<GfVec3f> normals,
589  bool inSerial=false);
590 
591 
592 /// \overload
594 bool
595 UsdSkelSkinNormalsLBS(const GfMatrix3f& geomBindTransform,
596  TfSpan<const GfMatrix3f> jointXforms,
597  TfSpan<const GfVec2f> influences,
598  int numInfluencesPerPoint,
599  TfSpan<GfVec3f> normals,
600  bool inSerial=false);
601 
602 /// Skin normals with _faceVarying_ interpolation using linear blend skinning.
604 bool
605 UsdSkelSkinFaceVaryingNormalsLBS(const GfMatrix3d& geomBindTransform,
606  TfSpan<const GfMatrix3d> jointXforms,
607  TfSpan<const int> jointIndices,
608  TfSpan<const float> jointWeights,
609  int numInfluencesPerPoint,
610  TfSpan<const int> faceVertexIndices,
611  TfSpan<GfVec3f> normals,
612  bool inSerial=false);
613 
614 /// \overload
616 bool
617 UsdSkelSkinFaceVaryingNormalsLBS(const GfMatrix3f& geomBindTransform,
618  TfSpan<const GfMatrix3f> jointXforms,
619  TfSpan<const int> jointIndices,
620  TfSpan<const float> jointWeights,
621  int numInfluencesPerPoint,
622  TfSpan<const int> faceVertexIndices,
623  TfSpan<GfVec3f> normals,
624  bool inSerial=false);
625 
626 
627 /// Skin a transform using linear blend skinning (LBS).
628 /// The \p jointXforms are \ref UsdSkel_Term_SkinningTransforms
629 /// "skinning transforms", given in _skeleton space_, while the
630 /// \p geomBindTransform provides the transform that initially places
631 /// a primitive in that same _skeleton space_.
633 bool
634 UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
635  TfSpan<const GfMatrix4d> jointXforms,
636  TfSpan<const int> jointIndices,
637  TfSpan<const float> jointWeights,
638  GfMatrix4d* xform);
639 
640 /// \overload
642 bool
643 UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
644  TfSpan<const GfMatrix4f> jointXforms,
645  TfSpan<const int> jointIndices,
646  TfSpan<const float> jointWeights,
647  GfMatrix4f* xform);
648 
649 /// Overload taking interleaved joint influences.
650 /// \overload
652 bool
653 UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
654  TfSpan<const GfMatrix4d> jointXforms,
655  TfSpan<const GfVec2f> influences,
656  GfMatrix4d* xform);
657 
658 /// \overload
660 bool
661 UsdSkelSkinTransformLBS(const GfMatrix4f& geomBindTransform,
662  TfSpan<const GfMatrix4f> jointXforms,
663  TfSpan<const GfVec2f> influences,
664  GfMatrix4f* xform);
665 
666 /// \overload
667 /// \deprecated Use form that takes TfSpan arguments.
669 bool
670 UsdSkelSkinTransformLBS(const GfMatrix4d& geomBindTransform,
671  const GfMatrix4d* jointXforms,
672  size_t numJoints,
673  const int* jointIndices,
674  const float* jointWeights,
675  size_t numInfluences,
676  GfMatrix4d* xform);
677 
678 
679 /// Apply a single blend shape to \p points.
680 /// The shape is given as a span of \p offsets. If the \p indices span is not
681 /// empty, it provides the index into the \p points span at which each offset
682 /// should be mapped. Otherwise, the \p offsets span must be the same size as
683 /// the \p points span.
685 bool
686 UsdSkelApplyBlendShape(const float weight,
690 
691 
693 
694 
695 #endif // PXR_USD_USD_SKEL_UTILS_H
USDSKEL_API bool UsdSkelComputeJointLocalTransforms(const UsdSkelTopology &topology, TfSpan< const GfMatrix4d > xforms, TfSpan< const GfMatrix4d > inverseXforms, TfSpan< GfMatrix4d > jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
GLint GLenum GLsizei GLsizei GLsizei GLsizei extent
Definition: glew.h:15877
USDSKEL_API bool UsdSkelInterleaveInfluences(const TfSpan< const int > &indices, const TfSpan< const float > &weights, TfSpan< GfVec2f > interleavedInfluences)
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:14163
GLuint GLsizei const GLuint const GLintptr * offsets
Definition: glcorearb.h:2621
USDSKEL_API bool UsdSkelDecomposeTransforms(TfSpan< const GfMatrix4d > xforms, TfSpan< GfVec3f > translations, TfSpan< GfQuatf > rotations, TfSpan< GfVec3h > scales)
Definition: vec3f.h:63
USDSKEL_API bool UsdSkelConcatJointTransforms(const UsdSkelTopology &topology, TfSpan< const GfMatrix4d > jointLocalXforms, TfSpan< GfMatrix4d > xforms, const GfMatrix4d *rootXform=nullptr)
USDSKEL_API bool UsdSkelIsSkinnablePrim(const UsdPrim &prim)
Definition: quatf.h:60
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)
GLuint GLuint GLfloat weight
Definition: glew.h:13892
void pad(T &out, int n)
Definition: ImfXdr.h:490
USDSKEL_API bool UsdSkelResizeInfluences(VtIntArray *indices, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
GLsizeiptr size
Definition: glcorearb.h:664
USDSKEL_API void UsdSkelMakeTransform(const GfVec3f &translate, const GfMatrix3f &rotate, const GfVec3h &scale, Matrix4 *xform)
Definition: span.h:87
GT_API const UT_StringHolder topology
GLsizei GLenum const void * indices
Definition: glcorearb.h:406
Definition: prim.h:132
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 UsdSkelDecomposeTransform(const Matrix4 &xform, GfVec3f *translate, GfRotation *rotate, GfVec3h *scale)
GLint GLsizei count
Definition: glcorearb.h:405
#define USDSKEL_API
Definition: api.h:40
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 UsdSkelComputeJointsExtent(TfSpan< const Matrix4 > joints, GfRange3f *extent, float pad=0.0f, const Matrix4 *rootXform=nullptr)
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
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
Definition: path.h:1394
USDSKEL_API bool UsdSkelSkinTransformLBS(const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4d *xform)
GLbyte * weights
Definition: glew.h:7581
USDSKEL_API bool UsdSkelMakeTransforms(TfSpan< const GfVec3f > translations, TfSpan< const GfQuatf > rotations, TfSpan< const GfVec3h > scales, TfSpan< GfMatrix4d > xforms)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
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)
GLfloat f
Definition: glcorearb.h:1926
PUGI__FN char_t * translate(char_t *buffer, const char_t *from, const char_t *to, size_t to_length)
Definition: pugixml.cpp:8352
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.
Definition: vec3h.h:64
USDSKEL_API bool UsdSkelNormalizeWeights(TfSpan< float > weights, int numInfluencesPerComponent, float eps=std::numeric_limits< float >::epsilon())