[Work in progress, prototype]
This is a new system to manage sculpt mode visibility. You can create groups of faces dynamically and hide/show them directly while sculpting without using masking tools or box selections.
The sculpt facemap is also used in other sculpting features like the automasking system and mesh filters. It can also be preserved when remeshing the sculpt with the voxel remesher.
The sculpt facemap is stored in the polys instead of in the vertices. This way we can subidivide it with multires in a predictable way.
This patch includes all basic features:
- Sculpt Facemap data structures
- Undo support
- Remesher reprojection support
- Automasking and Mesh filter support
- Sculpt Mode Facemap API
- Sculpt Facemap creation and visibility operators
- New keymap
- We can change the name of this feature to avoid confusion with the mesh facemaps for rigging. If in the future we are going to use Vertex groups, Edges groups and Face groups we can keep this name for this feature.
- The facemap colors are drawn by the PBVH. We need to add something to change the visibility of the facemap and mix it with the new sculpt vertex colors. I'm not sure if we can use an overlay for this without affecting sculpt mode performance, but that would be the ideal solution. It also misses smooth shading support and opacity controls.
- It needs multires support. When using dyntopo, the sculpt facemap should be disabled.
- It gives an error related to the new datalayer.
- I think we should store mesh visibility in sculpt mode in polys instead of in vertices. This should be an easy change. Right now I'm using both and it is starting to become a mess. Some facemap tools have bugs related to keeping in sync facemap visibility and vertex visibility.
- Colors are generated using a random seed that is generated each time the PBVH is built. This way we always get different colors, but colors will also change when entering sculpt mode. Is there something else I can use a seed? Maybe store it in the mesh datablock?