Blender Git Loki

Git Commits -> Revision 4a1266b

Revision 4a1266b by Ton Roosendaal (master)
July 29, 2009, 17:56 (GMT)
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...

Commit Details:

Full Hash: 4a1266baadf2251bf19ac8ebe15e334273b1f5a3
SVN Revision: 22019
Parent Commit: fa7a209
Lines Changed: +360, -60

21 Modified Paths:

/source/blender/blenkernel/BKE_blender.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/blender.c (+16, -0) (Diff)
/source/blender/editors/include/ED_util.h (+1, -0) (Diff)
/source/blender/editors/interface/interface_handlers.c (+2, -2) (Diff)
/source/blender/editors/mesh/editmesh_add.c (+0, -3) (Diff)
/source/blender/editors/mesh/editmesh_tools.c (+7, -7) (Diff)
/source/blender/editors/mesh/mesh_ops.c (+19, -3) (Diff)
/source/blender/editors/object/object_edit.c (+2, -2) (Diff)
/source/blender/editors/object/object_ops.c (+10, -1) (Diff)
/source/blender/editors/space_view3d/view3d_edit.c (+12, -12) (Diff)
/source/blender/editors/space_view3d/view3d_ops.c (+2, -2) (Diff)
/source/blender/editors/space_view3d/view3d_toolbar.c (+22, -8) (Diff)
/source/blender/editors/util/editmode_undo.c (+15, -0) (Diff)
/source/blender/editors/util/undo.c (+31, -15) (Diff)
/source/blender/editors/util/util_intern.h (+1, -0) (Diff)
/source/blender/makesdna/DNA_windowmanager_types.h (+19, -0) (Diff)
/source/blender/windowmanager/intern/wm.c (+6, -0) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+50, -4) (Diff)
/source/blender/windowmanager/intern/wm_operators.c (+139, -1) (Diff)
/source/blender/windowmanager/WM_api.h (+4, -0) (Diff)
/source/blender/windowmanager/WM_types.h (+1, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021