demos/render_nff.py
branchpyrit
changeset 95 ca7d4c665531
parent 90 f6a72eb99631
child 96 9eb71e76c7fd
equal deleted inserted replaced
94:4c8abb8977dc 95:ca7d4c665531
    16 imagesize = (800, 600)
    16 imagesize = (800, 600)
    17 
    17 
    18 mat = Material(colour=(1.0, 1.0, 1.0))
    18 mat = Material(colour=(1.0, 1.0, 1.0))
    19 
    19 
    20 f = sys.stdin
    20 f = sys.stdin
    21 fbase = "render_nff"
    21 fout = "render_nff.png"
    22 if len(sys.argv) > 1:
    22 if len(sys.argv) > 1:
    23 	f = open(sys.argv[1])
    23 	f = open(sys.argv[1])
    24 	fbase = sys.argv[1].rsplit('.',1)[0]
    24 	fout = sys.argv[1].rsplit('.',1)[0] + '.png'
       
    25 if len(sys.argv) > 2:
       
    26 	fout = sys.argv[2]
    25 
    27 
    26 while True:
    28 while True:
    27 	line = f.readline()
    29 	line = f.readline()
    28 	if line == "":
    30 	if line == "":
    29 		break;
    31 		break;
   102 top.optimize()
   104 top.optimize()
   103 
   105 
   104 sampler = DefaultSampler(imagesize)
   106 sampler = DefaultSampler(imagesize)
   105 rt.setSampler(sampler)
   107 rt.setSampler(sampler)
   106 rt.render()
   108 rt.render()
   107 sampler.getPixmap().writePNG(fbase+'.png')
   109 sampler.getPixmap().writePNG(fout)