Maniphest T77249

Operators that create library data without being flaged to UNDO crash when undoing
Closed, ArchivedTO DO

Assigned To
Bastien Montagne (mont29)
Authored By
MACHIN3 (MACHIN3)
Jun 1 2020, 10:35 AM
Tags
  • Datablocks and Libraries
  • BF Blender
Subscribers
Bastien Montagne (mont29)
Bohdan Lvov (ostapblender)
Campbell Barton (campbellbarton)
MACHIN3 (MACHIN3)
ogierm
Piotr (radi0n)
Tokens
"Y So Serious" token, awarded by AnityEx.

Description

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: rBec26260132b4
Worked: rB1239cab11ff9

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.

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

Related Objects

Mentioned In
T63728: Data, Assets & I/O Module
Mentioned Here
rBbba11c68c404: Fix T75995: Cycles render artifacts with overlapping volumes
rBaf3a55bb1b7d: Overlay: Wireframe: Add visualization for Hairs in wireframe mode
rBec26260132b4: GPencil: Fix unreported wrong Sculpt brushes initialization in Templates

Event Timeline

MACHIN3 (MACHIN3) renamed this task 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 .Jun 1 2020, 10:35 AM
MACHIN3 (MACHIN3) created this task.
MACHIN3 (MACHIN3) updated the task description.Jun 1 2020, 10:54 AM
ogierm added a subscriber: ogierm.Jun 1 2020, 10:58 AM
Dalai Felinto (dfelinto) edited projects, added BF Blender (2.83); removed BF Blender.Jun 1 2020, 11:22 AM
Bohdan Lvov (ostapblender) added a subscriber: Bohdan Lvov (ostapblender).Jun 1 2020, 5:00 PM

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

Piotr (radi0n) added a subscriber: Piotr (radi0n).Jun 1 2020, 6:19 PM

Exactly the same in blender-2.83.0-ec26260132b4-windows64

AnityEx (AnityEx) awarded a token.Jun 1 2020, 8:21 PM
Campbell Barton (campbellbarton) added a subscriber: Campbell Barton (campbellbarton).Jun 2 2020, 9:31 AM

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 (campbellbarton) renamed this task 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.Jun 2 2020, 9:32 AM
Campbell Barton (campbellbarton) changed the task status from Needs Triage to Confirmed.
Campbell Barton (campbellbarton) edited projects, added Datablocks and Libraries, BF Blender; removed BF Blender (2.83).
Campbell Barton (campbellbarton) changed the subtype of this task from "Report" to "To Do".
Campbell Barton (campbellbarton) mentioned this in T63728: Data, Assets & I/O Module.
Bastien Montagne (mont29) closed this task as Archived.Jun 3 2020, 12:39 PM
Bastien Montagne (mont29) claimed this task.
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).

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.

@Campbell Barton (campbellbarton) 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…

MACHIN3 (MACHIN3) added a comment.Jun 3 2020, 12:41 PM

Thanks for clearing that up.