PyDrivers in Cycles node value fields do not evaluate automatically #35863
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
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#35863
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?
%%%Mac OS 10.6.8 2.16 GHz Intel Core 2 Duo Radeon X1600
blender-2.67-r57600-OSX-10.6-i386 (and r57661); 32-bit.
For motivation and intent, please see http://www.minimaexpresion.es/?p=1070&lang=en#comment-571
For bug itself, please see attached .png screenshot.
Summary:
1.- I have only one scene, and to it I have attached a Custom Property
with name=ArchiDraft and value=1.0
2.- In a Cycles Value node, I have the PyDriver expression
3.- I have Run the lines Thanks to that,the Graph Editor acknowledges the aforementioned expression as valid.
4.- Even though the Properties panel has ArchiDraft set to 1.0
the Graph Editor evaluates it to 0.000
5.- The Cycles Value node, which holds the bpy.data.scenes- [x].ArchiDraft
expression, apparently evaluates it to 0.500 ;
in reality, that number is just the initial default,
which has not been updated.
6.- My intent is to drop the PyDriver expression into a Fac field of a Mix node;
thus far, however, if I do that, the Node editor accepts it,
but the Graph Editor does not acknowledge it at all.
7.- I can drop the exact same expression into e.g.
an object’s Z rotation field, and then everything works as expected:
thank you, gurus, and congratulations!
%%%
Changed status to: 'Open'
%%%Regarding 1) and 2), there's a difference between properties like bpy.props.FloatProperty that you can declare to exist on all Scenes, or just properties created on a single scene. Your driver expression can work without bpy.props.FloatProperty like this: bpy.data.scenes- [x]['ArchiDraft']
http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Properties
%%%
%%%bpy.data.scenes- [x]['ArchiDraft']
Interesting; thank you!
But, doesn't that mean that Cycles will trigger a character string search
for every sample of every pixel it is trying to render?%%%
%%%OK, having the Custom Property ArchiDraft=1.0 in the Properties panel,
linked to the scene, but without first executing
I entered bpy.data.scenes- [x]['ArchiDraft']
as PyDriver into the Fac field of a Mix node, and found that
(a) The Graph Editor acknowledges it and does not complain. However:
(b) The Graph Editor evaluates the expression to 0.000 and the Node Editor to 0.500 (i.e. the default),
(c) The same occurs if I drop the expression into a Value node.
Thank you for your patience!%%%
%%%Drivers are not evaluated per pixel or sample, they are evaluated once before rendering. So performance overhead is negligible. Also Python will do a character string search in both cases anyway (well actually accelerated with hash table).
I didn't check on the other issues yet.%%%
%%%...Drivers are not evaluated per pixel or sample, they are evaluated once before rendering...
Is that true even for noise.random() ?
I once used noise.random() to select shapekeys on a curl
that was duplifaced over a scalp, and one could see
that neighboring duplis were not identical.%%%
%%%By the way, congratulations on that Toon BSDF, and THANK you for the Size and Smooth parameters!
I think I'm falling in love, as in, going to use it even for realistic renders, e.g. hair.
As for speed, 100% CPU, it just blows my hat off!%%%
%%%I'm sad to say: the problem here is the depgraph :(
In theory, what you should do is:
This does not work because of the limited depgraph, which does not evaluate drivers based on scene dependencies. The only reliable driver target atm are Objects - so if this is feasible, use an Object instead of Scene for the property!
Another option is to make an update callback for your property, then you don't need drivers in the first place.
http://www.blender.org/documentation/blender_python_api_2_68_2/bpy.props.html#update-example
In any case, it's a known ToDo, sorry. Hopefully the depgraph overhaul will fix it.%%%
Changed status from 'Open' to: 'Archived'
%%%Wonderful to “hear” from you!
There’s a lot of buzz on wiki.blender.org regarding Dependency Graph improvements,
including a GSoC13 project: http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph
so I’ll try to internalize what you are suggesting to me for now, and—