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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-11-21 00:14:00 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-21 00:14:00 +0300
commitfb4c2ed1a90c45b675f146262ce4b087895d3326 (patch)
tree8230365d62da5e89ce61cc7f0ec27e3ecd21f827 /release/scripts/startup/bl_operators/object_align.py
parentb7ee0912a7776f444041f25b3103c6b30f4c771a (diff)
Fix T57892: Align Objects in Blender 2.8 Alpha 2 last Builds.
Needed some update for API changes...
Diffstat (limited to 'release/scripts/startup/bl_operators/object_align.py')
-rw-r--r--release/scripts/startup/bl_operators/object_align.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py
index 60fb360480f..d4f8af1310d 100644
--- a/release/scripts/startup/bl_operators/object_align.py
+++ b/release/scripts/startup/bl_operators/object_align.py
@@ -66,13 +66,13 @@ def worldspace_bounds_from_object_bounds(bb_world):
return (Vector((left, front, up)), Vector((right, back, down)))
-def worldspace_bounds_from_object_data(scene, obj):
+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(scene=scene, apply_modifiers=True, settings='PREVIEW')
+ me = obj.to_mesh(depsgraph=depsgraph, apply_modifiers=True)
verts = me.vertices
val = matrix_world @ (verts[-1].co if verts else Vector((0.0, 0.0, 0.0)))
@@ -127,6 +127,7 @@ def align_objects(context,
relative_to,
bb_quality):
+ depsgraph = context.depsgraph
scene = context.scene
space = context.space_data
@@ -155,7 +156,7 @@ def align_objects(context,
for obj, bb_world in objects:
if bb_quality and obj.type == 'MESH':
- GBB = worldspace_bounds_from_object_data(scene, obj)
+ GBB = worldspace_bounds_from_object_data(depsgraph, obj)
else:
GBB = worldspace_bounds_from_object_bounds(bb_world)
@@ -219,7 +220,7 @@ def align_objects(context,
bb_world = [matrix_world @ Vector(v[:]) for v in obj.bound_box]
if bb_quality and obj.type == 'MESH':
- GBB = worldspace_bounds_from_object_data(scene, obj)
+ GBB = worldspace_bounds_from_object_data(depsgraph, obj)
else:
GBB = worldspace_bounds_from_object_bounds(bb_world)