Page MenuHome

Drivers with custom python functions are broken
Closed, ArchivedPublic

Description

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1060 3GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e

Short description of error
This was a problem in 2.79 too, so I guess it's not high priority, but I just wanted to put it here since i couldn't find it on the site.
Basically if you write a custom function in Python that controls the value of some properties on other objects, and then use it in the expression field of a driver, those properties update in the Properties panel, but not in the viewport, and old ways of manually updating the driver have no effect now (see attached .blend file for more details).

A very short term and janky solution could be to make the "Update dependancies" accessible from Python

Exact steps for others to reproduce the error

Just open the .blend file and run the script in the Text editor. I wrote 2 methods to control properties trough driver function but none of them work (the driver with the custom function is on propHolder.rotation_euler[0])

Event Timeline

{F8232639}yes im try to use drivers to move object by key frames value... and update do not work... It was working on 2.79 when I turn on trusted expresion... or something like that... but now I can't turn it on right now becouse not shows up.

Richard Antalik (ISS) closed this task as Archived.Jan 7 2020, 12:52 PM
Richard Antalik (ISS) claimed this task.

@Marco (Tareyes) from your blend file it seems that you are using drivers "backwards". I am no expert in this regard, in fact I had to follow manual on how this is supposed to work

When I follow https://docs.blender.org/manual/en/latest/animation/drivers/workflow_examples.html#custom-function-square-value, I have no issues.