diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-08-13 16:04:37 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-08-13 16:04:49 +0400 |
commit | 95da9347b590540de9e10efe32d2da27254d4d75 (patch) | |
tree | 962ab510cb62e043bc208a199a3b09734c873096 | |
parent | 5b1f78e2d98efe8db5c111e6b97b8a13914810c0 (diff) |
Bring back python operator for pies on a certain operator property.
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 15e482a5e63..2ee37b97efe 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -556,6 +556,37 @@ class WM_OT_context_pie_enum(Operator): return {'FINISHED'} +class WM_OT_operator_pie_enum(Operator): + bl_idname = "wm.operator_pie_enum" + bl_label = "Operator Enum Pie" + bl_options = {'UNDO', 'INTERNAL'} + data_path = rna_path_prop + prop_string = StringProperty( + name="Property", + description="Property name (as a string)", + maxlen=1024, + ) + + def invoke(self, context, event): + op = eval("bpy.ops.%s" % self.data_path) + + if not op: + return {'PASS_THROUGH'} + + title = op.get_rna().bl_rna.name + op_name = self.data_path + prop_name = self.prop_string + + def draw_cb(self, context): + layout = self.layout + pie = layout.menu_pie() + pie.operator_enum(op_name, prop_name) + + context.window_manager.popup_menu_pie(draw_func=draw_cb, title=title, event=event) + + return {'FINISHED'} + + class WM_OT_context_set_id(Operator): """Set a context value to an ID data-block""" bl_idname = "wm.context_set_id" |