I'm following these instructions https://blender.stackexchange.com/a/75652 (paragraph "Setting drivers"), and also the video linked here https://blender.stackexchange.com/a/5384 video: https://vimeo.com/40389198, to understand how to implement a driver Texture Panner.
I added a driver to a Mapping node translateY property by going to Datablock->Objects->Cube->Material Slots->Material.001->Material->Material.001->Node Tree->Nodes->Mapping->Location->Y, selecting Y and pressing D (note: right-clicking the property->Add Driver yields different results).
The expression of the driver sets the Mapping translateY to frame_current * 0.05.
The Debug value is ok and if I render the animation it works as expected.
However the viewport doesn't update the value for preview while scrolling frames.
Is there a workaround to preview it (with scripting maybe?) ?
- Reloaded the file which had an incorrect texture
This is the code snippet I used in 2.8 experimental. Since the drivers UI part hasn't been implemented yet, drivers can only be accessed with Python. It works in Cycles but not Eevee as of May 2018.
For an approach which works in 2.79 check D. Skarn's answer.
import bpy mydriver = bpy.data.objects["Cube"].material_slots["Material.001"].material.node_tree.nodes["Mapping"].driver_add('translation',1) scn = bpy.data.scenes["Scene"] def getframe_fn(): return scn.frame_current bpy.app.driver_namespace["getframe"] = getframe_fn mydriver.driver.expression = 'getframe()*0.05'
Thank you all for the help!