diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 16:01:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-16 17:43:14 +0300 |
commit | 901868a4b2fc6e70d9c74119d97c57de132859a3 (patch) | |
tree | 94f96b6fd5f8a1ec509c6551f504cad958c1688f /object_print3d_utils | |
parent | 2e5b7a4a044ab982af66def583ae16bb563a1357 (diff) |
Update for Depsgraph API changes
Addresses new behavior of object.to_mesh().
This is corresponding part for D4875.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4876
Diffstat (limited to 'object_print3d_utils')
-rw-r--r-- | object_print3d_utils/mesh_helpers.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py index 79e87774..0f444c09 100644 --- a/object_print3d_utils/mesh_helpers.py +++ b/object_print3d_utils/mesh_helpers.py @@ -33,10 +33,11 @@ def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifier if apply_modifiers and obj.modifiers: import bpy depsgraph = bpy.context.evaluated_depsgraph_get() - me = obj.evaluated_get(depsgraph).to_mesh() + obj_eval = obj.evaluated_get(depsgraph) + me = obj_eval.to_mesh() bm = bmesh.new() bm.from_mesh(me) - bpy.data.meshes.remove(me) + obj_eval.to_mesh_clear() del bpy else: me = obj.data @@ -260,7 +261,8 @@ def object_merge(context, objects): continue # convert each to a mesh - mesh_new = obj.evaluated_get(depsgraph).to_mesh() + obj_eval = obj.evaluated_get(depsgraph) + mesh_new = obj_eval.to_mesh() # remove non-active uvs/vcols cd_remove_all_but_active(mesh_new.vertex_colors) @@ -282,7 +284,7 @@ def object_merge(context, objects): # scene_collection.objects.unlink(obj_new) # bpy.data.objects.remove(obj_new) - bpy.data.meshes.remove(mesh_new) + obj_eval.to_mesh_clear() scene.update() |