Python : "get/set" method on a keyed property crashes Blender #70660
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#70660
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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-4.19.75-07002-gcaf981fa9892-x86_64-with-debian-9.9 64 Bits
Graphics card: virgl Red Hat 4.3 (Core Profile) Mesa 19.2.0-devel
Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-06-08 13:24, hash:
blender/blender@81b68f7279
Worked: (optional)
Short description of error
Using the "get/set" methods on a property (FloatProperty) in python to update a mesh data crashes blender when the property is keyed.
All is good when changing the value of the property in the ui but scrolling in the timeline crashes blender.
Exact steps for others to reproduce the error
PythonPropertyBug.blend
Added subscriber: @StanislasPaillereau
Added subscriber: @ideasman42
Fairly sure calling view_layer.update() within a set function isn't supported.
Instead you should call
ID.update_tag(...)
.Even so, this should raise an error instead of crashing.
ID.update_tag(...)
doesn't refresh on the viewport while scrolling in the timeline. Going to edit mode refreshes the mesh in the viewport.Did also some test with update_tag:
Using the refresh option set to {'OBJECT', 'DATA', 'TIME'} make scrolling the property in the UI to freak out. Seems the 'TIME' entry is the faulty one.
Hope that helps
Thx !
Stan
Short story: neither of update or tagging should happen from
set()
functions.Long story.
The
set()
functions are used by the animation system to store new value for the property. So what happens in this file is: theset()
function is asking dependency graph to be evaluated while it is being evaluated. This is not supported and can not be. Is just something to stay away from.Tagging will effectively do nothing, because the way how dependency graph does not use tags during evaluation (they are only used to initialize evaluation).
I've submitted D6035 which makes it so update requested during evaluation will raise an exception in Python.
There are two possible approaches which first Blender's design:
Changed status from 'Open' to: 'Resolved'
The crashes are now fixed. The rest is to be addressed in the .blend file itself.
Thanks for the report, closing.