Page MenuHome

Sculpt: Vertex group to mask conversion operators
Needs ReviewPublic

Authored by Pablo Dobarro (pablodp606) on Tue, Oct 1, 7:41 PM.
This revision needs review, but there are no reviewers specified.



This is the easiest solution I found to disable the mask without losing it. We need to design a better way to handle masking and visibility in sculpt mode, but for now, this solves the problem.
I've never worked with vertex groups before, so I'm not sure if this affects other areas outside sculpt mode.

Diff Detail

rB Blender
sculpt-mask-vgroups (branched from master)
Build Status
Buildable 5196
Build 5196: arc lint + arc unit

Event Timeline

  • Enable operators only for PBVH_FACES

This seems like too much of a hacky solution to this problem, vertex groups are quite slow and memory hungry on high poly meshes and will not work for multires.

True. We need to consider this again when adding vertex colors to the PBVH in 2.82. We should do it in a way that allows us to add any custom data to the vertices, not only the mask and a color layer. That way we can support storing multiple mask layers properly. This patch can be used in case someone needs this functionality before that.

If the intent is mainly to be able to temporarily disable masks and not so much create multiple, then that is possible (though requires small changes in many places). It's possible to make the PBVH iterator and mesh abstraction not return any mask (they already assume that can be the case), which covers the majority of tools. For mask editing operators, maybe they would automatically re-enable or clear the mask when starting.

Supporting multiple mask layers is possible, it's already a customdata layer and there is nothing stopping us from having a list of them just like UV maps or vertex colors. Not easy to implement for all the different mesh types, but I also don't see any big roadblocks to it.

In case we add multiple mask layers using the customdata layers, can we support reading/writing to multiple layers at the same time or is there any limitation? In case that there isn't, I would prefer that solution instead of adding a toggle to disable the mask, it would be too confusing (mask can be enabled/disabled and visible/invisible)

Maybe we want to keep these operators for weight paint use cases. Right now sculpt masking tools are more advanced than weight paint tools. Being able to use tools like mask expand or mask filters could help when creating the weights for an armature, even if they are not directly available in weight paint.