Fix #87243: Crash after undo "Mask slice to new object" #119443

Merged
Raul Fernandez Hernandez merged 2 commits from farsthary/blender:mask-slice-fix into blender-v4.1-release 2024-03-14 17:02:11 +01:00

Fix for a crash after undo "Mask slice to new object"

When creating a new mesh object in the mask slice operator in
sculpt mode it caused a crash when undo to the initial undo step.
Moreover saving the sculpt undo state seems not necessary in
this function since undo/redo doesn't really work reliably for this
operator from the start, but there is nothing can be done about it
without systemic changes.

Note: this PR replaces #119401

Fix for a crash after undo "Mask slice to new object" When creating a new mesh object in the mask slice operator in sculpt mode it caused a crash when undo to the initial undo step. Moreover saving the sculpt undo state seems not necessary in this function since undo/redo doesn't really work reliably for this operator from the start, but there is nothing can be done about it without systemic changes. Note: this PR replaces #119401
Raul Fernandez Hernandez added 2 commits 2024-03-13 21:25:57 +01:00
Raul Fernandez Hernandez added the
Module
Sculpt, Paint & Texture
label 2024-03-13 21:28:09 +01:00
Sergey Sharybin was assigned by Raul Fernandez Hernandez 2024-03-13 21:29:14 +01:00
Hans Goudey was assigned by Raul Fernandez Hernandez 2024-03-13 21:29:14 +01:00
Raul Fernandez Hernandez requested review from Sergey Sharybin 2024-03-13 21:32:19 +01:00
Raul Fernandez Hernandez requested review from Hans Goudey 2024-03-13 21:32:20 +01:00
Sergey Sharybin was unassigned by Raul Fernandez Hernandez 2024-03-13 21:32:37 +01:00
Hans Goudey was unassigned by Raul Fernandez Hernandez 2024-03-13 21:32:37 +01:00
Raul Fernandez Hernandez self-assigned this 2024-03-13 21:32:43 +01:00

Moreover saving the sculpt undo state seems not necessary in this function since undo/redo works anyways.

It does not seem to be working: the mask attribute seems to be lost, and the initial geometry of the object is not preserved, with some notes:

  • Testing this is a bit annoying, since the operator changes the active object, which is not restored by the undo. I think this is because when operator run a local sculpt undo system is used, which does not cover changes of active object.
  • This behavior does not seem to be changed comparing to the current main branch (tested by undoing to the state proir to which Blender crashes)

I've tried to find a safe solution which does not require a huge amount of system redesign and I couldn't have found one. The operator is kind of a violation of a design of local modes which are not supposed to be doing global changes (such as adding new objects from sculpt/edit modes).

To is is probably fine to go with the suggested change, but we need to change the way it is adertized from "undo/redo works anyways" to "undo/redo doesn't really work reliably, but there is nothing can be done about it without more global changes" type of a thing.

> Moreover saving the sculpt undo state seems not necessary in this function since undo/redo works anyways. It does not seem to be working: the mask attribute seems to be lost, and the initial geometry of the object is not preserved, with some notes: - Testing this is a bit annoying, since the operator changes the active object, which is not restored by the undo. I think this is because when operator run a local sculpt undo system is used, which does not cover changes of active object. - This behavior does not seem to be changed comparing to the current main branch (tested by undoing to the state proir to which Blender crashes) I've tried to find a safe solution which does not require a huge amount of system redesign and I couldn't have found one. The operator is kind of a violation of a design of local modes which are not supposed to be doing global changes (such as adding new objects from sculpt/edit modes). To is is probably fine to go with the suggested change, but we need to change the way it is adertized from "undo/redo works anyways" to "undo/redo doesn't really work reliably, but there is nothing can be done about it without more global changes" type of a thing.
Author
Member

Moreover saving the sculpt undo state seems not necessary in this function since undo/redo works anyways.

It does not seem to be working: the mask attribute seems to be lost, and the initial geometry of the object is not preserved, with some notes:

  • Testing this is a bit annoying, since the operator changes the active object, which is not restored by the undo. I think this is because when operator run a local sculpt undo system is used, which does not cover changes of active object.
  • This behavior does not seem to be changed comparing to the current main branch (tested by undoing to the state proir to which Blender crashes)

I've tried to find a safe solution which does not require a huge amount of system redesign and I couldn't have found one. The operator is kind of a violation of a design of local modes which are not supposed to be doing global changes (such as adding new objects from sculpt/edit modes).

To is is probably fine to go with the suggested change, but we need to change the way it is adertized from "undo/redo works anyways" to "undo/redo doesn't really work reliably, but there is nothing can be done about it without more global changes" type of a thing.

Thanks! Agree, that's what I found too, the operator from the beginning messes up the undo/redo with the change of the active object, the change from sculpt mode to object mode, etc that will require a deeper system refactor.

> > Moreover saving the sculpt undo state seems not necessary in this function since undo/redo works anyways. > > It does not seem to be working: the mask attribute seems to be lost, and the initial geometry of the object is not preserved, with some notes: > - Testing this is a bit annoying, since the operator changes the active object, which is not restored by the undo. I think this is because when operator run a local sculpt undo system is used, which does not cover changes of active object. > - This behavior does not seem to be changed comparing to the current main branch (tested by undoing to the state proir to which Blender crashes) > > I've tried to find a safe solution which does not require a huge amount of system redesign and I couldn't have found one. The operator is kind of a violation of a design of local modes which are not supposed to be doing global changes (such as adding new objects from sculpt/edit modes). > > To is is probably fine to go with the suggested change, but we need to change the way it is adertized from "undo/redo works anyways" to "undo/redo doesn't really work reliably, but there is nothing can be done about it without more global changes" type of a thing. Thanks! Agree, that's what I found too, the operator from the beginning messes up the undo/redo with the change of the active object, the change from sculpt mode to object mode, etc that will require a deeper system refactor.
Raul Fernandez Hernandez merged commit 2e7395e07b into blender-v4.1-release 2024-03-14 17:02:11 +01:00
Raul Fernandez Hernandez deleted branch mask-slice-fix 2024-03-14 17:02:17 +01:00
Sign in to join this conversation.
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
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#119443
No description provided.