diff options
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 2b174de7136..38122c45ef1 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -1123,6 +1123,7 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject const bool use_render = DEG_get_mode(depsgraph) == DAG_EVAL_RENDER; scene_eval = DEG_get_evaluated_scene(depsgraph); ob_eval = DEG_get_evaluated_object(depsgraph, ob); + bool need_free = false; /* Write the display mesh into the dummy mesh */ if (use_deform) { @@ -1134,7 +1135,8 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject return NULL; } - me_eval = mesh_create_eval_final(depsgraph, scene_eval, ob_eval, &data_masks); + me_eval = BKE_mesh_new_from_object(depsgraph, ob_eval, true); + need_free = true; } else { if (use_cage) { @@ -1175,6 +1177,10 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject .calc_face_normal = use_fnorm, })); + if (need_free) { + BKE_id_free(NULL, me_eval); + } + Py_RETURN_NONE; } |