Property controlled drivers not updating from python #74000
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#74000
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: MacOS / Unbuntu 18.04
Graphics card: Mac / Nvidia 2080TI
Broken: 2.82.7
Worked: 2.79.7
I have custom property that controls a driver.
there are couple of meshes that change visibility depending on the property value.
When manually changing the custom property value everything works perfectly.
The problem happens when accessing the custom property from python code, and changing the value,
the value on the property changes but the visibility of the meshes controlled by the drivers does not change.
Also on the outliner there's no change in the visibility indication of the meshes.
Expected behaviour:
When changing the property from python code, one mesh becomes invisible and another becomes visible.
Added subscriber: @shayg
Added subscriber: @Mets
Probably same underlying issue as studio/blender-studio#73593?
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @dr.sybren
Changed status from 'Confirmed' to: 'Needs User Info'
@shayg please provide a minimal blend file that demonstrates the issue.
Food_Apple.blend
Attached is the file for which there's a problem.
Also this is the code to run:
Changed status from 'Needs User Info' to: 'Archived'
That blend file (Food_Apple.blend) is set up incorrectly; the custom property is set on the Scene, but the driver is accessing it on the Object. I have corrected this in #74000-visibility-driver.blend.
The code also doesn't work with that blend file:
But I get the gist of your report.
The thing is that assignments to custom properties don't tag the object for updates in the dependency graph. Since tagging for update on an object is expensive (it recalculates the constraints, modifiers, and thus the geometry) this is not done automatically from Python assignments. This code works in the attached blend file in the Python console:
Marking as 'invalid' as this is not a bug in Blender.
Hi @dr.sybren, thanks for the update.
Is there a reason to move to the next frame?
As I understand the setting the current frame will also trigger an update.
Also the actual file is more complex, drivers control more than one object so when performing what you suggest some objects that supposed to appear remain hidden and others.
So if I want to control the top of the apple when I switch the property, sometimes the apple appears without the top at all.
I didn't test with the current frame.
The object to tag for update is the object that contains the custom property. Drivers that depend on that property value should all be automatically updated.
Added subscriber: @elie
I am experiencing similar issue with object drivers targetting scene properties. Unfortunately calling
scene.update_tag()
does not trigger the update of object's driven attributes.edit: my issue was that the 3D view was not redrawn, so I added:
Added subscriber: @spiraloid-3
here's a hacky catchall I used to force an update when all the other solutions failed me.
Added subscriber: @Harry-Kunz