bpy.app.driver_namespace: no way to properly initialize for driver in material #109720
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#109720
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: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.79
Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash:
c7fc78b81ecb
Worked: version: 3.5.1, branch: blender-v3.5-release, commit date: 2023-04-24 18:11, hash:
e1ccd9d4a1
, type: releaseCaused by
46be42f6b1
Short description of error
I have material with "value" node driven by driver. driver calls custom function from bpy.app.driver_namespace. bpy.app.driver_namespace populated with function in pre/post loading handler. Despite of that there is no function at load and initial render with that material gives wrong result. This worked well in 3.5.0
Exact steps for others to reproduce the error
switch to "cycles" render mode, observe the objects are red (incorrect)
Click on "value" node to update driver. at this time dn_test perfectly found and value updates to 1.0. Observe objects turn to green in viewport
Repeat the same steps in Blender 3.5.1. Observer that after reload at step 3) "value" node have proper value 1.0 right from the start, and there is no errors in console
From here 4.0, 3.6, 3.5.1 at
e1ccd9d4a1
and 3.5.0 atcf82e5fe57
seems to be all broken, needs to click on the value for it to become green. Auto execution is on. I'm on linux.Not sure if this is a intended use.
Here's what I have for output, this is just opening the file:
Then click run script (nothing outputs, as expected), then
File -> Revert
:Some clarification:
on first run error is normal, function not added. But on reload it is expected there is no errors and driver expression evaluated properly
regarding intended use - i am actually have an addon that setup a set of driver functions for my custom inhouse materials in PRE handler. Custom materials rely on this addon to be active, they use drivers that call my custom python methods. and "pre-load" handler seems to be a perfect place to setup up all the extras that are needed for materials in loading file. "pre-load" setup pythonic stuff, blender loads file and evaluates nodes with drivers bindings after that - and all the things expected to be in place at the time of first evaluation
i am using this scheme with inhouse materials+supplementary addon both on Windows and Mac, It worked perfectly well from 3.0 up to 3.5.1 this way.
Can confirm, will check...
Caused by
46be42f6b1
CC @ideasman42