Age | Commit message (Collapse) | Author |
|
Split out undo API from ED_util.h into ED_undo.h
|
|
- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
undo data is restored.
- Some undo types accumulate changes (image & text editing)
others store the state multiple times (with de-duplication).
This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
manage restoring correct ID's.
Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
Previously this wasn't done, making history fail in some cases.
This can be optimized to skip some combinations of undo steps.
grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.
See D3113
|
|
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|
|
also removed some unused function definitons.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
- fix: user pref, window title was reset to 'Blender' on tab usage
- Undo history menu back:
- name "Undo History"
- hotkey alt+ctrl+z (alt+apple+z for mac)
- works like 2.4x, only for global undo, editmode and particle edit.
- Menu scroll
- for small windows or screens, popup menus now allow to display
all items, using internal scrolling
- works with a timer, scrolling 10 items per second when mouse
is over the top or bottom arrow
- if menu is too big to display, it now draws to top or bottom,
based on largest available space.
- also works for hotkey driven pop up menus.
- User pref "DPI" follows widget/layout size
- widgets & headers now become bigger and smaller, to match
'dpi' font sizes. Works well to match UI to monitor size.
- note that icons can get fuzzy, we need better mipmaps for it
|
|
|
|
|
|
|
|
The tool-redo depends on a working undo system, so it can rewind
a step and then redo operator with new settings. When a user
disables undo, this won't work.
Now the properties for redo operator (toolbar, F6) will grey out
when a redo isn't possible.
|
|
|
|
|
|
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...
|
|
- Edit mode Mesh undo/redo back
(undo for editmodes needed recode, todo for curve/lattice/etc)
- Added border select for edit mesh
- Added Akey (de)select all for edit mesh
- Added notifiers for mode changes.
This is also the first trial to dynamically add/remove
keymap handlers, based on modes. For that reason the Object
keymap was split in 2, modal and non-modal. On TABkey, the
view3d listener removes and adds maps.
The view3d keymap still handles generic mouse/border selection.
Internally it will verify modes.
The modes are not re-implemented still... have to move this
to scene context.
|