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_fracture_cell | |
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_fracture_cell')
-rw-r--r-- | object_fracture_cell/fracture_cell_setup.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index fcd65681..c3e47bbd 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -65,10 +65,9 @@ def _points_from_object(obj, source): matrix = obj.matrix_world.copy() points.extend([matrix * v.co for v in mesh.vertices]) else: + depsgraph = bpy.context.evaluated_depsgraph_get() try: - mesh = ob.to_mesh(scene=bpy.context.scene, - apply_modifiers=True, - settings='PREVIEW') + mesh = ob.evaluated_get(depsgraph).to_mesh() except: mesh = None @@ -324,6 +323,7 @@ def cell_fracture_boolean(context, obj, objects, objects_boolean = [] collection = context.collection scene = context.scene + depsgraph = context.evaluated_depsgraph_get() if use_interior_hide and level == 0: # only set for level 0 @@ -339,9 +339,7 @@ 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.to_mesh(scene, - apply_modifiers=True, - settings='PREVIEW') + mesh_new = obj_cell.evaluated_get(depsgraph).to_mesh() mesh_old = obj_cell.data obj_cell.data = mesh_new obj_cell.modifiers.remove(mod) |