Address a long standing limitation with undo: where edit-mode often
prevented edits in other areas from being tracked by undo.
Allows properties in the object/scene to be adjusted while in edit-mode
supporting undo for both edit-mode and global undo steps to co-exist.
Details:
- This works by encoding undo with a "hint"
that the change includes MEMFILE undo changes.
- This hint can be created from property edits -
where we know which kind of property is being edited.
- It can also be calculated before adding a generic undo step,
to check if other data needs a global undo step
(editing a scene or object while in edit-mode for e.g.).
- The undo system checks for this hint and adds a hidden "pre"
MEMFILE undo step in these cases
(the initial MEMFILE undo step is already done at times,
we make use of that).
- Eventually the mode-specific undo step creation can be skipped,
this has been left out as it's a larger change which impacts
each undo system.
- Added tests to support mixing edit-mode mesh and 3d text
with MEMFILE undo.
- When pushing undo steps a check for changes outside
the mode is performed (in parallel, per ID type),
in my own tests the ID scanning overhead is negligible,
even on heavy files.
Resolves: #50423, #75013, #153282.
Ref !161566
Entering Edit Mode on a mesh with shape keys could copy the final
mesh component after it had already been shared with the edit cage.
The generic component copy did not preserve all
runtime state required by the Edit Mode BMesh wrapper.
The copied final result was subsequently handled by
`MeshRenderData` through the regular `MeshExtractType::Mesh` path,
as though it were an array-backed mesh.
Viewport extraction then attempted to access mesh arrays that
were not available and asserted in `Mesh::faces()`.
Assign the evaluated shape key before sharing the final mesh
component with either the explicit or fallback cage. In Object Mode,
retrieve the final mesh pointer after potential writable
access so copy-on-write cannot leave a stale pointer.
Also add an undo test that would have caught this regression.
Ref !161986
Particle Edit undo restored its mode by calling
`ED_object_particle_edit_mode_enter_ex()` directly.
When the undo step was decoded while Texture Paint was active, the
previous mode was not exited first. Since Particle Edit mode entry adds
its mode bit with `|=`, the object ended up with the invalid combined
mode `48` (`TEXTURE_PAINT | PARTICLE_EDIT`).
Exit the current mode through its normal lifecycle before restoring
Particle Edit, following the same pattern used by sculpt undo.
Files that were already saved with mode `48` crashed during editor
initialization because `object_mode_op_string()` returned `nullptr`.
Unsupported saved modes are now rejected safely, leaving the object in
Object Mode while preserving its particle and hair data so the file can
be resaved.
Pull Request: https://projects.blender.org/blender/blender/pulls/161542
* Some functions were copied between tests, now import a common
module for these.
* Merge _test_vars and _test_window into a single function, and
use the window index instead of excluding windows.
* Rename idle_until to not be a hack, and explain that it can be
used for testing operator jobs while keeping the disclaimer that
it should not typically be used.
Pull Request: https://projects.blender.org/blender/blender/pulls/153159
When in Texture Paint mode or in the image editor, certain actions do
not push undo steps (e.g. changing the active texture) that users would
expect. Additionally, some actions that *do* push undo steps (e.g.
changing face selection) have no effect when undone.
To fix the former, remove the code preventing property changes from
pushing undo steps while in Texture Paint mode.
To fix the latter, remove the poll function from `image_undo.cc`. This
prevents global undo steps from being tagged as image undo steps.
This works because the `poll` function is only needed when creating the
undo step to identify steps that do not have a `step_init` defined.
This is similar to, but notably different from !139871:
Image Undo (and Sculpt Undo) store deltas encoded as part of the undo
step and require explicit tagging of the begin and end state (see
`ED_image_undo_push_begin` and `ED_image_undo_push_end`). This allows
us to use memfile undo in the general case and image undo when
explicitly requested, avoiding the memory concerns of the previously
linked PR.
Addresses: #69346, #62520, #71895
Pull Request: https://projects.blender.org/blender/blender/pulls/151399
This commit changes the constant, fixed time delay when running UI
tests that use multiple windows to one that waits until either a second
has elapsed or the created windows have different view layers by
idling in increments of 1/60th of a second.
This is strictly a fix to get the test to work again on both buildbots
and developer workstations, further root-causing and fixes will happen
separately.
Fixes#148877
Pull Request: https://projects.blender.org/blender/blender/pulls/148623
This commit bumps up the time delay while running these tests from
1/60th of a second to 1/6th of a second to ensure that the new window
is created prior to the rest of the test running while.
Pull Request: https://projects.blender.org/blender/blender/pulls/146309
For Sculpt Undo, certain operators will modify the topology count of the
mesh. These operators are handled separately from normal brush strokes,
and so having tests for an operator that uses this functionality is
beneficial in detecting regressions.
Pull Request: https://projects.blender.org/blender/blender/pulls/139249
After creating a new scene in a separate window when performing UI
tests, the respective view layer for the window may not be updated
immediately in the event loop.
Previously, this was mitigated with a single `yield` statement that
would delay processing by a single tick. To fix this issue, this commit
adds the capability to yield for a specific `timedelta` and waits this
amount of time for the two affected tests.
Pull Request: https://projects.blender.org/blender/blender/pulls/136012
Correct the event coordinates by scaling by the pixel_size on macOS.
All the UI tests now pass on macOS.
Ref !136008
Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
The inclusion of "Add -> Image -> Mesh Plane" causes the menu search
for "Add -> Mesh -> Plane" to attempt to add the image plane.
Workaround the problem by searching for an exact match,
although I think this should be possible to search for menu items
without having to include their shortcuts, especially since these
can be platform dependent.
- "can not" -> "cannot" in many places (ambiguous, also see
Writing Style guide).
- "Bezier" -> "Bézier": proper spelling of the eponym.
- Tool keymaps: make "Uv" all caps.
- "FFMPEG" -> "FFmpeg" (official spelling)
- Use MULTIPLICATION SIGN U+00D7 instead of MULTIPLICATION X U+2715.
- "LClick" -> "LMB", "RClick" -> "RMB": this convention is used
everywhere else.
- "Save rendered the image..." -> "Save the rendered image...": typo.
- "Preserve Current retiming": title case for property.
- Bend status message: punctuation.
- "... class used to define the panel" -> "header": copy-paste error.
- "... class used to define the menu" -> "asset": copy-paste error.
- "Lights user to display objects..." -> "Lights used...": typo.
- "-setaudio require one argument" -> "requires": typo.
Some issues reported by Joan Pujolar and Tamar Mebonia.
Pull Request: https://projects.blender.org/blender/blender/pulls/117856