diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-16 18:34:40 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-16 19:09:27 +0300 |
commit | b247588dc0f48f2fb713f6571ef0129a38760b00 (patch) | |
tree | 68fff9518b93ee3fdc5d99b23ba7d04a351ac98e /source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc | |
parent | 74d716ce23a64ed23b85e9c7a98f153f33dac952 (diff) |
Cleanup: some refactoring in mapped mesh extraction
* Flip the logic to first detect if we are dealing with an unmodified mesh
in editmode. And then if not, detect if we need a mapping or not.
* runtime.is_original is only valid for the bmesh wrapper. Rename it to clarify
that and only check it when the mesh is a bmesh wrapper.
* Remove MR_EXTRACT_MAPPED and instead check only for the existence of the
origindex arrays. Previously it would sometimes access those arrays without
MR_EXTRACT_MAPPED set, which according to a comment means they are invalid.
Differential Revision: https://developer.blender.org/D15676
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc index ef67e1b540d..01d07fa5f83 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc @@ -80,10 +80,10 @@ static void extract_lnor_iter_poly_mesh(const MeshRenderData *mr, } /* Flag for paint mode overlay. - * Only use MR_EXTRACT_MAPPED in edit mode where it is used to display the edge-normals. + * Only use origindex in edit mode where it is used to display the edge-normals. * In paint mode it will use the un-mapped data to draw the wire-frame. */ - if (hidden || (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && - mr->v_origindex[ml->v] == ORIGINDEX_NONE)) { + if (hidden || + (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[ml->v] == ORIGINDEX_NONE)) { lnor_data->w = -1; } else if (mp->flag & ME_FACE_SEL) { @@ -205,10 +205,10 @@ static void extract_lnor_hq_iter_poly_mesh(const MeshRenderData *mr, } /* Flag for paint mode overlay. - * Only use #MR_EXTRACT_MAPPED in edit mode where it is used to display the edge-normals. + * Only use origindex in edit mode where it is used to display the edge-normals. * In paint mode it will use the un-mapped data to draw the wire-frame. */ - if (hidden || (mr->edit_bmesh && mr->extract_type == MR_EXTRACT_MAPPED && (mr->v_origindex) && - mr->v_origindex[ml->v] == ORIGINDEX_NONE)) { + if (hidden || + (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[ml->v] == ORIGINDEX_NONE)) { lnor_data->w = -1; } else if (mp->flag & ME_FACE_SEL) { |