Page MenuHome

Fix T81775: Object Disappears During Texture Painting
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Nov 3 2020, 10:58 AM.

Details

Summary

Issue was that the tris_per_mat are not created when the first batch is drawn
during select operator and then is not created when needed by the workbench pass
since they are not tracked by mesh_buffer_cache_create_requested.

This change will create the tris_per_mat just in case they are needed later.
Solution by Clément Foucault

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Nov 3 2020, 10:58 AM
Jeroen Bakker (jbakker) created this revision.

Rebased with latest blender-v2.91-release

Jeroen Bakker (jbakker) retitled this revision from Fix T81775 (workaround): Object Disappeat During Texture Painting to Fix T81775 (workaround): Object Disappears During Texture Painting.Nov 3 2020, 11:04 AM
Clément Foucault (fclem) requested changes to this revision.Nov 3 2020, 7:04 PM

Discard here is tricky. The index buffer might have been already referenced by another batch. That's why we clear instead of discard for the batches.

The real issue (took me a while to investigate) is that the tris_per_mat are not created when the first batch is recreated (drawn during select operator) and then is not created when needed by the workbench pass since they are not tracked by mesh_buffer_cache_create_requested.

See P1749 for a possible solution.

Another possibility is to track tris_per_mat[0] correctly and generate the IBOs only if it is not NULL and requested.

This revision now requires changes to proceed.Nov 3 2020, 7:04 PM

Proposed fix from Clement

Added new line before comment

Yes it does the trick. Still need to find out how we can debug this part better it is hard to find out what previous action lead to incorrect behavior.

Jeroen Bakker (jbakker) retitled this revision from Fix T81775 (workaround): Object Disappears During Texture Painting to Fix T81775: Object Disappears During Texture Painting.Nov 4 2020, 7:31 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 4 2020, 1:41 PM