UI: Add Missing UV Unwrap Operators to UV Editor

This commit also changes the U shortcut to open the unwrap menu instead 
of the Unwrap operator. The unwrap operator can now be accessed by 
pressing U twice.

Note, these operators use the 3D Viewports selection and not the UV 
Editor selection. In the future the operators should unwrap based on the 
selection within that editor.

Fixes T80600

Differential Revision: https://developer.blender.org/D8834
This commit is contained in:
Aaron Carlisle 2020-09-09 19:47:02 -04:00
parent 5badf16531
commit 4e3cb95638
Notes: blender-bot 2023-02-13 21:13:29 +01:00
Referenced by issue #80600, F3 Search No Follow Active Quads
2 changed files with 26 additions and 2 deletions

View File

@ -897,7 +897,7 @@ def km_uv_editor(params):
{"properties": [("clear", False)]}),
("uv.pin", {"type": 'P', "value": 'PRESS', "alt": True},
{"properties": [("clear", True)]}),
("uv.unwrap", {"type": 'U', "value": 'PRESS'}, None),
op_menu("IMAGE_MT_uvs_unwrap", {"type": 'U', "value": 'PRESS'}),
("uv.hide", {"type": 'H', "value": 'PRESS'},
{"properties": [("unselected", False)]}),
("uv.hide", {"type": 'H', "value": 'PRESS', "shift": True},

View File

@ -364,6 +364,29 @@ class IMAGE_MT_uvs_split(Menu):
layout.operator("uv.select_split", text="Selection")
class IMAGE_MT_uvs_unwrap(Menu):
bl_label = "Unwrap"
def draw(self, context):
layout = self.layout
layout.operator("uv.unwrap")
layout.separator()
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("uv.smart_project")
layout.operator("uv.lightmap_pack")
layout.operator("uv.follow_active_quads")
layout.separator()
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("uv.cube_project")
layout.operator("uv.cylinder_project")
layout.operator("uv.sphere_project")
class IMAGE_MT_uvs(Menu):
bl_label = "UV"
@ -388,7 +411,7 @@ class IMAGE_MT_uvs(Menu):
layout.separator()
layout.prop(uv, "use_live_unwrap")
layout.operator("uv.unwrap")
layout.menu("IMAGE_MT_uvs_unwrap")
layout.separator()
@ -1508,6 +1531,7 @@ classes = (
IMAGE_MT_uvs_align,
IMAGE_MT_uvs_merge,
IMAGE_MT_uvs_split,
IMAGE_MT_uvs_unwrap,
IMAGE_MT_uvs_select_mode,
IMAGE_MT_uvs_context_menu,
IMAGE_MT_mask_context_menu,