Page MenuHome

Refactor: Move mesh face dot tag out of MVert
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Apr 18 2022, 9:37 PM.

Details

Summary

Continuing the refactors described in T93602, this commit moves
the face dot tag set by the subdivision surface modifier out of
MVert to MeshRuntime. This clarifies its status as runtime data
and allows further refactoring of mesh positions in the future.

Before BKE_modifiers_uses_subsurf_facedots was used to check
whether subsurf face dots should be drawn, but now we can just check
if the tags exist on the mesh. Modifiers that create new new geometry
or modify topology will already remove the array by clearing mesh
runtime data.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Apr 18 2022, 9:37 PM
Hans Goudey (HooglyBoogly) created this revision.
This revision is now accepted and ready to land.Apr 18 2022, 10:08 PM

It might be good to consider whether an array of indices might be better in this case than a bitmap, as we only have one facedot per face in the original mesh.
This can end up making the array of indices smaller than the Bitmap.

But if the code is complicated to port, Bitmap is not bad.

I agree that an array of indices would be better here, but so much code is structured to iterate over all vertices and check the flag rather than iterate over an array of indices.
For the future, as all of these algorithms get more generic, I think it will be much easier to change these things. And it feels safer to change now that it's clearly runtime data.