Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Modified copy of https://blender.stackexchange.com/questions/8850/how-to-take-images-with-multiple-cameras-with-script
- #Turned to a sprite sheet after using imagemagick - montage *.png -tile 8x15 -geometry 100x100 scott.png; convert scott.png -fuzz 30% -transparent "rgba(255, 0, 0, 1)" scott.png
- import bpy
- import os
- animationName = "newWalk"
- scene = bpy.context.scene
- for action in bpy.data.actions:
- if (action.name == animationName):
- animationFrames = int(action.frame_range.y)
- for currentFrame in range(0, animationFrames):
- bpy.context.scene.frame_set(currentFrame)
- for ob in scene.objects:
- if ob.type == 'CAMERA' and ob.name != "guideCam":
- bpy.context.scene.camera = ob
- print('Set camera %s' % ob.name )
- file = ob.name + "_" + str(currentFrame)
- bpy.context.scene.render.filepath = file
- bpy.ops.render.render( write_still=True )
Advertisement
Add Comment
Please, Sign In to add comment