Crash undoing after bpy.data.objects.remove() in editmode #65681
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#65681
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
{F7097143}System Information
Operating system: Windows 10
Graphics card: Intel
Blender Version
blender-2.80.0-git.030c7df19da9-windows64
Short description of error
Blender crashes when undo is called if a lattice object is deleted in edit mode via an operator addon
Exact steps for others to reproduce the error
install the addon in the attachment (copy it to addons or as zip)
open the addon tab and search for "crasher"
enable it
open the
violation.blend
file that is in the addon folder (or from the zip file)it should open in lattice (active) edit mode, if not select the lattice and toggle to edit mode
F3, search for simple operator
execute it
do not do anything else, just do
undo
(ctrl-z)Blender will exit with
It seems like it is possible to avoid the crash only if the user does some other stuff like selecting moving other objects after firing the addon however this does not help with the addon context, not possible to avoid this as far as I can tell.
I originally thought that using
bpy.data.objects.remove(l)
was causing this however using the ops equivalentbpy.ops.object.delete(use_global=False)
does the same ill affect.Added subscriber: @kursadk
Here is an strace of when it crashed, I got it under Winx64 10, MSYS. Probably not that useful
Added subscriber: @lichtwerk
Backtrace is a bit misleading [since this is reproducable without animation_nodes enabled], but can confirm, checking...
Deleting from the UI has a valid
Lattice->editlatt
inlattice_undosys_poll
/editlatt_object_from_context
whereas doing this from python doesnt...Blender crashes with EXCEPTION_ACCESS_VIOLATION when undoingto Crash undoing a removal of a lattice via python@lichtwerk
Thanks for conforming the bug. Do you know a work around with the API so I can avoid the crash until this is fixed?
It seems like this bug not just affecting undo delete but also it crashes Blender after undoing lattice naming and other Lattice objct related operations
Added subscriber: @JosephEagar
Okay, looks like the problem is with the undo system; if you manually exit editmode then push the understack, e.g.:
bpy.ops.object.editmode_toggle()
bpy.ops.ed.undo_push()
the crash won't happen.
I imagine this could be tricky to fix; it might be a good idea to prohibit python deletion of objects in editmode.
Added subscriber: @ideasman42
As far as I can tell the solution recommended by @JosephEagar works in this case. I will test it further but I was able to overcome the hard crashes I have been facing when ediitng the lattice in an operator.
Reconfirmed, true for all object types that support editmode...
Crash undoing a removal of a lattice via pythonto Crash undoing after bpy.data.objects.remove() in editmodeClosed as duplicate of #77557