30 std::vector<Eigen::Vector3<T>>& result)
const {
32 Eigen::Map<Eigen::VectorX<T>> baseShape(&result[0][0], result.size() * 3);
38 const size_t numShapes,
41 shapeNames_.assign(shapeNames.begin(), shapeNames.end());
45 "Provided some but not all blendshape names, all shape names will be auto-generated.");
46 shapeNames_.resize(numShapes);
47 for (size_t i = 0; i < numShapes; ++i) {
48 shapeNames_[i] = std::string(
"shape_") + std::to_string(i);
58 if (shapeNames.size() ==
static_cast<size_t>(
shapeVectors_.cols())) {
59 shapeNames_.assign(shapeNames.begin(), shapeNames.end());
63 "Provided some but not all blendshape names, all shape names will be auto-generated.");
66 shapeNames_[i] = std::string(
"shape_") + std::to_string(i);
74 std::string_view name) {
77 static_cast<Eigen::Index
>(shape.size()) * 3 ==
shapeVectors_.rows(),
86 shapeNames_[index] = std::string(
"shape_") + std::to_string(index);
99 std::vector<Eigen::Vector3<float>>& result)
const;
102 std::vector<Eigen::Vector3<double>>& result)
const;
#define MT_CHECK(condition,...)
Runtime check macros with two interchangeable backends:
#define MT_LOGW_IF(condition,...)
Vector< T, Dynamic > VectorX
Dynamic-size column vector. Common return type for solver residuals and parameter vectors.
gsl::span< T > span
Span type alias using gsl::span (C++17 fallback).
MatrixX< float > MatrixXf
decltype(auto) cast(const ContainerType< ObjectType > &originalContainer)
Casts the scalar type of objects in a container that support the cast<>() method.
VectorX< T > computeDeltas(const BlendWeightsT< T > &blendWeights) const
Calculates weighted combination of shape vectors.
std::vector< std::string > shapeNames_
void setShapeVectors(const MatrixXf &shapeVectors, momentum::span< const std::string > shapeNames={})
void applyDeltas(const BlendWeightsT< T > &blendWeights, std::vector< Eigen::Vector3< T > > &result) const
Adds weighted shape vectors to existing vertices.
void setShapeVector(size_t index, momentum::span< const Vector3f > shapeVector, std::string_view name="")
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto size() const