diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-15 15:11:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 11:34:11 +0300 |
commit | e5c3ae31189b3acb54d33061da2bd27c3d0abad5 (patch) | |
tree | a53fe430313980bc37f98966d35d2c390cdbfb62 /object_print3d_utils | |
parent | 05baedacbfdb15b74a2c89a790e8b3f196ef1417 (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.py | 10 |
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) |