diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-10 01:19:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-10 01:21:37 +0300 |
commit | 91ea42b8dfde9d8b0203d50f2873ecf90653c3aa (patch) | |
tree | 8118e1965a07f4d96ea5cf41c8a27e6c490a2d0f /release/scripts/startup/bl_operators/object.py | |
parent | 54967955bc9034a642fbd0cdad4a56a7897aefda (diff) |
Remove Align to View Operator
This only worked on new objects, which is no longer needed.
It didn't account for:
- Quaternion or axis-angle rotation.
- Parenting.
- Constraints.
If we support object rotation alignment, it might be best to
make it a more general set of alignment operators
(align transform, orientation - not limiting to view).
Diffstat (limited to 'release/scripts/startup/bl_operators/object.py')
-rw-r--r-- | release/scripts/startup/bl_operators/object.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index c5801b5a4e6..ae12db225cf 100644 --- a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -914,50 +914,7 @@ class LoadImageAsEmpty(Operator): return {'FINISHED'} -class AlignObjectsToView(bpy.types.Operator): - bl_idname = "object.align_to_view" - bl_label = "Align Objects to View" - bl_options = {"REGISTER", "UNDO"} - - front_axis: EnumProperty( - name="Front Axis", - default='POS_Z', - items=( - (sign + axis, sign_sym + axis, "") - for sign, sign_sym in (('POS_', '+'), ('NEG_', "-")) - for axis in ('X', 'Y', 'Z') - ) - ) - - @classmethod - def poll(cls, context): - return context.space_data.type == "VIEW_3D" - - def execute(self, context): - from math import radians - from mathutils import Euler - - axis_data = { - 'POS_X': Euler((0.0, radians(-90.0), 0.0)), - 'NEG_X': Euler((0.0, radians(90.0), 0.0)), - 'POS_Y': Euler((radians(90.0), 0.0, 0.0)), - 'NEG_Y': Euler((radians(-90.0), 0.0, 0.0)), - 'POS_Z': Euler((0.0, 0.0, 0.0)), - 'NEG_Z': Euler((0.0, radians(180.0), 0.0)) - } - - base = axis_data[self.front_axis].to_matrix() - - view = context.space_data.region_3d.view_matrix - rotation = (view.to_3x3().inverted() @ base).to_euler() - for obj in context.selected_objects: - obj.rotation_euler = rotation - - return {"FINISHED"} - - classes = ( - AlignObjectsToView, ClearAllRestrictRender, DupliOffsetFromCursor, IsolateTypeRender, |