Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import os
- from os.path import getmtime, exists
- import subprocess
- def run(file,output=None,scene=None):
- filename = file + '.blend'
- imagename = (output if output else file) + '_#.png'
- imagefilename = imagename.replace('#','1')
- # Note: to speed up, remove -t 4
- if not exists(imagefilename) or getmtime(filename) > getmtime(imagefilename):
- retcode = subprocess.call('blender -b -t 4 {filename} {scene} -o //{output} -F PNG -f 1'
- .format(
- filename = filename,
- scene = '-S ' + scene if scene else '',
- output = imagename), shell=True)
- if retcode < 0:
- RuntimeError('Process terminated.')
- if __name__ == '__main__':
- run('Chap1')
- run('Chap2')
- run('Chap3','Chap3','Scene')
- run('Chap5','Chap3_tilt','Scene3')
- run('Chap5','Chap3_hanging','Scene4')
- run('Chap3','Chap4','Scene1')
- run('Chap5','Chap5_carts','Scene')
- run('Chap5','Chap5','Scene2')
- run('Chap6','Chap6a','Scene')
- run('Chap6','Chap6b','Scene1')
- run('Chap6Bar')
- run('Chap7','Chap7a','Scene1')
- run('Chap7','Chap7b','Scene')
- run('Chap7','Chap7c','Scene2')
- run('Chap7Bar')
- run('Chap8')
- run('Chap9')
- run('Chap10','Chap10a','Scene')
- run('Chap10','Chap10b','Scene1')
- run('Chap11','Chap11a','Scene')
- run('Chap11','Chap11b','Scene1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement