# Is possible play video in reverse mode into Texture Image node?

I import a Video in the image node of the material, can I set the video in reverse? Is there any trick that can do it? Obviously the blender timeline must always go forward.

In order to get more control about the playback of an Image Sequence or Movie Clip, you can set the Frame property of the Image Texture node to the 'first frame' which allows to set the the 'current frame' based on the Offset property.

If you'd like to reverse the playback of a Movie Clip or Image Sequence, you can add a driver expression to the Offset property, eg. #3-frame -> last frame - current frame:

For the sake of completeness: You can also loop the playback by using the remainder a.k.a. modulo operator %, eg. #(3-frame) % 3 -> (last frame - current frame) % last frame:

Demo using an Image Sequence (left) and a Movie Clip (right) on the default cube

Note: You can even add a condition to eg. be on the safe side for the 0th frame when cyclic is disabled: #1 if frame==0 else (3-frame) % 3 -> (a if condition else b).

• Very very very interesting, I think this is noteworthy. I hope it is as useful to many people as it has been to me Apr 9 '21 at 11:31
• Possibly worth mentioning too modulus' partner in crime div a // b can be used for slow / fast motion. Apr 9 '21 at 13:00
• Floor division? Good idea @batFINGER, I just need to get my test files out of the trash can :D Apr 9 '21 at 13:30
• Brilliant ... What a hack :) Thanks!!! @NoobCat if answer solved your issue consider mark answer as accepted blender.stackexchange.com/tour Apr 9 '21 at 22:45

to do it cyclic you can use this script:

import bpy

# define a driver function
def driver_func(frame, maxframe):

a = maxframe

while a - frame < 0:
a = a + maxframe

return a - frame

# assign to the driver namespace

bpy.app.driver_namespace["bdriver"] = driver_func


and then use this script as driver:

Run the script once to make it work.

Explanation:

63 is the maxframe (in my case, adapt it to your needs)

The script is pretty "silly", it just gives back maxframe - frame. Before this it checks whether this subtraction would be positive. if not, it just adds the maxframe again until it is positive.

That's all. Have fun!

The following isn't as nice as using a driver, and it's not very precise but as long as you want the image sequence to start playing backwards from frame 1 of your animation, it kinda works:

Go to frame 1, keyframe the offset to the sequence's length minus one, then go to the frame where the sequence would have finished playing and keyframe the offset to the inverse of that.

For example, with an Image Sequence of 250 images:

• Frame 1: Insert key for Offset = 249
• Frame 250: Insert key for Offset = -249

To loop it, enable Cyclic, open a Graph Editor tab and add a Cycle Modifier to the Offset curve. Then go one frame past the last key (in my example: 251) and press I to add a key. Without that extra key the loop gets slowly out of sync.

Note: like I said, it's a bit rough, not frame-exact and sometime for some reason you might have to set the second offset to frame length - 2 for it to work. When using that trick in the compositor (second offset to 0) it's a lot more reliable and easier to work with the graph to change the speed.

• Consider using a linear generator blender.stackexchange.com/questions/134519/… Apr 14 '21 at 3:53
• Right, the "imprecision" is because the curve gives float values when frame number are integers? Gonna try to make it work with a generator and update my answer if I do, cheers Apr 14 '21 at 10:08
• Yes that is what I think is happening. Could make a step curve, but if the generator does it probably quicker. Apr 14 '21 at 10:11