From 23a97dd965ecbc30ec331aa5c8dec8afd82964b6 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 5 Mar 2025 14:16:11 -0500 Subject: [PATCH] Fix #135520: Mesh edit mode "Frame Selected" crash in some cases Caused by 839108f62376f10231f44087a9844c30d9234cd5. Now, when there is no mapping available between the evaluated mesh and the original, the evaluated mesh won't have the edit mesh pointer set. Since this code really just cares about the original BMesh, just retrieve it with the original object. This function expects an evaluated object since `BKE_object_get_editmesh_eval_cage` asserts for that laer on. --- source/blender/editors/util/ed_transverts.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/util/ed_transverts.cc b/source/blender/editors/util/ed_transverts.cc index f164ab42a9c..4b8695c0931 100644 --- a/source/blender/editors/util/ed_transverts.cc +++ b/source/blender/editors/util/ed_transverts.cc @@ -6,6 +6,7 @@ * \ingroup edutil */ +#include "DNA_mesh_types.h" #include "MEM_guardedalloc.h" #include "DNA_armature_types.h" @@ -24,9 +25,11 @@ #include "BKE_editmesh.hh" #include "BKE_lattice.hh" #include "BKE_mesh_iterators.hh" +#include "BKE_mesh_types.hh" #include "BKE_object.hh" #include "DEG_depsgraph.hh" +#include "DEG_depsgraph_query.hh" #include "ED_armature.hh" #include "ED_curves.hh" @@ -215,7 +218,9 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, const Object *obedit, tvs->transverts_tot = 0; if (obedit->type == OB_MESH) { - BMEditMesh *em = BKE_editmesh_from_object((Object *)obedit); + const Object *object_orig = DEG_get_original_object(const_cast(obedit)); + const Mesh &mesh = *static_cast(object_orig->data); + BMEditMesh *em = mesh.runtime->edit_mesh.get(); BMesh *bm = em->bm; BMIter iter; void *userdata[2] = {em, nullptr};