# A script to render each frame as image (not render animation) in 2.8

This request is to be used as a workaround for a problem in the current 2.8 build. Everything works perfectly until using the render animation function, some frames are wrong with objects randomly out of place. I have tried many hours of tweaking, and noticed that if I just use the render image button for each frame there is no problem (except having to press render and save as 6000 times).

If one of you Blender legends could whip up a script for this I would be very grateful.

Cycles would take months to render this, however Eevee does it overnight, which was the reason for trying the 2.8.

• @bat Thank you, I removed the wrong comment. Use this instead. Also John, have you tried using the background mode render option? – Leander Jun 13 '18 at 15:30

The solution is to use a script to render each frame, and the script needs to include a short time pause. This is the script that solved the problem I have had for days.

import bpy
import time

scene = bpy.context.scene
for frame in range(scene.frame_start, scene.frame_end + 1):
scene.render.filepath = 'C:/blndtmp/' + str(frame).zfill(4)
scene.frame_set(frame)
bpy.ops.render.render(write_still=True)
time.sleep(3)


Thankyou for all your help Blender Community :)

• This question was answered by someone, the solution was simple and works perfectly, yet it's been downvoted. OK. – John October Rage Jun 14 '18 at 4:34
• Neither the question nor your answer have any downvotes at this moment. The downvotes may simply be because this solution won't help many others. Since Blender 2.8 is developing and changing all the time the rendering might work properly in just a few days. – Leander Jun 14 '18 at 12:04
• Ah roger that. Well it's rendered now thanks again team. Great result. – John October Rage Jun 14 '18 at 16:01
import bpy

for frame in range(bpy.context.scene.frame_start, bpy.context.scene.frame_end):
bpy.context.scene.frame_current = frame
bpy.ops.render.render()


I have not tested it, but looks like what you need.

• Need to set the render filepath otherwise will render to same image for each. Using scene.frame_set(frame) is recommended. – batFINGER Jun 13 '18 at 15:30
• Please test your code beforehand. This would also render all frames to the same file and and it wouldn't write any files anyway since write_still=True is missing. Refer to the codeblock in my comment. – Leander Jun 13 '18 at 15:32
• Wow that sure was fast. I'm very much appreciating the community as a whole for this program. This is the first time I have have had a question I couldn't find an existing answer for - and it took only minutes. Kudos friends. I shall try both background rendering and the script. – John October Rage Jun 13 '18 at 15:40
• Update: Background rendering outputs an access violation error, my guess being it's not quite implemented yet for 2.8 The script WORKS - the frames are correct, but it only ever gets 4 frames in before a crash... perhaps running out of memory I really have no idea... Perhaps it needs time between frames. Is there a scripting function to "wait 2 seconds?" – John October Rage Jun 13 '18 at 16:32
• Perhaps this is a job for Autohotkey. Like that time Homer uses that drinking bird to press keyboard buttons for him. I shall keep this thread up to date on developments. – John October Rage Jun 14 '18 at 3:25