diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-07 02:43:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-07 02:43:09 +0400 |
commit | 59ac5b0930a2a0f47c4243df4ec323d7a24278c0 (patch) | |
tree | 48b9193b27af4cea99f5b99491c862094398990f /release | |
parent | 6b6d6304e26f0c2ec830ed4a272fb87215c49a06 (diff) |
in response to bug [#23701] Edit Mode: unable to bind vertex/edge/face select modes to keys
while not a bug, being able to cycle over vertex/edge/face modes is useful. added an operator to cycle an array, could be used for cycling the active layer or mesh edit mode.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/wm.py | 28 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref_keymap.py | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py index c5f465a435a..e83fa5d57e5 100644 --- a/release/scripts/op/wm.py +++ b/release/scripts/op/wm.py @@ -326,6 +326,34 @@ class WM_OT_context_cycle_enum(bpy.types.Operator): return {'FINISHED'} +class WM_OT_context_cycle_array(bpy.types.Operator): + '''Set a context array value. + Useful for cycling the active mesh edit mode.''' + bl_idname = "wm.context_cycle_array" + bl_label = "Context Array Cycle" + bl_options = {'UNDO'} + + data_path = rna_path_prop + reverse = rna_reverse_prop + + def execute(self, context): + data_path = self.properties.data_path + value = context_path_validate(context, data_path) + if value is Ellipsis: + return {'PASS_THROUGH'} + + def cycle(array): + if self.properties.reverse: + array.insert(0, array.pop()) + else: + array.append(array.pop(0)) + return array + + exec("context.%s=cycle(context.%s[:])" % (data_path, data_path)) + + return {'FINISHED'} + + class WM_OT_context_set_id(bpy.types.Operator): '''Toggle a context value.''' bl_idname = "wm.context_set_id" diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index c3b56cf757c..b79a53e198f 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -285,6 +285,8 @@ class InputKeyMapPanel(bpy.types.Panel): if km.is_modal: sub.prop(kmi, "propvalue", text="") else: + # One day... + # sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="") sub.prop(kmi, "idname", text="") sub = split.column() |