diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-05 19:29:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-05 19:29:06 +0400 |
commit | e1878f7142acb96c8b9cce4fa0557419896511e0 (patch) | |
tree | 095453e785ef276ad5e713307d0c4d608b67848d | |
parent | 31ff2a6da254e17603f677261c79ce799d51db59 (diff) |
patch [#24146] UV layout selection menu in UV editor ala CTRL+TAB in edit mode
-rw-r--r-- | release/scripts/ui/space_image.py | 41 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d.py | 18 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 1 |
4 files changed, 52 insertions, 10 deletions
diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py index d2e5046c816..d46220ad7b9 100644 --- a/release/scripts/ui/space_image.py +++ b/release/scripts/ui/space_image.py @@ -250,6 +250,47 @@ class IMAGE_MT_uvs(bpy.types.Menu): layout.separator() layout.menu("IMAGE_MT_uvs_showhide") + +class IMAGE_MT_uvs_select_mode(bpy.types.Menu): + bl_label = "UV Select Mode" + + def draw(self, context): + layout = self.layout + + layout.operator_context = 'INVOKE_REGION_WIN' + toolsettings = context.tool_settings + + # do smart things depending on whether uv_select_sync is on + + if toolsettings.use_uv_select_sync: + prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') + prop.value = "(True, False, False)" + prop.data_path = "tool_settings.mesh_select_mode" + + prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL') + prop.value = "(False, True, False)" + prop.data_path = "tool_settings.mesh_select_mode" + + prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL') + prop.value = "(False, False, True)" + prop.data_path = "tool_settings.mesh_select_mode" + + else: + prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL') + prop.value = "VERTEX" + prop.data_path = "tool_settings.uv_select_mode" + + prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL') + prop.value = "EDGE" + prop.data_path = "tool_settings.uv_select_mode" + + prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL') + prop.value = "FACE" + prop.data_path = "tool_settings.uv_select_mode" + + prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL') + prop.value = "ISLAND" + prop.data_path = "tool_settings.uv_select_mode" class IMAGE_HT_header(bpy.types.Header): diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 02f29c7632c..5bd809fea7e 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -1370,7 +1370,7 @@ class VIEW3D_MT_edit_mesh_specials(bpy.types.Menu): layout.operator("mesh.select_vertex_path") -class VIEW3D_MT_edit_mesh_selection_mode(bpy.types.Menu): +class VIEW3D_MT_edit_mesh_select_mode(bpy.types.Menu): bl_label = "Mesh Select Mode" def draw(self, context): @@ -1397,7 +1397,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): @staticmethod def extrude_options(context): mesh = context.object.data - selection_mode = context.tool_settings.mesh_select_mode + select_mode = context.tool_settings.mesh_select_mode totface = mesh.total_face_sel totedge = mesh.total_edge_sel @@ -1405,7 +1405,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): # the following is dependent on selection modes # we don't really want that -# if selection_mode[0]: # vert +# if select_mode[0]: # vert # if totvert == 0: # return () # elif totvert == 1: @@ -1418,7 +1418,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): # return (0, 2, 3) # else: # return (0, 1, 2, 3) -# elif selection_mode[1]: # edge +# elif select_mode[1]: # edge # if totedge == 0: # return () # elif totedge == 1: @@ -1429,7 +1429,7 @@ class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu): # return (0, 2) # else: # return (0, 1, 2) -# elif selection_mode[2]: # face +# elif select_mode[2]: # face # if totface == 0: # return () # elif totface == 1: @@ -1479,17 +1479,17 @@ class VIEW3D_OT_edit_mesh_extrude_individual_move(bpy.types.Operator): def execute(self, context): mesh = context.object.data - selection_mode = context.tool_settings.mesh_select_mode + select_mode = context.tool_settings.mesh_select_mode totface = mesh.total_face_sel totedge = mesh.total_edge_sel totvert = mesh.total_vert_sel - if selection_mode[2] and totface == 1: + if select_mode[2] and totface == 1: return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [False, False, True]}) - elif selection_mode[2] and totface > 1: + elif select_mode[2] and totface > 1: return bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN') - elif selection_mode[1] and totedge >= 1: + elif select_mode[1] and totedge >= 1: return bpy.ops.mesh.extrude_edges_move('INVOKE_REGION_WIN') else: return bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN') diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 9e071aa4a21..fa055a385f3 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -251,7 +251,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0); /* selection mode */ - WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_selection_mode", TABKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", TABKEY, KM_PRESS, KM_CTRL, 0); /* hide */ WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 565bad987e3..5c4564f1946 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3239,6 +3239,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) /* menus */ WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_select_mode", TABKEY, KM_PRESS, KM_CTRL, 0); ED_object_generic_keymap(keyconf, keymap, 2); |