Inochi2D / inochi2d

Inochi2D reference implementation aimed at rendering 2D puppets that can be animated in real-time (using eg. facial capture).
BSD 2-Clause "Simplified" License
1.25k stars 47 forks source link

Meshgroup introduction. #30

Closed seagetch closed 1 year ago

seagetch commented 1 year ago

I implemented two mode of meshgroup.

1) static mode (or pre-processing mode) : default mode In this mode, deformation of the mesh group is applied before any T/R/S is applied to the child. This means deformation of mesh group can be transferred to every child nodes when exporting to INP file. After deformation is transferred to child nodes, mesh group act as normal Node object. This mode has no additional cost at session or other program. In creator, this is calculated in every frame (same as post-processing mode) to simplifying the logics and structure. Warp mesh group is a special form of the "static mode" mesh group, where all vertices are aligned in grid.

2) dynamic mode (or post-processing mode) : optional mode This is current implementation of my mesh group. post processing is applied after all T/R/S is applied to child nodes. In this mode, user can control the deformation application order of several parameters. e.g. eyes and mouth are usually transformed with face angles and open-close actions. without this mode, user cannot ensure combinations of those two parameters result in consistent shape. By using this mode,user can postpone the parameter application for angles untill all of the open-close transforms are applied to eyes and mouth. Keeping consistency for all potential parameters take much time in general, but "dynamic mode" mesh group provides easy way for riggers.

Default mode is static, but still calculated on-the-fly. When you call Puppet.applyDeformToChildren(), all static mode meshgroup transferred deformation to its children.