1

Say I want to render every other frame in the first minute and only every third frame in the second etc?

Edit: I need the output to be one video. Best way for me would be to generate an array of frame numbers and use only them in the rendered video.

OMGsh
  • 111
  • 3

1 Answers1

1

I think it should work like this

import bpy
#configure the startframe, endframe and the step size
render_list = [
#startframe, stopframe, step
[0, 50, 1] # Frame 0 to 50 with stepsize 1
[50, 100, 2] # Frame 50 to 100 with stepsize 2
]
for config in render_list:
     bpy.context.scene.frame_start = config[0]
     bpy.context.scene.frame_end = config[1]
     bpy.context.scene.frame_step = config[2]
     bpy.ops.render.render(animation = True) #execute animation with current settings
miceterminator
  • 3,624
  • 2
  • 20
  • 32
  • I got an error - 'scene' object has no attribute 'frame_stop'. – OMGsh Jun 17 '19 at 21:35
  • Did this on blender 2.8, in 2.79 it is frame_end – miceterminator Jun 17 '19 at 21:39
  • Tested against latest 2.8x, there is nothing like a frame_stop property so the code should be equal for both versions @miceterminator – brockmann Jun 18 '19 at 08:38
  • Yep I must have screwed this up somehow. I'll change the answer – miceterminator Jun 18 '19 at 09:27
  • Now I got two videos, one for each brackets rule. – OMGsh Jun 18 '19 at 12:22
  • Well you join those videos again using the Videosequenceeditor or ffmpeg. Also I suggest rendering out to frames (so you have complete control) and then putting them into a video https://blender.stackexchange.com/questions/70774/how-can-i-turn-the-frames-rendered-by-blender-in-an-animation-into-a-video https://blender.stackexchange.com/questions/6082/rendering-into-video-with-blender-in-python-frames-to-video?rq=1 – miceterminator Jun 19 '19 at 16:11