From 930d645b4caa5fc088be08497a6610faaae12a4e Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 2 Apr 2024 13:42:01 -0400 Subject: [PATCH] Fix #120154: Cage face normals overlay always draws original normals When the cage mesh is the output of a modifier that supports deforming BMesh directly, it will be a mesh wrapper and `MR_EXTRACT_BMESH` will be used. Otherwise the cage mesh will be a `Mesh` and its own normals should be drawn instead of the the original normals. Thought this seems deceivingly simple, it works with no modifiers, BMesh-deforming modifiers with cage enabled and disabled, and topology changing modifiers, which should be all the possible cases here. --- .../draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc index 2ee664d7194..e32d9610bce 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc @@ -71,7 +71,7 @@ static void extract_fdots_nor_finish(const MeshRenderData &mr, nor[f].w = NOR_AND_FLAG_HIDDEN; } else { - nor[f] = GPU_normal_convert_i10_v3(bm_face_no_get(mr, efa)); + nor[f] = GPU_normal_convert_i10_v3(mr.face_normals[f]); /* Select / Active Flag. */ nor[f].w = (BM_elem_flag_test(efa, BM_ELEM_SELECT) ? ((efa == mr.efa_act) ? NOR_AND_FLAG_ACTIVE : NOR_AND_FLAG_SELECT) :