From 8cf52e8226cbb0a0fa07d674ce179e3172351b99 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Aug 2022 16:00:50 +0200 Subject: 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 --- source/blender/draw/intern/draw_cache_impl_mesh.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/draw/intern/draw_cache_impl_mesh.cc') 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); -- cgit v1.2.3