7 #ifndef PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H
8 #define PXR_USD_USD_SKEL_BLEND_SHAPE_QUERY_H
19 #include "pxr/base/vt/array.h"
99 VtFloatArray* subShapeWeights,
100 VtUIntArray* blendShapeIndices,
101 VtUIntArray* subShapeIndices)
const;
107 VtFloatArray* subShapeWeights)
const;
120 const std::vector<VtIntArray>& blendShapePointIndices,
121 const std::vector<VtVec3fArray>& subShapePointOffsets,
137 const std::vector<VtIntArray>& blendShapePointIndices,
138 const std::vector<VtVec3fArray>& subShapeNormalOffsets,
154 VtVec2iArray* ranges)
const;
163 _SubShape() =
default;
165 _SubShape(
unsigned blendShapeIndex,
int inbetweenIndex,
float weight)
166 : _blendShapeIndex(blendShapeIndex),
167 _inbetweenIndex(inbetweenIndex),
172 int GetInbetweenIndex()
const {
return _inbetweenIndex; }
174 bool IsInbetween()
const {
return _inbetweenIndex >= 0; }
175 bool IsNullShape()
const {
return _weight == 0.0f; }
176 bool IsPrimaryShape()
const {
return _weight == 1.0f; }
178 float GetWeight()
const {
return _weight; }
181 unsigned _blendShapeIndex = 0;
182 int _inbetweenIndex = 0;
186 struct _SubShapeCompareByWeight {
187 bool operator()(
const _SubShape& lhs,
const _SubShape& rhs)
const
188 {
return lhs.GetWeight() < rhs.GetWeight(); }
190 bool operator()(
float lhs,
const _SubShape& rhs)
const
191 {
return lhs < rhs.GetWeight(); }
196 size_t firstSubShape = 0;
197 size_t numSubShapes = 0;
201 std::vector<_SubShape> _subShapes;
202 std::vector<_BlendShape> _blendShapes;
203 std::vector<UsdSkelInbetweenShape> _inbetweens;
208 #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
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.