24 #ifndef PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H
25 #define PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H
36 #include "pxr/base/vt/array.h"
58 bool IsValid()
const {
return bool(_prim); }
61 explicit operator bool()
const {
return IsValid(); }
116 VtFloatArray* subShapeWeights,
117 VtUIntArray* blendShapeIndices,
118 VtUIntArray* subShapeIndices)
const;
124 VtFloatArray* subShapeWeights)
const;
137 const std::vector<VtIntArray>& blendShapePointIndices,
138 const std::vector<VtVec3fArray>& subShapePointOffsets,
154 const std::vector<VtIntArray>& blendShapePointIndices,
155 const std::vector<VtVec3fArray>& subShapeNormalOffsets,
171 VtVec2iArray* ranges)
const;
180 _SubShape() =
default;
182 _SubShape(
unsigned blendShapeIndex,
int inbetweenIndex,
float weight)
183 : _blendShapeIndex(blendShapeIndex),
184 _inbetweenIndex(inbetweenIndex),
189 int GetInbetweenIndex()
const {
return _inbetweenIndex; }
191 bool IsInbetween()
const {
return _inbetweenIndex >= 0; }
192 bool IsNullShape()
const {
return _weight == 0.0f; }
193 bool IsPrimaryShape()
const {
return _weight == 1.0f; }
195 float GetWeight()
const {
return _weight; }
198 unsigned _blendShapeIndex = 0;
199 int _inbetweenIndex = 0;
203 struct _SubShapeCompareByWeight {
204 bool operator()(
const _SubShape& lhs,
const _SubShape& rhs)
const
205 {
return lhs.GetWeight() < rhs.GetWeight(); }
207 bool operator()(
float lhs,
const _SubShape& rhs)
const
208 {
return lhs < rhs.GetWeight(); }
213 size_t firstSubShape = 0;
214 size_t numSubShapes = 0;
218 std::vector<_SubShape> _subShapes;
219 std::vector<_BlendShape> _blendShapes;
220 std::vector<UsdSkelInbetweenShape> _inbetweens;
225 #endif // PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H
USDSKEL_API UsdSkelBlendShape GetBlendShape(size_t blendShapeIndex) const
Returns the blend shape corresponding to blendShapeIndex.
GLdouble GLdouble GLint GLint const GLdouble * points
USDSKEL_API bool ComputeDeformedNormals(const TfSpan< const float > subShapeWeights, const TfSpan< const unsigned > blendShapeIndices, const TfSpan< const unsigned > subShapeIndices, const std::vector< VtIntArray > &blendShapePointIndices, const std::vector< VtVec3fArray > &subShapeNormalOffsets, TfSpan< GfVec3f > noramls) const
GLsizei const GLchar *const * string
USDSKEL_API bool ComputeFlattenedSubShapeWeights(const TfSpan< const float > &weights, VtFloatArray *subShapeWeights) const
Compute a flattened array of weights for all sub-shapes.
USDSKEL_API std::vector< VtVec3fArray > ComputeSubShapePointOffsets() const
USDSKEL_API bool ComputePackedShapeTable(VtVec4fArray *offsets, VtVec2iArray *ranges) const
UsdSkelBlendShapeQuery()=default
GLuint GLsizei const GLuint const GLintptr * offsets
USDSKEL_API bool ComputeSubShapeWeights(const TfSpan< const float > &weights, VtFloatArray *subShapeWeights, VtUIntArray *blendShapeIndices, VtUIntArray *subShapeIndices) const
const UsdPrim & GetPrim() const
Returns the prim the blend shapes apply to.
USDSKEL_API bool ComputeDeformedPoints(const TfSpan< const float > subShapeWeights, const TfSpan< const unsigned > blendShapeIndices, const TfSpan< const unsigned > subShapeIndices, const std::vector< VtIntArray > &blendShapePointIndices, const std::vector< VtVec3fArray > &subShapePointOffsets, TfSpan< GfVec3f > points) const
USDSKEL_API std::string GetDescription() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
size_t GetNumBlendShapes() const
USDSKEL_API std::vector< VtVec3fArray > ComputeSubShapeNormalOffsets() const
USDSKEL_API size_t GetBlendShapeIndex(size_t subShapeIndex) const
Returns the blend shape index corresponding to the i'th sub-shape.
bool IsValid() const
Return true if this query is valid.
size_t GetNumSubShapes() const
USDSKEL_API std::vector< VtIntArray > ComputeBlendShapePointIndices() const
USDSKEL_API UsdSkelInbetweenShape GetInbetween(size_t subShapeIndex) const
Returns the inbetween shape corresponding to sub-shape i, if any.