From f85b05111fa4b96228a4a3969945c80fbb67f499 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 14 Dec 2018 16:07:29 +0100 Subject: Fix T59334: Crash initializing crazyspace on object with subsurf and displacement --- source/blender/modifiers/intern/MOD_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index db6c58d468a..dca2d536a5d 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -50,6 +50,7 @@ #include "BKE_lattice.h" #include "BKE_library.h" #include "BKE_mesh.h" +#include "BKE_object.h" #include "BKE_modifier.h" @@ -190,8 +191,9 @@ Mesh *MOD_deform_mesh_eval_get( else { /* TODO(sybren): after modifier conversion of DM to Mesh is done, check whether * we really need a copy here. Maybe the CoW ob->data can be directly used. */ + Mesh *mesh_prior_modifiers = BKE_object_get_pre_modified_mesh(ob); BKE_id_copy_ex( - NULL, ob->data, (ID **)&mesh, + NULL, &mesh_prior_modifiers->id, (ID **)&mesh, (LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_DEG_TAG | -- cgit v1.2.3