diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-08 20:59:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-08 20:59:06 +0400 |
commit | 5f40c0e9a5b5665e559b441c7659050ff861931d (patch) | |
tree | a1ab1fe645405794053a16a1f2d0c6ea5b1d3839 /release | |
parent | 51ead63ae6a9e032af892058f132f12933f4c138 (diff) |
- operator presets now work in the 3D view as well as the file selector.
to enable from python:
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
from C:
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_PRESET;
- added context member 'active_operator'
- enable this for 'Add Torus' for testing.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/add_mesh_torus.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/presets.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_operators/add_mesh_torus.py b/release/scripts/startup/bl_operators/add_mesh_torus.py index 056b3478c2b..5b28cdf44ae 100644 --- a/release/scripts/startup/bl_operators/add_mesh_torus.py +++ b/release/scripts/startup/bl_operators/add_mesh_torus.py @@ -86,7 +86,7 @@ class AddTorus(Operator): '''Add a torus mesh''' bl_idname = "mesh.primitive_torus_add" bl_label = "Add Torus" - bl_options = {'REGISTER', 'UNDO'} + bl_options = {'REGISTER', 'UNDO', 'PRESET'} major_radius = FloatProperty( name="Major Radius", diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index ac19bab4c66..dca96b302fb 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -395,9 +395,8 @@ class AddPresetOperator(AddPresetBase, Operator): options={'HIDDEN'}, ) - # XXX, not ideal preset_defines = [ - "op = bpy.context.space_data.operator", + "op = bpy.context.active_operator", ] @property @@ -432,7 +431,7 @@ class WM_MT_operator_presets(Menu): bl_label = "Operator Presets" def draw(self, context): - self.operator = context.space_data.operator.bl_idname + self.operator = context.active_operator.bl_idname Menu.draw_preset(self, context) @property |