Page MenuHome

Self-referencing driver works in viewport, but not in render.
Confirmed, NormalPublic

Description

System Information
Operating system: Windows-10-10.0.17763-SP0 64 Bits
Graphics card: GeForce GT 730/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 391.35

Blender Version
Broken: version: 2.82 (sub 6), branch: master, commit date: 2020-01-29 21:53, hash: rBc7c8ee61686f
Worked: (optional) 2.79b

Short description of error
Rotation property of object is updated in viewport, but not in render.
If run same script in 2.79 - all works fine both in viewport and render.

def rotator():
    var1=bpy.data.objects["Suzanne"].rotation_euler.z
    var3=bpy.data.scenes["Scene"].render.fps

    new_value=var1+math.radians(var3)

    return new_value

Exact steps for others to reproduce the error

  • run the file Script_bug_2.8.2 ('Run script', 'Update Dependecies')
  • play in the viewport - the animation works correctly
  • render (Ctrl + F12) - the animation does not work;

Viewport:

Render:

2.79 file:

Event Timeline

Richard Antalik (ISS) closed this task as Invalid.Mon, Feb 3, 1:21 PM
Richard Antalik (ISS) claimed this task.

Not sure if there was change in how driver expressions work in 2.8, but I would recommend you to look at examples in manual: https://docs.blender.org/manual/en/latest/animation/drivers/workflow_examples.html

For simple rotation based on frame driver you can just write frame/10 in expression field

I think that issue here is, that depsgraph will always evaluate rotation to 0 and then apply your driver, which will lead to same value for every frame.

I know how to make a simple rotation, but this scene is a simplified option for my rig.
The problem is that either the viewport does not render correctly, or the data is not updated during the rendering, while in version 2.79 everything goes as expected, including rendering (or in version 2.79, too, an error).

@Vladimir (evilvoland) indeed this is nice demonstration of inconsistency, so I will reopen this report.

Richard Antalik (ISS) renamed this task from Driver scripts do not accept updated data during rendering to Self-referencing driver works in viewport, but not in render..Tue, Feb 4, 4:11 AM
Richard Antalik (ISS) reopened this task as Confirmed.
Richard Antalik (ISS) updated the task description. (Show Details)