Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-05-17 12:51:38 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-05-17 13:38:05 +0300
commit77f92b8cb73c0d46838749aae7836c60cff09db9 (patch)
tree8e6dffaddb57a3d20b1f9e5f84f92115bcf4944e /release/scripts/startup/bl_operators/object_align.py
parent39a29d843e6b58a873abf6555fad06c55c336cae (diff)
Update for Depsgraph API changes
Reviewers: sergey Differential Revision: https://developer.blender.org/D4881
Diffstat (limited to 'release/scripts/startup/bl_operators/object_align.py')
-rw-r--r--release/scripts/startup/bl_operators/object_align.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index b18f49e614c..f5053701cce 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -71,8 +71,8 @@ def worldspace_bounds_from_object_data(depsgraph, obj):
matrix_world = obj.matrix_world.copy()
# Initialize the variables with the last vertex
-
- me = obj.to_mesh(depsgraph=depsgraph, apply_modifiers=True)
+ ob_eval = obj.evaluated_get(depsgraph)
+ me = ob_eval.to_mesh()
verts = me.vertices
val = matrix_world @ (verts[-1].co if verts else Vector((0.0, 0.0, 0.0)))
@@ -114,7 +114,7 @@ def worldspace_bounds_from_object_data(depsgraph, obj):
if val > up:
up = val
- bpy.data.meshes.remove(me)
+ ob_eval.to_mesh_clear()
return Vector((left, front, up)), Vector((right, back, down))
@@ -127,7 +127,7 @@ def align_objects(context,
relative_to,
bb_quality):
- depsgraph = context.depsgraph
+ depsgraph = context.evaluated_depsgraph_get()
scene = context.scene
cursor = scene.cursor.location
@@ -135,7 +135,7 @@ def align_objects(context,
# We are accessing runtime data such as evaluated bounding box, so we need to
# be sure it is properly updated and valid (bounding box might be lost on operator
# redo).
- scene.update()
+ context.view_layer.update()
Left_Front_Up_SEL = [0.0, 0.0, 0.0]
Right_Back_Down_SEL = [0.0, 0.0, 0.0]