Loading...
Searching...
No Matches
utils.h File Reference

Collection of utility methods. More...

+ Include dependency graph for utils.h:

Go to the source code of this file.

Functions

USDSKEL_API bool UsdSkelIsSkelAnimationPrim (const UsdPrim &prim)
 Returns true if prim is a valid skel animation source.
 
USDSKEL_API bool UsdSkelIsSkinnablePrim (const UsdPrim &prim)
 Returns true if prim is considered to be a skinnable primitive.
 
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 UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, TfSpan< const GfMatrix4f > xforms, TfSpan< const GfMatrix4f > inverseXforms, TfSpan< GfMatrix4f > jointLocalXforms, const GfMatrix4f *rootInverseXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, TfSpan< const GfMatrix4d > xforms, TfSpan< GfMatrix4d > jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
 Compute joint transforms in joint-local space.
 
USDSKEL_API bool UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, TfSpan< const GfMatrix4f > xforms, TfSpan< GfMatrix4f > jointLocalXforms, const GfMatrix4f *rootInverseXform=nullptr)
 
USDSKEL_API bool UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, const VtMatrix4dArray &xforms, const VtMatrix4dArray &inverseXforms, VtMatrix4dArray *jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, const VtMatrix4dArray &xforms, VtMatrix4dArray *jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelComputeJointLocalTransforms (const UsdSkelTopology &topology, const GfMatrix4d *xforms, const GfMatrix4d *inverseXforms, GfMatrix4d *jointLocalXforms, const GfMatrix4d *rootInverseXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelConcatJointTransforms (const UsdSkelTopology &topology, TfSpan< const GfMatrix4f > jointLocalXforms, TfSpan< GfMatrix4f > xforms, const GfMatrix4f *rootXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelConcatJointTransforms (const UsdSkelTopology &topology, const VtMatrix4dArray &jointLocalXforms, VtMatrix4dArray *xforms, const GfMatrix4d *rootXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelConcatJointTransforms (const UsdSkelTopology &topology, const GfMatrix4d *jointLocalXforms, GfMatrix4d *xforms, const GfMatrix4d *rootXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Matrix4 >
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 UsdSkelComputeJointsExtent (const VtMatrix4dArray &joints, VtVec3fArray *extent, float pad=0.0f, const GfMatrix4d *rootXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelComputeJointsExtent (const GfMatrix4d *xforms, size_t numXforms, VtVec3fArray *extent, float pad=0.0f, const GfMatrix4d *rootXform=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Matrix4 >
USDSKEL_API bool UsdSkelDecomposeTransform (const Matrix4 &xform, GfVec3f *translate, GfRotation *rotate, GfVec3h *scale)
 Decompose a transform into translate/rotate/scale components.
 
template<typename Matrix4 >
USDSKEL_API bool UsdSkelDecomposeTransform (const Matrix4 &xform, GfVec3f *translate, GfQuatf *rotate, GfVec3h *scale)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelDecomposeTransforms (TfSpan< const GfMatrix4f > xforms, TfSpan< GfVec3f > translations, TfSpan< GfQuatf > rotations, TfSpan< GfVec3h > scales)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelDecomposeTransforms (const VtMatrix4dArray &xforms, VtVec3fArray *translations, VtQuatfArray *rotations, VtVec3hArray *scales)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelDecomposeTransforms (const GfMatrix4d *xforms, GfVec3f *translations, GfQuatf *rotations, GfVec3h *scales, size_t count)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename Matrix4 >
USDSKEL_API void UsdSkelMakeTransform (const GfVec3f &translate, const GfMatrix3f &rotate, const GfVec3h &scale, Matrix4 *xform)
 Create a transform from translate/rotate/scale components.
 
template<typename Matrix4 >
USDSKEL_API void UsdSkelMakeTransform (const GfVec3f &translate, const GfQuatf &rotate, const GfVec3h &scale, Matrix4 *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelMakeTransforms (TfSpan< const GfVec3f > translations, TfSpan< const GfQuatf > rotations, TfSpan< const GfVec3h > scales, TfSpan< GfMatrix4f > xforms)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelMakeTransforms (const VtVec3fArray &translations, const VtQuatfArray &rotations, const VtVec3hArray &scales, VtMatrix4dArray *xforms)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelMakeTransforms (const GfVec3f *translations, const GfQuatf *rotations, const GfVec3h *scales, GfMatrix4d *xforms, size_t count)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 elements.
 
USDSKEL_API bool UsdSkelNormalizeWeights (VtFloatArray *weights, int numInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSortInfluences (VtIntArray *indices, VtFloatArray *weights, int numInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelExpandConstantInfluencesToVarying (VtFloatArray *weights, size_t size)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 srcNumInfluencesPerComponent influences to have no more than newNumInfluencesPerComponent influences per component.
 
USDSKEL_API bool UsdSkelResizeInfluences (VtFloatArray *weights, int srcNumInfluencesPerComponent, int newNumInfluencesPerComponent)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 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 UsdSkelSkinPoints (const TfToken &skinningMethod, const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPoints (const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 Skin points using linear blend skinning, with interleaved influences.
 
USDSKEL_API bool UsdSkelSkinPoints (const TfToken &skinningMethod, const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPoints (const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, const VtMatrix4dArray &jointXforms, const VtIntArray &jointIndices, const VtFloatArray &jointWeights, int numInfluencesPerPoint, VtVec3fArray *points)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPoints (const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, const GfMatrix4d *jointXforms, size_t numJoints, const int *jointIndices, const float *jointWeights, size_t numInfluences, int numInfluencesPerPoint, GfVec3f *points, size_t numPoints, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSkinPointsLBS (const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPointsLBS (const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 Skin points using linear blend skinning, with interleaved influences.
 
USDSKEL_API bool UsdSkelSkinPointsLBS (const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > points, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPointsLBS (const GfMatrix4d &geomBindTransform, const VtMatrix4dArray &jointXforms, const VtIntArray &jointIndices, const VtFloatArray &jointWeights, int numInfluencesPerPoint, VtVec3fArray *points)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinPointsLBS (const GfMatrix4d &geomBindTransform, const GfMatrix4d *jointXforms, size_t numJoints, const int *jointIndices, const float *jointWeights, size_t numInfluences, int numInfluencesPerPoint, GfVec3f *points, size_t numPoints, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 vertex or varying interpolation.
 
USDSKEL_API bool UsdSkelSkinNormals (const TfToken &skinningMethod, const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinNormals (const TfToken &skinningMethod, const GfMatrix3d &geomBindTransform, TfSpan< const GfMatrix3d > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinNormals (const TfToken &skinningMethod, const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSkinFaceVaryingNormals (const TfToken &skinningMethod, const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< const int > faceVertexIndices, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSkinNormalsLBS (const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinNormalsLBS (const GfMatrix3d &geomBindTransform, TfSpan< const GfMatrix3d > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinNormalsLBS (const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const GfVec2f > influences, int numInfluencesPerPoint, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSkinFaceVaryingNormalsLBS (const GfMatrix3f &geomBindTransform, TfSpan< const GfMatrix3f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, int numInfluencesPerPoint, TfSpan< const int > faceVertexIndices, TfSpan< GfVec3f > normals, bool inSerial=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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 UsdSkelSkinTransform (const TfToken &skinningMethod, const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4f *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinTransform (const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const GfVec2f > influences, GfMatrix4d *xform)
 Overload taking interleaved joint influences.
 
USDSKEL_API bool UsdSkelSkinTransform (const TfToken &skinningMethod, const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const GfVec2f > influences, GfMatrix4f *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinTransform (const TfToken &skinningMethod, const GfMatrix4d &geomBindTransform, const GfMatrix4d *jointXforms, size_t numJoints, const int *jointIndices, const float *jointWeights, size_t numInfluences, GfMatrix4d *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinTransformLBS (const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4d *xform)
 
USDSKEL_API bool UsdSkelSkinTransformLBS (const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const int > jointIndices, TfSpan< const float > jointWeights, GfMatrix4f *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinTransformLBS (const GfMatrix4d &geomBindTransform, TfSpan< const GfMatrix4d > jointXforms, TfSpan< const GfVec2f > influences, GfMatrix4d *xform)
 Overload taking interleaved joint influences.
 
USDSKEL_API bool UsdSkelSkinTransformLBS (const GfMatrix4f &geomBindTransform, TfSpan< const GfMatrix4f > jointXforms, TfSpan< const GfVec2f > influences, GfMatrix4f *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USDSKEL_API bool UsdSkelSkinTransformLBS (const GfMatrix4d &geomBindTransform, const GfMatrix4d *jointXforms, size_t numJoints, const int *jointIndices, const float *jointWeights, size_t numInfluences, GfMatrix4d *xform)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
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.
 

Detailed Description

Collection of utility methods.

Definition in file utils.h.