Fix for object align not using local view cursor
authorCampbell Barton <ideasman42@gmail.com>
Thu, 25 Feb 2016 21:20:56 +0000 (08:20 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 25 Feb 2016 21:21:29 +0000 (08:21 +1100)
release/scripts/startup/bl_operators/object_align.py

index 3c84e5dc553041185e838939f57a61ec109935e1..5c3d95e113c64b3b9214c7291da1a00cfacf87d7 100644 (file)
@@ -125,7 +125,10 @@ def align_objects(context,
                   relative_to,
                   bb_quality):
 
-    cursor = context.scene.cursor_location
+    scene = context.scene
+    space = context.space_data
+
+    cursor = (space if space and space.type == 'VIEW_3D' else scene).cursor_location
 
     Left_Front_Up_SEL = [0.0, 0.0, 0.0]
     Right_Back_Down_SEL = [0.0, 0.0, 0.0]
@@ -136,7 +139,7 @@ def align_objects(context,
 
     for obj in context.selected_objects:
         matrix_world = obj.matrix_world.copy()
-        bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
+        bb_world = [matrix_world * Vector(v) for v in obj.bound_box]
         objects.append((obj, bb_world))
 
     if not objects: