Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-05-15 15:11:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-16 11:34:11 +0300
commite5c3ae31189b3acb54d33061da2bd27c3d0abad5 (patch)
treea53fe430313980bc37f98966d35d2c390cdbfb62 /object_print3d_utils
parent05baedacbfdb15b74a2c89a790e8b3f196ef1417 (diff)
Addons: Adopt for Dependency Graph API changes
Mainly search-and-replace approach. Tested the enabled-by-default export/import addons. Seems to work with an exception of X3D which is still referencing Blender Internal material properties. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4866
Diffstat (limited to 'object_print3d_utils')
-rw-r--r--object_print3d_utils/mesh_helpers.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py
index 56dbfc65..79e87774 100644
--- a/object_print3d_utils/mesh_helpers.py
+++ b/object_print3d_utils/mesh_helpers.py
@@ -32,7 +32,8 @@ def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifier
if apply_modifiers and obj.modifiers:
import bpy
- me = obj.to_mesh(depsgraph=bpy.context.depsgraph, apply_modifiers=True)
+ depsgraph = bpy.context.evaluated_depsgraph_get()
+ me = obj.evaluated_get(depsgraph).to_mesh()
bm = bmesh.new()
bm.from_mesh(me)
bpy.data.meshes.remove(me)
@@ -251,16 +252,15 @@ def object_merge(context, objects):
layer.objects.active = obj_base
obj_base.select_set(True)
+ depsgraph = context.evaluated_depsgraph_get()
+
# loop over all meshes
for obj in objects:
if obj.type != 'MESH':
continue
# convert each to a mesh
- mesh_new = obj.to_mesh(
- depsgraph=context.depsgraph,
- apply_modifiers=True,
- )
+ mesh_new = obj.evaluated_get(depsgraph).to_mesh()
# remove non-active uvs/vcols
cd_remove_all_but_active(mesh_new.vertex_colors)