Page MenuHome

Fix: Remove broken vertex paint "fast update" check
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Jun 22 2022, 10:33 PM.

Details

Summary

Vertex paint mode tried to do a "fast update" by trying to avoid tagging
the mesh ID for a full update. The conditions it uses are troublesome:

  1. There must be an evaluated mesh
  2. The evaluated mesh's active byte color layer must equal the original's

This logic doesn't make sense for a few reasons. First of all, the
mloopcol pointer doesn't make sense in the context of color
attributes (rather than the old vertex colors), since it only points
to byte color attribute on face corners. Second, just because the
layer pointers are equal doesn't mean something doesn't depend
on the attribute's values.

I think the best solution currently is to remove this "fast update"
case and instead work on optimizing the general case.

Also, T95842 suggests removing these pointers, and this is one
of the last remaining uses of Mesh.mloopcol.


I'm not quite sure if ID_RECALC_COPY_ON_WRITE or
ID_RECALC_GEOMETRY is correct in this case.
The description of the latter sounds like it suits this a bit better.

Diff Detail

Repository
rB Blender

Event Timeline

This fast update was not doing anything since Blender 2.8, since the evaluated mesh no longer shares arrays with the original one.

And not much point optimizing this now that this code is going to be replaced by the sculpt mode implementation anyway, which has optimized partial updates through the PBVH.

This revision is now accepted and ready to land.Jun 23 2022, 2:26 PM