diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-07 07:47:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 07:49:03 +0300 |
commit | 9268ff4b21d225ea6ae66fd5534379450557a91b (patch) | |
tree | 8200c0eeb432f5b03fc15f8ee8259942515fce92 /release/scripts/startup/bl_operators/object_align.py | |
parent | 7ae9b96ac6debe9c63c4ce9ac9ca4e659d3a620d (diff) |
Cleanup: Python context access
Avoid access from bpy when it's already declared.
Diffstat (limited to 'release/scripts/startup/bl_operators/object_align.py')
-rw-r--r-- | release/scripts/startup/bl_operators/object_align.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/object_align.py b/release/scripts/startup/bl_operators/object_align.py index b7d3866989d..4af0b7f9e15 100644 --- a/release/scripts/startup/bl_operators/object_align.py +++ b/release/scripts/startup/bl_operators/object_align.py @@ -65,13 +65,13 @@ def GlobalBB_LQ(bb_world): return (Vector((left, front, up)), Vector((right, back, down))) -def GlobalBB_HQ(obj): +def GlobalBB_HQ(scene, obj): matrix_world = obj.matrix_world.copy() # Initialize the variables with the last vertex - me = obj.to_mesh(scene=bpy.context.scene, apply_modifiers=True, settings='PREVIEW') + me = obj.to_mesh(scene=scene, apply_modifiers=True, settings='PREVIEW') verts = me.vertices val = matrix_world * verts[-1].co @@ -154,7 +154,7 @@ def align_objects(context, for obj, bb_world in objects: if bb_quality and obj.type == 'MESH': - GBB = GlobalBB_HQ(obj) + GBB = GlobalBB_HQ(scene, obj) else: GBB = GlobalBB_LQ(bb_world) @@ -218,7 +218,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 = GlobalBB_HQ(obj) + GBB = GlobalBB_HQ(scene, obj) else: GBB = GlobalBB_LQ(bb_world) |