[Bf-blender-cvs] [fb4c2ed1a90] blender2.8: Fix T57892: Align Objects in Blender 2.8 Alpha 2 last Builds.

Bastien Montagne noreply at git.blender.org
Tue Nov 20 22:15:14 CET 2018


Commit: fb4c2ed1a90c45b675f146262ce4b087895d3326
Author: Bastien Montagne
Date:   Tue Nov 20 22:14:00 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBfb4c2ed1a90c45b675f146262ce4b087895d3326

Fix T57892: Align Objects in Blender 2.8 Alpha 2 last Builds.

Needed some update for API changes...

===================================================================

M	release/scripts/startup/bl_operators/object_align.py

===================================================================

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)



More information about the Bf-blender-cvs mailing list