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_fracture_cell | |
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_fracture_cell')
-rw-r--r-- | object_fracture_cell/fracture_cell_setup.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index c3e47bbd..dc45c43c 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -66,15 +66,16 @@ def _points_from_object(obj, source): points.extend([matrix * v.co for v in mesh.vertices]) else: depsgraph = bpy.context.evaluated_depsgraph_get() + ob_eval = ob.evaluated_get(depsgraph) try: - mesh = ob.evaluated_get(depsgraph).to_mesh() + mesh = ob_eval.to_mesh() except: mesh = None if mesh is not None: matrix = obj.matrix_world.copy() points.extend([matrix * v.co for v in mesh.vertices]) - bpy.data.meshes.remove(mesh) + ob_eval.to_mesh_clear() def points_from_particles(obj): points.extend([p.location.copy() @@ -339,7 +340,8 @@ def cell_fracture_boolean(context, obj, objects, if use_interior_hide: obj_cell.data.polygons.foreach_set("hide", [True] * len(obj_cell.data.polygons)) - mesh_new = obj_cell.evaluated_get(depsgraph).to_mesh() + obj_cell_eval = obj_cell.evaluated_get(depsgraph) + mesh_new = bpy.data.meshes.new_from_object(obj_cell_eval) mesh_old = obj_cell.data obj_cell.data = mesh_new obj_cell.modifiers.remove(mod) |