For Loops

Hi guys,

I have to render an animation from 8 different views. The animation is split up in 7 different NLA strips.
Depending on which animation I use (NLA strip), I want to be able to choose which frames to render.

For example, from Strip1 I only want the frames: 100, 125 and 175
From Strip2 I want the frames: 105, 115, 135
… and so on …

How do I do this?

Thanks a lot for any help and have a nice day.

import bpy
from math import radians
scene = bpy.context.scene

frames = 100, 125, 175
angle = 45
axis = 2 # z-axis
platform = bpy.data.objects["BaseHumanMale"]
fp = scene.render.filepath # get existing output path

nla_strips = []
for obj in scene.objects:
	if obj.animation_data and obj.animation_data.nla_tracks:
		for track in obj.animation_data.nla_tracks:
			for strip in track.strips:
				nla_strips.append((strip, strip.mute))
				strip.mute = True


for frame_nr in frames:
	for i in range(0,8):
		for strip in nla_strips:
			strip[0].mute = False
			temp_rot = platform.rotation_euler
			temp_rot[axis] = temp_rot[axis] - radians(angle)
			platform.rotation_euler = temp_rot;
			scene.frame_set(frame_nr)
			scene.render.filepath = fp + strip[0].name + str(i) + str(frame_nr)
			bpy.ops.render.render(write_still=True) # render still
			strip[0].mute = True