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.
This commit is contained in:
Hans Goudey
2024-04-02 13:42:01 -04:00
parent 6160335c4d
commit 930d645b4c

View File

@@ -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) :