Crash updating string custom property with frame_change handler #37073
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#37073
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?
%%%--- Blender version with error, and version that worked ---
SVN r60747
If you set up a frame_change_pre handler that updates a custom string property based on the current frame value, Blender will crash if you move the mouse cursor over the custom property's panel in the Properties editor. Example .blend and gdb backtrace attached.
Changed status to: 'Open'
%%%Just small addition: you need to run the script before playback :)%%%
%%%General issue here is that the button stores the IDProperty string pointer, which turns invalid when setting the string (and is not immediately redrawn).%%%
%%%Correction: The problem is not simply the string value (this is not actually stored in string buttons), but the uiBut->rnaprop pointer. For regular RNA props it can be relied upon insofar as these PropertyRNA pointers stay valid. But in the case of plain IDProperties the "rnaprop" pointer is actually an IDProperty*, with the MAGIC flag set to tell them apart (common RNA hack). However, IDProperties do get freed when replacing their values, which invalidates but->rnaprop.%%%
Added subscriber: @ideasman42
@ideasman42, can you please check this report? You're the most familiar with custom props and so..
Discussed this with Campbell on IRC a while back. IIRC our conclusion was that forcing a redraw when changing ID properties is the easiest solution for now, although not really nice.
Alternatively we'd need a safe way of referencing IDProperty from buttons instead of just storing a pointer and hoping for the best. This would probably be a lot of work, considering how many functions access these pointers.
Changed status from 'Open' to: 'Resolved'