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:
Diffstat (limited to 'blenderkit/utils.py')
-rw-r--r--blenderkit/utils.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/blenderkit/utils.py b/blenderkit/utils.py
index 56e9a0ef..c6e97fa9 100644
--- a/blenderkit/utils.py
+++ b/blenderkit/utils.py
@@ -300,9 +300,13 @@ def get_bounds_snappable(obs, use_modifiers=False):
if ob.type == 'MESH' or ob.type == 'CURVE':
# If to_mesh() works we can use it on curves and any other ob type almost.
# disabled to_mesh for 2.8 by now, not wanting to use dependency graph yet.
- mesh = ob.to_mesh(depsgraph=bpy.context.depsgraph, apply_modifiers=True, calc_undeformed=False)
+ depsgraph = bpy.context.evaluated_depsgraph_get()
+ mesh = ob.evaluated_get(depsgraph).to_mesh()
- # to_mesh(context.depsgraph, apply_modifiers=self.applyModifiers, calc_undeformed=False)
+ # if self.applyModifiers:
+ # evaluated_get(depsgraph).to_mesh()
+ # else:
+ # to_mesh()
obcount += 1
for c in mesh.vertices:
coord = c.co
@@ -339,7 +343,8 @@ def get_bounds_worldspace(obs, use_modifiers=False):
# bb=ob.bound_box
mw = ob.matrix_world
if ob.type == 'MESH' or ob.type == 'CURVE':
- mesh = ob.to_mesh(depsgraph=bpy.context.depsgraph, apply_modifiers=True, calc_undeformed=False)
+ depsgraph = bpy.context.evaluated_depsgraph_get()
+ mesh = ob.evaluated_get(depsgraph).to_mesh()
obcount += 1
for c in mesh.vertices:
coord = c.co