|
Momentum
A library for solving nonlinear optimization problems related to human body kinematics
|
Skinning class that manages blend shape vectors/offsets. More...
#include <blend_shape_base.h>
Public Member Functions | |
| BlendShapeBase ()=default | |
| BlendShapeBase (const BlendShapeBase &)=default | |
| BlendShapeBase & | operator= (const BlendShapeBase &)=default |
| BlendShapeBase (BlendShapeBase &&)=default | |
| BlendShapeBase & | operator= (BlendShapeBase &&)=default |
| BlendShapeBase (size_t modelSize, size_t numShapes, momentum::span< const std::string > shapeNames={}) | |
| virtual | ~BlendShapeBase ()=default |
| void | setShapeVectors (const MatrixXf &shapeVectors, momentum::span< const std::string > shapeNames={}) |
| const MatrixXf & | getShapeVectors () const |
| template<typename T> | |
| VectorX< T > | computeDeltas (const BlendWeightsT< T > &blendWeights) const |
| Calculates weighted combination of shape vectors. | |
| template<typename T> | |
| 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::Index | shapeSize () const |
| size_t | modelSize () const |
| const std::vector< std::string > & | getShapeNames () const |
| std::string_view | getShapeName (size_t index) const |
| void | setShapeName (size_t index, std::string_view name) |
Protected Attributes | |
| MatrixXf | shapeVectors_ |
| std::vector< std::string > | shapeNames_ |
Skinning class that manages blend shape vectors/offsets.
Used to model facial expressions and potentially other deformations such as pose-dependent shape changes
Definition at line 19 of file blend_shape_base.h.
|
default |
Referenced by momentum::BlendShape::BlendShape(), BlendShapeBase(), BlendShapeBase(), operator=(), and operator=().
|
default |
References BlendShapeBase().
|
default |
References BlendShapeBase().
| momentum::BlendShapeBase::BlendShapeBase | ( | size_t | modelSize, |
| size_t | numShapes, | ||
| momentum::span< const std::string > | shapeNames = {} ) |
| modelSize | Number of vertices in the model |
| numShapes | Number of blend shapes |
| shapeNames | Names of the blend shapes (will be automatically generated if empty or not the right size) |
Definition at line 36 of file blend_shape_base.cpp.
References modelSize(), shapeNames_, and shapeVectors_.
|
virtualdefault |
| template void momentum::BlendShapeBase::applyDeltas | ( | const BlendWeightsT< T > & | blendWeights, |
| std::vector< Eigen::Vector3< T > > & | result ) const |
Adds weighted shape vectors to existing vertices.
| T | Scalar type (float or double) |
| blendWeights | Weights for each shape vector |
| result | [in,out] Vertices to modify |
Definition at line 28 of file blend_shape_base.cpp.
References computeDeltas().
|
nodiscard |
Calculates weighted combination of shape vectors.
| T | Scalar type (float or double) |
| blendWeights | Weights for each shape vector |
Definition at line 18 of file blend_shape_base.cpp.
References momentum::cast(), MT_CHECK, shapeVectors_, momentum::EigenStrongType< Derived, EigenType >::size(), and momentum::EigenStrongType< Derived, EigenType >::v.
Referenced by applyDeltas(), and momentum::BlendShape::computeShape().
|
inlinenodiscard |
Definition at line 83 of file blend_shape_base.h.
References shapeNames_.
|
inlinenodiscard |
Definition at line 79 of file blend_shape_base.h.
References shapeNames_.
Referenced by momentum::fbx_internal::saveBlendShapeGeometryToFbx(), and momentum::saveBlendShapesToUsd().
|
inlinenodiscard |
Definition at line 43 of file blend_shape_base.h.
References shapeVectors_.
Referenced by momentum::BlendShape::isApprox(), momentum::saveBlendShape(), momentum::saveBlendShapeBase(), momentum::fbx_internal::saveBlendShapeGeometryToFbx(), and momentum::saveBlendShapesToUsd().
|
inlinenodiscard |
Definition at line 75 of file blend_shape_base.h.
References shapeVectors_.
Referenced by BlendShapeBase(), operator=(), momentum::saveBlendShapesToUsd(), and setShapeVector().
|
default |
References BlendShapeBase(), and modelSize().
|
default |
References BlendShapeBase().
|
inline |
Definition at line 87 of file blend_shape_base.h.
References shapeNames_.
| void momentum::BlendShapeBase::setShapeVector | ( | size_t | index, |
| momentum::span< const Vector3f > | shapeVector, | ||
| std::string_view | name = "" ) |
| index | Index of the shape vector to set |
| shapeVector | Vector of vertex offsets |
Definition at line 71 of file blend_shape_base.cpp.
References modelSize(), MT_CHECK, setShapeVector(), shapeNames_, and shapeVectors_.
Referenced by momentum::BlendShape::setShapeVector(), and setShapeVector().
| void momentum::BlendShapeBase::setShapeVectors | ( | const MatrixXf & | shapeVectors, |
| momentum::span< const std::string > | shapeNames = {} ) |
| shapeVectors | Matrix where each column is a shape vector |
Definition at line 53 of file blend_shape_base.cpp.
References MT_LOGW_IF, setShapeVectors(), shapeNames_, and shapeVectors_.
Referenced by momentum::loadBlendShape(), momentum::loadBlendShapeBase(), and setShapeVectors().
|
inlinenodiscard |
Definition at line 71 of file blend_shape_base.h.
References shapeVectors_.
Referenced by momentum::fbx_internal::saveBlendShapeGeometryToFbx(), and momentum::saveBlendShapesToUsd().
|
protected |
Definition at line 93 of file blend_shape_base.h.
Referenced by BlendShapeBase(), getShapeName(), getShapeNames(), setShapeName(), setShapeVector(), and setShapeVectors().
|
protected |
Definition at line 92 of file blend_shape_base.h.
Referenced by BlendShapeBase(), computeDeltas(), momentum::BlendShape::computeShape(), momentum::BlendShape::estimateCoefficients(), getShapeVectors(), momentum::BlendShape::isApprox(), modelSize(), setShapeVector(), setShapeVectors(), and shapeSize().