From c3c0fd18ee1d58f8c9e7b03329894503afffa732 Mon Sep 17 00:00:00 2001
From: Philipp Oeser <info@graphics-engineer.com>
Date: Thu, 6 Dec 2018 11:02:50 +0100
Subject: [PATCH] 3D Print Toolbox: update to 2.8 API

would fail to calculate Volume or Area for object with modifier

Fixes T58798
---
 object_print3d_utils/mesh_helpers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py
index 6a18e3e29..56dbfc651 100644
--- a/object_print3d_utils/mesh_helpers.py
+++ b/object_print3d_utils/mesh_helpers.py
@@ -32,7 +32,7 @@ def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifier
 
     if apply_modifiers and obj.modifiers:
         import bpy
-        me = obj.to_mesh(bpy.context.scene, True, 'PREVIEW')
+        me = obj.to_mesh(depsgraph=bpy.context.depsgraph, apply_modifiers=True)
         bm = bmesh.new()
         bm.from_mesh(me)
         bpy.data.meshes.remove(me)
-- 
GitLab