diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-16 17:00:50 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-16 17:01:01 +0300 |
commit | 8cf52e8226cbb0a0fa07d674ce179e3172351b99 (patch) | |
tree | 7767d63884fbb6fa0e5a19265e70710391e8b4ce /source/blender/draw/intern/draw_cache_impl_mesh.cc | |
parent | a1b8013cc3420679d49435d4d6c60ec241cde53c (diff) |
Fix T98773: GPU subdivision issues with UV editor display
This fixes missing selection updates in UV editor, both with GPU subdivision
and with the Modified Edges display option for modifiers in general.
It also fixes the UV editor incorrectly showing the cage mesh with deformed
coordinates. These are not yet supported by the UV selection system.
Changes:
* Always read selection state from the editmesh when building batches. The
flags in the evaluated mesh can be outdated as selection bypasses depsgraph
evaluation for performance, and instead may just clear the batches.
* runtime.is_original is only valid for the bmesh wrapper. The check for
building the UV cage should only use that if the mesh is a bmesh wrapper.
* Don't create cage batches for objects whose mesh is in edit mode, but that
are not themselves in edit mode, there is no need.
Differential Revision: https://developer.blender.org/D15658
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.cc')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_mesh.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.cc b/source/blender/draw/intern/draw_cache_impl_mesh.cc index d1eb937d711..5b7b3fd9a4a 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.cc +++ b/source/blender/draw/intern/draw_cache_impl_mesh.cc @@ -1508,12 +1508,13 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, cache->batch_ready |= batch_requested; bool do_cage = false, do_uvcage = false; - if (is_editmode) { + if (is_editmode && is_mode_active) { Mesh *editmesh_eval_final = BKE_object_get_editmesh_eval_final(ob); Mesh *editmesh_eval_cage = BKE_object_get_editmesh_eval_cage(ob); do_cage = editmesh_eval_final != editmesh_eval_cage; - do_uvcage = !editmesh_eval_final->runtime.is_original; + do_uvcage = !(editmesh_eval_final->runtime.is_original && + editmesh_eval_final->runtime.wrapper_type == ME_WRAPPER_TYPE_BMESH); } const bool do_subdivision = BKE_subsurf_modifier_has_gpu_subdiv(me); |