Refactor: Sculpt: Avoid storing extra undo data on geometry_push #129828

Merged
Sean Kim merged 3 commits from Sean-Kim/blender:remove-extra-undo-data-geometry-push into main 2024-11-14 02:08:02 +01:00
Member

Currently, Sculpt Mode's UndoStep stores two main categories of data,
the first category is valid for undo pushes where individual nodes of a
mesh are modified, the second category is when the entire mesh is
changed.

To avoid extra processing of data and move towards reducing and
simplifying the amount of data each of these types of undo operations
need, this commit strips down the data stored when a geometry_push step
is called.

Additionally, there are some areas in the code which called
BKE_sculpt_update_object_for_edit as a requirement for the undo step
data, these calls have been removed.


Testing:

  • Undo / Redo on mesh with color attributes and performing remesh operations
  • Undo / Redo with shape key data
  • Undo / Redo with trim tools
    • Base Mesh
    • Deform Modifier
Currently, Sculpt Mode's UndoStep stores two main categories of data, the first category is valid for undo pushes where individual nodes of a mesh are modified, the second category is when the entire mesh is changed. To avoid extra processing of data and move towards reducing and simplifying the amount of data each of these types of undo operations need, this commit strips down the data stored when a geometry_push step is called. Additionally, there are some areas in the code which called `BKE_sculpt_update_object_for_edit` as a requirement for the undo step data, these calls have been removed. --- Testing: * Undo / Redo on mesh with color attributes and performing remesh operations * Undo / Redo with shape key data * Undo / Redo with trim tools * Base Mesh * Deform Modifier
Sean Kim added 1 commit 2024-11-05 00:42:29 +01:00
Currently, Sculpt Mode's UndoStep stores two main categories of data,
the first category is valid for undo pushes where individual nodes of a
mesh are modified, the second category is when the entire mesh is
changed.

To avoid extra processing of data and move towards reducing and
simplifying the amount of data each of these types of undo operations
need, this commit strips down the data stored when a geometry_push step
is called.

Additionally, there are some areas in the code which called
`BKE_sculpt_update_object_for_edit` as a requirement for the undo step
data, these calls have been removed.
Sean Kim added this to the Module: Sculpt, Paint & Texture project 2024-11-05 00:42:36 +01:00
Sean Kim requested review from Hans Goudey 2024-11-05 00:44:41 +01:00
Hans Goudey requested changes 2024-11-05 10:40:50 +01:00
Hans Goudey left a comment
Member

I'm actually not sure why/how not storing data like pivot_pos and the active color attribute is correct for geometry/full undo steps. I wouldn't expect the requirements for those to be different TBH. In the future moving to behavior that mirrors object mode (push a separate undo step for these things) might make that possible, but right now I don't think so.

I'm actually not sure why/how not storing data like `pivot_pos` and the active color attribute is correct for geometry/full undo steps. I wouldn't expect the requirements for those to be different TBH. In the future moving to behavior that mirrors object mode (push a separate undo step for these things) might make that possible, but right now I don't think so.
Author
Member

I'm actually not sure why/how not storing data like pivot_pos and the active color attribute is correct for geometry/full undo steps. I wouldn't expect the requirements for those to be different TBH. In the future moving to behavior that mirrors object mode (push a separate undo step for these things) might make that possible, but right now I don't think so.

Yeah, you're right. I'm actually not sure how this continues to work with this current commit, I suppose I didn't hit a case that would actually trigger any odd behavior?

> I'm actually not sure why/how not storing data like `pivot_pos` and the active color attribute is correct for geometry/full undo steps. I wouldn't expect the requirements for those to be different TBH. In the future moving to behavior that mirrors object mode (push a separate undo step for these things) might make that possible, but right now I don't think so. Yeah, you're right. I'm actually not sure how this continues to work with this current commit, I suppose I didn't hit a case that would actually trigger any odd behavior?
Member

Yeah the odd behavior would come from using undo/redo with the transform tools or after changing the active shape key. Splitting away the per node storage is nice, but generally I don't know what we gain by removing this small extra data from the geometry undo step.

Yeah the odd behavior would come from using undo/redo with the transform tools or after changing the active shape key. Splitting away the per node storage is nice, but generally I don't know what we gain by removing this small extra data from the geometry undo step.
Sean Kim added 1 commit 2024-11-12 00:03:30 +01:00
PR Feedback
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
8f804884b4
Author
Member

@blender-bot build

@blender-bot build
Sean Kim requested review from Hans Goudey 2024-11-12 00:06:20 +01:00
Hans Goudey approved these changes 2024-11-13 23:55:18 +01:00
@ -1726,3 +1726,3 @@
}
void push_begin_ex(const Scene & /*scene*/, Object &ob, const char *name)
static void save_attribute_data(Object &ob, SculptUndoStep *us)
Member

maybe save_extra_data or save_common_data since this isn't just attributes?

maybe `save_extra_data` or `save_common_data` since this isn't just attributes?
Sean Kim added 1 commit 2024-11-14 00:27:40 +01:00
Rename, add comment
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
294c308767
Author
Member

@blender-bot build

@blender-bot build
Sean Kim merged commit 6b7ba4c726 into main 2024-11-14 02:08:02 +01:00
Sean Kim deleted branch remove-extra-undo-data-geometry-push 2024-11-14 02:08:14 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#129828
No description provided.