diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-20 08:41:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-20 08:50:48 +0300 |
commit | f889050aea70c2ff3c36c8c8600dd2b02d5e9f91 (patch) | |
tree | 3b6bd799859f8bdd44e4056bf2a7df499618c07f /release | |
parent | dc800154b619de64d2de7dae5f81154af343ccd2 (diff) |
Fix T62757: Mirror operator fails for non-modal execution
Unlike most transform operators that use an orientation and values,
Mirror uses the constraint axes to define which axes are mirrored.
Now constraint axes are shown in this case.
Other changes:
- Use 'EXEC_DEFAULT' for mirror menu items.
- Show mirror on local axis when not in edit-mode since this is useful
in object mode too.
- Remove mirror vertex groups since this is in the vertex group menu and
this menu isn't currently used for general symmetry operators which
are currently in other menus.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c38c99676af..3c27cd03e1c 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -511,32 +511,16 @@ class VIEW3D_MT_mirror(Menu): layout.separator() - layout.operator_context = 'INVOKE_REGION_WIN' + layout.operator_context = 'EXEC_REGION_WIN' - props = layout.operator("transform.mirror", text="X Global") - props.constraint_axis = (True, False, False) - props.orient_type = 'GLOBAL' - props = layout.operator("transform.mirror", text="Y Global") - props.constraint_axis = (False, True, False) - props.orient_type = 'GLOBAL' - props = layout.operator("transform.mirror", text="Z Global") - props.constraint_axis = (False, False, True) - props.orient_type = 'GLOBAL' - - if context.edit_object: - layout.separator() + for (space_name, space_id) in (("Global", 'GLOBAL'), ("Local", 'LOCAL')): + for axis_index, axis_name in enumerate("XYZ"): + props = layout.operator("transform.mirror", text=f"{axis_name!s} {space_name!s}") + props.constraint_axis[axis_index] = True + props.orient_type = 'GLOBAL' - props = layout.operator("transform.mirror", text="X Local") - props.constraint_axis = (True, False, False) - props.orient_type = 'LOCAL' - props = layout.operator("transform.mirror", text="Y Local") - props.constraint_axis = (False, True, False) - props.orient_type = 'LOCAL' - props = layout.operator("transform.mirror", text="Z Local") - props.constraint_axis = (False, False, True) - props.orient_type = 'LOCAL' - - layout.operator("object.vertex_group_mirror") + if space_id == 'GLOBAL': + layout.separator() class VIEW3D_MT_snap(Menu): |