Scripted driver expressions not working in material nodes #46753

Closed
opened 2015-11-12 22:24:22 +01:00 by Seth L. · 6 comments

System Information
OS X 10.10.1
ATI Radeon HD 4850 512 MB

Blender Version
Broken: 2.76 48f7dd6
Worked: unknown

Short description of error
Scripted driver expressions can be used to animate objects in various ways, but they do not work for material node values.

For example, we can make an object rotate back and forth using the expression: #cos(frame*pi/30)
but we can't use such an expression to make a pulsating glow on a material by using that same expression on an Emission Shader's strength.

To use a simpler example, we can use the single-variable expression #frame to increment some value each frame. It doesn't really matter what the expression is - driver expressions aren't working in material nodes.

They are working in compositing nodes, from what I have observed.

Exact steps for others to reproduce the error

  1. Create an object and a material for it.
  2. In one of the material's nodes (for example an Emission Shader's strength) type in a scripted expression as the value. ("#frame" will do)
  3. Play the animation and see that it doesn't work.

Here is a .blend where the object is animating just fine, but the material is not animating even though the same expression is being used. There is no change in the render, and the node's value does not change as animation is played. The emission strength value remains at -0.5 no matter what expression is inserted. (Before saving the file it showed as the default 1, but after saving and re-loading it shows as -0.5)
driver_expressions_in_material_nodes.blend

**System Information** OS X 10.10.1 ATI Radeon HD 4850 512 MB **Blender Version** Broken: 2.76 48f7dd6 Worked: unknown **Short description of error** Scripted driver expressions can be used to animate objects in various ways, but they do not work for material node values. For example, we can make an object rotate back and forth using the expression: #cos(frame*pi/30) but we can't use such an expression to make a pulsating glow on a material by using that same expression on an Emission Shader's strength. To use a simpler example, we can use the single-variable expression #frame to increment some value each frame. It doesn't really matter what the expression is - driver expressions aren't working in material nodes. They *are* working in *compositing* nodes, from what I have observed. **Exact steps for others to reproduce the error** 1. Create an object and a material for it. 2. In one of the material's nodes (for example an Emission Shader's strength) type in a scripted expression as the value. ("#frame" will do) 3. Play the animation and see that it doesn't work. Here is a .blend where the object is animating just fine, but the material is not animating even though the same expression is being used. There is no change in the render, and the node's value does not change as animation is played. The emission strength value remains at -0.5 no matter what expression is inserted. (Before saving the file it showed as the default 1, but after saving and re-loading it shows as -0.5) [driver_expressions_in_material_nodes.blend](https://archive.blender.org/developer/F254208/driver_expressions_in_material_nodes.blend)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @quantumanomaly

Added subscriber: @quantumanomaly

Added subscriber: @Sergey

Added subscriber: @Sergey

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sergey Sharybin self-assigned this 2015-11-13 07:25:17 +01:00

This is limitation of old dependency graph. unfortunately, which isn't really easy to solve without doing extra drivers recalculations which will slow things down. This is supported in the new dependency graph so it makes sense to invest time in finishing new depsgraph rather than trying to stretch old one even further.

Thanks for the report, but closing it now.

This is limitation of old dependency graph. unfortunately, which isn't really easy to solve without doing extra drivers recalculations which will slow things down. This is supported in the new dependency graph so it makes sense to invest time in finishing new depsgraph rather than trying to stretch old one even further. Thanks for the report, but closing it now.
Author

Got it - thank you for the explanation! Looking forward to when this becomes possible. :-)

Got it - thank you for the explanation! Looking forward to when this becomes possible. :-)
Sign in to join this conversation.
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#46753
No description provided.