diff options
-rw-r--r-- | source/blender/collada/BlenderContext.cpp | 12 | ||||
-rw-r--r-- | source/blender/collada/BlenderContext.h | 2 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 8 |
3 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/collada/BlenderContext.cpp b/source/blender/collada/BlenderContext.cpp index fcfd9241649..2281b3dd529 100644 --- a/source/blender/collada/BlenderContext.cpp +++ b/source/blender/collada/BlenderContext.cpp @@ -54,6 +54,18 @@ Scene *BlenderContext::get_scene() return scene; } +Scene *BlenderContext::get_evaluated_scene() +{ + Scene *scene_eval = DEG_get_evaluated_scene(get_depsgraph()); + return scene_eval; +} + +Object *BlenderContext::get_evaluated_object(Object *ob) +{ + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); + return ob_eval; +} + ViewLayer *BlenderContext::get_view_layer() { return view_layer; diff --git a/source/blender/collada/BlenderContext.h b/source/blender/collada/BlenderContext.h index 648d97a7e86..e6157a5a7f2 100644 --- a/source/blender/collada/BlenderContext.h +++ b/source/blender/collada/BlenderContext.h @@ -49,6 +49,8 @@ public: bContext *get_context(); Depsgraph *get_depsgraph(); Scene *get_scene(); + Scene *get_evaluated_scene(); + Object *get_evaluated_object(Object *ob); ViewLayer *get_view_layer(); Main *get_main(); }; diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index f5be93195ab..33f74968782 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -263,7 +263,6 @@ Mesh *bc_get_mesh_copy( bool triangulate) { CustomDataMask mask = CD_MASK_MESH; - Mesh *mesh = (Mesh *)ob->data; Mesh *tmpmesh = NULL; if (apply_modifiers) { #if 0 /* Not supported by new system currently... */ @@ -281,12 +280,13 @@ Mesh *bc_get_mesh_copy( } #else Depsgraph *depsgraph = blender_context.get_depsgraph(); - Scene *scene = blender_context.get_scene(); - tmpmesh = mesh_get_eval_final(depsgraph, scene, ob, mask); + Scene *scene_eval = blender_context.get_evaluated_scene(); + Object *ob_eval = blender_context.get_evaluated_object(ob); + tmpmesh = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, mask); #endif } else { - tmpmesh = mesh; + tmpmesh = (Mesh *)ob->data; } BKE_id_copy_ex(NULL, &tmpmesh->id, (ID **)&tmpmesh, |