![]() |
Dem Bones
1.0
Skinning Decomposition Library
|
Smooth skinning decomposition with rigid bones and sparse, convex weights. More...
#include "DemBones/DemBones.h"
Public Member Functions | |
DemBones () | |
Constructor and setting default parameters. | |
void | clear () |
void | init () |
Initialize missing skinning weights and/or bone transformations. More... | |
void | computeTranformations () |
Update bone transformations by running nTransIters iterations with transAffine and transAffineNorm regularizers. More... | |
void | computeWeights () |
Update skinning weights by running nWeightsIters iterations with weightsSmooth and weightsSmoothStep regularizers. More... | |
void | compute () |
Skinning decomposition by nIters iterations of alternative updating weights and bone transformations. More... | |
_Scalar | rmse () |
virtual void | cbInitSplitBegin () |
Callback function invoked before each spliting of bone clusters in initialization. | |
virtual void | cbInitSplitEnd () |
Callback function invoked after each spliting of bone clusters in initialization. | |
virtual void | cbIterBegin () |
Callback function invoked before each global iteration update. | |
virtual void | cbIterEnd () |
Callback function invoked after each global iteration update. | |
virtual void | cbWeightsBegin () |
Callback function invoked before each skinning weights update. | |
virtual void | cbWeightsEnd () |
Callback function invoked after each skinning weights update. | |
virtual void | cbTranformationsBegin () |
Callback function invoked before each bone transformations update. | |
virtual void | cbTransformationsEnd () |
Callback function invoked after each bone transformations update. | |
virtual void | cbTransformationsIterBegin () |
Callback function invoked before each local bone transformations update iteration. | |
virtual void | cbTransformationsIterEnd () |
Callback function invoked after each local bone transformations update iteration. | |
virtual void | cbWeightsIterBegin () |
Callback function invoked before each local weights update iteration. | |
virtual void | cbWeightsIterEnd () |
Callback function invoked after each local weights update iteration. | |
Public Attributes | |
int | nIters |
[parameter ] Number of global iterations, default = 30 | |
int | nInitIters |
[parameter ] Number of clustering update iterations in the initalization, default = 10 | |
int | nTransIters |
[parameter ] Number of bone transformations update iterations per global iteration, default = 5 | |
_Scalar | transAffine |
[parameter ] Translations affinity soft constraint, default = 10.0 | |
_Scalar | transAffineNorm |
[parameter ] p-norm for bone translations affinity soft constraint, default = 4.0 | |
int | nWeightsIters |
[parameter ] Number of weights update iterations per global iteration, default = 3 | |
int | nnz |
[parameter ] Number of non-zero weights per vertex, default = 8 | |
_Scalar | weightsSmooth |
[parameter ] Weights smoothness soft constraint, default = 1e-4 | |
_Scalar | weightsSmoothStep |
[parameter ] Step size for the weights smoothness soft constraint, default = 1.0 | |
_Scalar | weightEps |
[parameter ] Epsilon for weights solver, default = 1e-15 | |
int | nV |
Number of vertices, typically indexed by i . | |
int | nB |
Number of bones, typically indexed by j . | |
int | nS |
Number of subjects, typically indexed by s . | |
int | nF |
Number of total frames, typically indexed by k , nF = fStart(nS) | |
Eigen::VectorXi | fStart |
Start frame indices, size = nS+1, fStart(s ), fStart(s+1 ) are data frames for subject s . | |
Eigen::VectorXi | subjectID |
Subject index of the frame, size = nF, subjectID(k )=s , where fStart(s ) <= k < fStart(s +1) | |
MatrixX | u |
Geometry at the rest poses, size = [3*nS, nV], u.col(i ).segment(3*s , 3) is the rest pose of vertex i of subject s . | |
SparseMatrix | w |
Skinning weights, size = [nB, nV], w.col(i ) are the skinning weights of vertex i , w(j , i ) is the influence of bone j to vertex i . | |
MatrixX | m |
Bone transformations, size = [4*nF*4, 4*nB], m.blk4(k , j ) is the 4*4 relative transformation matrix of bone j at frame k . More... | |
Eigen::Matrix< _AniMeshScalar, Eigen::Dynamic, Eigen::Dynamic > | v |
Animated mesh sequence, size = [3*nF, nV], v.col(i ).segment(3*k , 3) is the position of vertex i at frame k . | |
std::vector< std::vector< int > > | fv |
Mesh topology, size= [number of polygons ], fv[p ] is the vector of vertex indices of polygon p . | |
const int & | iter |
[zero indexed , read only ] Current global iteration number that can be used for callback functions | |
const int & | iterTransformations |
[zero indexed , read only ] Current bone transformations update iteration number that can be used for callback functions | |
const int & | iterWeights |
[zero indexed , read only ] Current weights update iteration number that can be used for callback functions | |
Smooth skinning decomposition with rigid bones and sparse, convex weights.
Setup the required data, parameters, and call either compute(), computeWeights(), computeTranformations(), or init().
Callback functions and read-only values can be used to report progress: cbInitSplitBegin(), cbInitSplitEnd(), cbIterBegin(), cbIterEnd(), cbWeightsBegin(), cbWeightsEnd(), cbTranformationsBegin(), cbTransformationsEnd(), cbTransformationsIterBegin(), cbTransformationsIterEnd(), cbWeightsIterBegin(), cbWeightsIterEnd(), rmse(), iter, iterTransformations, iterWeights.
_Scalar is the floating-point data type. _AniMeshScalar is the floating-point data type of mesh sequence v.
|
inline |
Clear all data
|
inline |
|
inline |
Update bone transformations by running nTransIters iterations with transAffine and transAffineNorm regularizers.
Required input data:
Optional input data:
Output: m. Missing w and/or m (with zero size) will be initialized by init().
|
inline |
Update skinning weights by running nWeightsIters iterations with weightsSmooth and weightsSmoothStep regularizers.
Required input data:
Optional input data:
Output: w. Missing w and/or m (with zero size) will be initialized by init().
|
inline |
Initialize missing skinning weights and/or bone transformations.
Depending on the status of w and m, this function will:
This function is called at the begining of every compute update functions as a safeguard.
|
inline |
MatrixX Dem::DemBones< _Scalar, _AniMeshScalar >::m |