diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 09:49:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-12 09:49:38 +0300 |
commit | 75e4648e27989b60dd22c2a709c57753ac2fceb7 (patch) | |
tree | 5c45d48e08e6a3de5f0d1901bab79fe0b70e3725 /source/blender/editors/object/object_add.c | |
parent | 5400d6a8fa467a79c5c022d423da247d583ae9f6 (diff) |
Mesh: remove derived mesh for conversion
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 4f4dfd544aa..e8833ca259a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -67,7 +67,6 @@ #include "BKE_context.h" #include "BKE_constraint.h" #include "BKE_curve.h" -#include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_effect.h" #include "BKE_font.h" @@ -1768,7 +1767,6 @@ static int convert_exec(bContext *C, wmOperator *op) ViewLayer *view_layer = CTX_data_view_layer(C); Base *basen = NULL, *basact = NULL; Object *ob1, *obact = CTX_data_active_object(C); - DerivedMesh *dm; Curve *cu; Nurb *nu; MetaBall *mb; @@ -1905,12 +1903,11 @@ static int convert_exec(bContext *C, wmOperator *op) /* note: get the mesh from the original, not from the copy in some * cases this doesn't give correct results (when MDEF is used for eg) */ - dm = mesh_get_derived_final(depsgraph, scene, newob, CD_MASK_MESH); - - DM_to_mesh(dm, newob->data, newob, CD_MASK_MESH, true); - - /* re-tessellation is called by DM_to_mesh */ - + Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, newob, CD_MASK_MESH); + if (newob->runtime.mesh_eval == me_eval) { + newob->runtime.mesh_eval = NULL; + } + BKE_mesh_nomain_to_mesh(me_eval, newob->data, newob, CD_MASK_MESH, true); BKE_object_free_modifiers(newob, 0); /* after derivedmesh calls! */ } else if (ob->type == OB_FONT) { |