Python: "drivers_remove" not working and crashing with invalid drivers #58964
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#58964
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?
Win 10
Gtx 980
The drivers_remove function is broken when removing invalid drivers.
driver_deletion.blend
A workaround I did in Blender 2.79 was changing the driver data_path to a valid one before deleting. It now crashes in 2.8:
Added subscriber: @LucasVeber
Added subscriber: @ZedDB
I can reproduce this issue, this is the backtrace I get:
(I'm guessing this is depsgraph related)
Added subscribers: @ideasman42, @Sergey
@ideasman42 , i've fixed the crash issue, but is still annoying that
driver_remove
can't be used for an invalid driver. This is caused by some validation happening inpyrna_struct_anim_args_parse()
which i am not sure why we need that at all. I think is reasonable to use path and index passed to the function?P.S. Even if the
driver_remove()
is solved for the invalid drivers, the original script will still crash because it removes drivers from a list during traversal of that list.Added subscriber: @mont29
Well,
pyrna_struct_anim_args_parse()
is also used to build a valid, normalized RNA path from given path & index, so think using it here first is OK. Though we should probably not error if it fails, but instead just build a dummy unchecked path out of path/index pair, and try to remove that one?@mont29, but this is like saying that
rm
utility will first normalize and such path you give to it before attempting to remove it. Not sure i'd trust such a removal utility =/In this case it's best to directly remove the drivers, committed API calls to create/remove drivers directly.
abe32d2a35
Now you can call
obj.animation_data.drivers.remove(some_driver)
.Even so,
driver_remove()
should be able to support drivers which have data-paths that no-longer resolve.There is a chance that this will fail (if the string isn't an exact match for eg), a collection could be referenced by string or by index, but think this isn't all that likely.
So we could make keyframe & driver removal fall-back to doing a string match.
This issue was referenced by
07287ceda1
Changed status from 'Open' to: 'Resolved'