Operators that create library data without being flaged to UNDO crash when undoing #77249

Closed
opened 2020-06-01 10:35:04 +02:00 by MACHIN3 · 13 comments

System Information
Operating system: Linux-4.15.0-96-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21

Blender Version
Broken: version: 2.83.0 Beta, branch: master, commit date: 2020-05-30 15:33, hash: ec26260132
Worked: 1239cab11f

Short description of error
Using a custom operator to append an object from another file, will crash Blender when undoing right after.
Curiously, the operator has to be called from a menu (like the operator search menu), and won't crash when run from the text editor.

append_obj_undo_crash.zip

Exact steps for others to reproduce the error

  • open the append_obj_undo_crash.blend file from the zip
  • run the script in the text editor to register the AppendUndoCrash operator
  • run Append Undo Crash from the operator search menu in the 3d view
  • undo
**System Information** Operating system: Linux-4.15.0-96-generic-x86_64-with-debian-buster-sid 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 435.21 **Blender Version** Broken: version: 2.83.0 Beta, branch: master, commit date: 2020-05-30 15:33, hash: `ec26260132` Worked: `1239cab11f` **Short description of error** Using a custom operator to append an object from another file, will crash Blender when undoing right after. Curiously, the operator has to be called from a menu (like the operator search menu), and won't crash when run from the text editor. [append_obj_undo_crash.zip](https://archive.blender.org/developer/F8569400/append_obj_undo_crash.zip) **Exact steps for others to reproduce the error** * open the append_obj_undo_crash.blend file from the zip * run the script in the text editor to register the AppendUndoCrash operator * run Append Undo Crash from the operator search menu in the 3d view * undo
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3
MACHIN3 changed title from Appedin an object using an Operator, followed by Undo will crash Blender to Appending an object using an Operator, followed by Undo will crash Blender 2020-06-01 10:35:15 +02:00

Added subscriber: @bent

Added subscriber: @bent

Added subscriber: @ostapblender

Added subscriber: @ostapblender

Yup, have it on WIndows using ec26260132, af3a55bb1b and bba11c68c4. Last one is the earliest and is from 2nd of May.

Yup, have it on WIndows using ec26260132b4, af3a55bb1b and bba11c68c4. Last one is the earliest and is from 2nd of May.

Added subscriber: @Pinnhead

Added subscriber: @Pinnhead

Exactly the same in blender-2.83.0-ec26260132b4-windows64

Exactly the same in blender-2.83.0-ec26260132b4-windows64

Added subscriber: @ideasman42

Added subscriber: @ideasman42

If the operator is adding/removing library data it should use: bl_options = {'REGISTER', 'UNDO'}

A fix for this would likely be to do an undo push, even though the operator didn't request it.

Marking as TODO.

If the operator is adding/removing library data it should use: `bl_options = {'REGISTER', 'UNDO'}` A fix for this would likely be to do an undo push, even though the operator didn't request it. Marking as TODO.
Campbell Barton changed title from Appending an object using an Operator, followed by Undo will crash Blender to Operators that create library data without being flaged to UNDO crash when undoing 2020-06-02 09:32:56 +02:00

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Added subscriber: @mont29

Added subscriber: @mont29

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Bastien Montagne self-assigned this 2020-06-03 12:39:15 +02:00

This is no longer expected to work. As Campbell said, operators affecting Blender data must register for undo. Not doing so was already an issue in the past anyway (undoing would then undo too much things at once), it is now a critical error.

@ideasman42 I would not consider always storing an undo step when operator do not request it, we have quiet a few UI ones that we really do not want to undo ever…

This is no longer expected to work. As Campbell said, operators affecting Blender data must register for undo. Not doing so was already an issue in the past anyway (undoing would then undo too much things at once), it is now a critical error. @ideasman42 I would not consider always storing an undo step when operator do not request it, we have quiet a few UI ones that we really do not want to undo ever…
Author

Thanks for clearing that up.

Thanks for clearing that up.
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
No Assignees
6 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#77249
No description provided.