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/makesdna/DNA_windowmanager_types.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/makesdna/DNA_windowmanager_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index a7ad502d438..704acbfd52b 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -173,6 +173,18 @@ typedef struct wmWindow { # # +typedef struct wmOperatorTypeMacro { + struct wmOperatorTypeMacro *next, *prev; + + /* operator id */ + char idname[MAX_ID_NAME]; + /* rna pointer to access properties, like keymap */ + struct PointerRNA *ptr; + +} wmOperatorTypeMacro; + +# +# typedef struct wmOperatorType { struct wmOperatorType *next, *prev; @@ -204,6 +216,9 @@ typedef struct wmOperatorType { /* rna for properties */ struct StructRNA *srna; + /* struct wmOperatorTypeMacro */ + ListBase macro; + short flag; /* pointer to modal keymap, do not free! */ @@ -265,9 +280,13 @@ typedef struct wmOperator { /* runtime */ wmOperatorType *type; /* operator type definition from idname */ void *customdata; /* custom storage, only while operator runs */ + struct PointerRNA *ptr; /* rna pointer to access properties */ struct ReportList *reports; /* errors and warnings storage */ + ListBase macro; /* list of operators, can be a tree */ + struct wmOperator *opm; /* current running macro, not saved */ + } wmOperator; /* operator type exec(), invoke() modal(), return values */ |