From b247588dc0f48f2fb713f6571ef0129a38760b00 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 16 Aug 2022 17:34:40 +0200 Subject: 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 --- source/blender/blenkernel/intern/mesh.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/mesh.cc') diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index abf47acd5cc..1b8d094e9d3 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -113,7 +113,7 @@ static void mesh_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int * * While this could be the callers responsibility, keep here since it's * highly unlikely we want to create a duplicate and not use it for drawing. */ - mesh_dst->runtime.is_original = false; + mesh_dst->runtime.is_original_bmesh = false; /* Only do tessface if we have no polys. */ const bool do_tessface = ((mesh_src->totface != 0) && (mesh_src->totpoly == 0)); -- cgit v1.2.3