Age | Commit message (Collapse) | Author |
|
This adds support for treating multiple undo steps as a single step
from the user perspective.
This is needed for outliner mode switching and `object.switch_object`
operator which change active object and mode in a single action.
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
|
|
|
|
The feature is hidden behind an experimental option, you'll have to
enable it in the preferences to try it.
This feature is not yet considered fully stable, crashes may happen, as
well as .blend file corruptions (very unlikely, but still possible).
In a nutshell, the ideas behind this code are to:
* Detect unchanged IDs across an undo step.
* Reuse as much as possible existing IDs memory, even when its content
did change.
* Re-use existing depsgraphs instead of building new ones from scratch.
* Store accumulated recalc flags, to avoid needless re-compute of things
that did not change, when the ID itself is detected as modified.
See T60695 and D6580 for more technical details.
|
|
|
|
PaintCurve data ID data wasn't being remapped.
Error in initial undo refactor.
|
|
Removing this since it was added for TexFace support
which has since been removed.
|
|
Partial fix for T61263, however mem-file undo sometimes reloads imbuf's.
|
|
This is needed step out of undo steps which accumulate changes,
larger changes could be made to handle this but better not
make them at this point.
|
|
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
This complicated handling of undo steps in a generic way
especially switching between undo systems that stored data to ones
that accumulated changes.
Now each undo system must treat it's steps as check-point,
internally it can apply/rewind changes.
This commit also fixes projection paint where the object mode wasn't
following the undo steps.
|
|
Useful for debugging.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
Needed since we don't always have the context,
and avoids adding G_MAIN into undo callbacks.
|
|
Add the ability for undo steps to request memfile undo step added after
them, useful for mode switching, where we need the data to exist for
undo to enter the mode.
|
|
Currently names are used for edit-mode undo-steps,
any changes to Main ID names cause lookup failure (crashing).
This commit ensures any undo steps that use ID lookups have the same
mem-file undo state loaded that was used to encode the steps.
Renaming also has an undo push added (last commit).
|
|
For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.
|
|
It's important edit-mode has a step stored for redo to work,
file load now ensures this in a generic way.
|
|
Error in 651b8fb14e caused de-duplication to fail.
|
|
Also improve logging
|
|
Add versions of add/lookup that check the previous item.
|
|
- 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
|