diff options
author | Ton Roosendaal <ton@blender.org> | 2009-07-29 21:56:38 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-07-29 21:56:38 +0400 |
commit | 4a1266baadf2251bf19ac8ebe15e334273b1f5a3 (patch) | |
tree | bfe8d1125ed33ab1732a718c7539d3be6081fa5f /source/blender/windowmanager/WM_api.h | |
parent | fa7a2091f1afb50e276730c5fdc0ff4b7141f327 (diff) |
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
Diffstat (limited to 'source/blender/windowmanager/WM_api.h')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 0d3ad96d8c3..f65e5b1b077 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -158,6 +158,10 @@ void WM_operatortype_append (void (*opfunc)(wmOperatorType*)); void WM_operatortype_append_ptr (void (*opfunc)(wmOperatorType*, void *), void *userdata); int WM_operatortype_remove(const char *idname); +wmOperatorType *WM_operatortype_append_macro(char *idname, char *name, int flag); +wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char *idname); + + int WM_operator_call (struct bContext *C, struct wmOperator *op); int WM_operator_repeat (struct bContext *C, struct wmOperator *op); int WM_operator_name_call (struct bContext *C, const char *opstring, int context, struct PointerRNA *properties); |