Undo: Always fallback to memfile undo #110022
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110022
Loading…
Reference in New Issue
No description provided.
Delete Branch "filedescriptor/blender:undo-memfile-default-fallback-all-modes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously, memfile undo would not work for objects in edit mode.
But we should allow to fallback to memfile for e.g. objects like
point clouds, curves, or grease pencil 3, where no special edit mode
undo system is needed because they do not have any runtime edit data.
The memfile undo system poll function only runs after all the other
undo systems have been polled. Any object that uses a special undo
system for a particular mode already implements this undo system.
Does this make the curves undo system
ED_curves_undosys_type
unnecessary?@HooglyBoogly In theory, yes. In practice, it might be a lot slower in some cases. But it's not like the curves undo system is really optimized for anything.
6fa9b8d109
to70cc6f1520
Am not sure about these changes, but this is also not really my area of expertise. Would rather let @ideasman42 check on this first.
To check if this patch causes problems I updated the undo tests which weren't working after recent menu search changes.
While all tests passed, I was testing this patch and managed to get a crash which I've now added a test for.
The test can be run with the following command:
A while ago I looked into loading memfile undo steps in edit-mode and recall it was overly complicated to properly support (although it would be good to support, since it would allow for changing scene settings for e.g. to be tracked while in edit-mode).
Either this crash needs to be investigated, or we could differentiate between object types that support MEMFILE undo or not.
To run all undo tests replace
--tests "test_undo.view3d_edit_mode_multi_window"
with--tests "*"
.There's a PR to make these tests part of CTest #114164.
Thanks for fixing the tests and running them on the patch.
I'm not sure I follow here. Don't we already do this? If we look at
ED_undosys_type_init
andBKE_undosys_type_from_context
we can see that the memfile undo system is pushed last so that it acts like the fallback. Any object type that doesn't support memfile will have pushed it's own undo system before that.From the main PR text:
So this patch could be modified only to change behavior for those object types and keep the current behavior for edit-mesh, edit-text ... etc.
Hm well the idea for this patch is that we wouldn't have to do this anymore. Basically, any object type that needs a special undo system can define their own, but any new object type that doesn't need a special undo system shouldn't have to define their own if it's not needed and just use memfile by default.
I'll try and see what the issue is with the test and try and fix it.
@ideasman42 This patch below fixes the crash for me. Maybe this just happend to work before because of some assumptions made?
@filedescriptor the problem with this change is it means there is the state where the object-data is in edit-mode but there is no run-time edit-mode data.
Even after the fix you mention withing ~2min I was able to cause another crash, just testing undo/redo with multiple windows & different object types.
Error: Unable to execute 'Toggle Edit Mode', error changing modes
with armatures.I'd like to double check none none of these issues exist without this patch & improve on existing tests, I can't be sure as I'm just testing various actions after applying the patch, nevertheless I'm quite sure some of them are introduced by this patch (issues caused by missing run-time data at least).
If we add null check results the crash, the result will still be invalid/buggy from a user perspective - further it moves the problem to become the responsibility of each operator/add-on. After this PR, it's not enough to check if the object is in edit-mode, it must also be checked for the mode's run-time data exists. These kinds of states are worth avoiding where possible as they're often overlooked during development and can easily cause crashes or strange bugs that make blender feel glitchy/broken from a user perspective - even if the worst crashes are avoided.
It should be possible to gain most of the benefits of this patch while ensuring we never have objects in edit-mode without their run-time edit-mode data.
@filedescriptor not sure if you want to keep working on this one?
I didn't have the time to come back to this one. I think it would be good to look into this in the future though.
Checkout
From your project repository, check out a new branch and test the changes.