Blender crash when selecting and moving vertex using API #85899
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85899
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?
System Information
Operating system: Linux Mint 20 Ulyana
Graphics card: NVIDIA GeForce RTX 2060 Super
Blender Version
Broken: 2.91.2,
5be9ef4177
, master, 2021-01-19Exact steps for others to reproduce the error
Blender crashes when opening a new instance pasting the below script in a new document in the "Scripting" editor and clicking play:
Added subscriber: @johschmitz
Added subscriber: @mano-wii
Changed status from 'Needs Triage' to: 'Archived'
That code is calling for crash.
The problem is that the transform operator is executed with
'INVOKE_DEFAULT'
which makes it continue to be executed in modal after the script has finished.So, that operator operates on an edited mesh that no longer exists.
Although we can fix it by checking in advance if bmesh exists inside the operator, this does not seem to be worthwhile, as it would not be of any use (the code would still not work but it would not crash).
Woot? Are honestly saying it is okay that the Python scripting layer can bring down the whole application? I am a bit shocked. Are you not aiming at building a robust API and over time find and fix all the edge cases like this one and output a warning to the user that this is invalid? It is already done for other cases and I believe that is a good thing. When I see the warning I fix my script and try again but I don't need to restart the whole Blender. If this is too difficult to implement that is another story but right now I am quite disappointed about this decision and kindly ask you to reconsider the decision to close the ticket.
Fixing this would add overhead to the C code and could also complicate its readability a bit.
It also wouldn't do what you intend in the code.
Solving this would cause the line with
bpy.ops.transform.translate
to become a dead line (instead of crash).Using bpy operators to edit a mesh is not ideal.
It is better to use the bmesh module: https://docs.blender.org/api/current/bmesh.html
I will try to formulate it as requirements:
(I have already observed this kind of behavior for other mistakes when using the API and it made a lot of sense to me. The error messages usually where very useful. The crash and missing error message on the other hand cost me a lot of debug time since obviously I am not aware what is exactly going on in the underlying C code and state machines. Another reason to provide the user with a useful error message. )
Changed status from 'Archived' to: 'Confirmed'
Operators usually do not raise python error messages, the similar would be warnings in the blender's UI.
The solution to this problem is not simple. The transform operator works with several types of objects that also exist only in one mode.
It would be necessary to create a kind of pool depending on the object to check if it still exists.
It would be considerable work.
(I'm confirming the bug, but I don't plan to work on it anytime soon. Another person can try to solve in the meantime).
I think this is fair. Thank you. I understand that an open source project has limited resources and don't expect a solution after any specific amount of time. I think recording such bugs is valuable though. Even if they are only fixed after a couple of years.