Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rw-r--r--release/scripts/op/wm.py28
-rw-r--r--release/scripts/ui/space_userpref_keymap.py2
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()