Page MenuHome

Fix T73095: Edit Mode Overlay Linked Mesh

Authored by Jeroen Bakker (jbakker) on Feb 3 2020, 8:28 AM.



When having one part of a duplicate linked object in edit mode the other
part didn't draw in edit mode. This used to be the case in b2.79-b2.81.

There are multiple related tickets that changed this part of the code to
reflect how it used to work.

The current change introduces a draw manager method that checks in detail who is responsible for the drawing (render engine or overlay engine).
If the edit mesh is not the original or the object that is drawn doesn't draw the original mesh the object will be drawn by the render engine.

Known Limitation of this patch is that the rendering outside edit mode doesn't reflect the latest changes until the user switches between object and edit mode.
When there are no modifiers in use, the updating is done immediately (no surface batches are used).

IMO this would be sufficient for blender 2.82, it also fixes T72733. The updating of the surface batches requires more development.

Diff Detail

rB Blender

Event Timeline

Quick reply here as connection is timing out on my end for some reason.

The issue with this is having an edit-mesh for a mesh doesn't mean the depsgraph generated run-time data will be up to date,
I manged create situations with two windows with different collections sharing the same mesh which would crash if it assumed having edit-mesh meant having edit-mesh display data.

Tested this patch I managed to crash switching between scenes which had two different objects sharing the object data. although I'm not sure thats related to T72848: Multiple windows displaying an linked duplicate, crashes when transforming in edit-mode.

An example that crashes:

In either of the windows:

  • Add a wireframe modifier.
  • Remove the wireframe modifier.

... if it doesn't crash, do it again, it may crash when adding or removing.

Otherwise, I don't have anything against the change, it does mean there is a mis-match between different engines checks for edit-mode.

See draw_cache_impl_mesh.c in rB07a959067d5a: Fix T72667: Collection delete hierarchy in edit-mode crashes.

Suggest to add a comment above this line that notes why this works differently to other engines.

Added a test to see if the edited mesh or the draw mesh is modified.

Fix crash when mesh is displayed in multiple windows

Looks fine to me!

This revision is now accepted and ready to land.Feb 3 2020, 4:48 PM

Make comment humanreadable

This revision was automatically updated to reflect the committed changes.