From e2c02655c78b2c669468ae568ddf4b17953cc98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 21 Jun 2022 07:54:40 +0200 Subject: Fix T98773: GPU Subdivision breaks auto selection in UV edit mode When GPU subdivision is used, and the modifier is not set to be applied on the cage, UV selection is not synced with the face selection in the viewport. This happens because the extraction, despite being in edit mode, is set to `MESH` instead of `BMESH` (or `MAPPED` in some cases) like for CPU subdivision, and since the mesh is not always synchrnised with the BMesh the edit mode flags are not always updated. With GPU subdivision, when creating the `MeshRenderData`, the condition `has_mdata && do_final && editmesh_eval_final != editmesh_eval_cage` is true which forces the `MESH` extraction. Following comment in D14485, this replace the `has_mdata` in the condition with `use_mapped` which solves the issue. Differential Revision: https://developer.blender.org/D15248 --- source/blender/draw/intern/draw_cache_extract_mesh_render_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/draw/intern/draw_cache_extract_mesh_render_data.c b/source/blender/draw/intern/draw_cache_extract_mesh_render_data.c index 0a93f346b37..4fb1b9a7bc7 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh_render_data.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh_render_data.c @@ -502,8 +502,8 @@ MeshRenderData *mesh_render_data_create(Object *object, /* Seems like the mesh_eval_final do not have the right origin indices. * Force not mapped in this case. */ - if (has_mdata && do_final && editmesh_eval_final != editmesh_eval_cage) { - // mr->edit_bmesh = NULL; + if (use_mapped && do_final && editmesh_eval_final != editmesh_eval_cage) { + // mr->edit_bmesh = nullptr; mr->extract_type = MR_EXTRACT_MESH; } } -- cgit v1.2.3