demos/render_nff.py
branchpyrit
changeset 95 ca7d4c665531
parent 90 f6a72eb99631
child 96 9eb71e76c7fd
--- a/demos/render_nff.py	Thu May 08 09:21:25 2008 +0200
+++ b/demos/render_nff.py	Sat May 10 14:29:37 2008 +0200
@@ -18,10 +18,12 @@
 mat = Material(colour=(1.0, 1.0, 1.0))
 
 f = sys.stdin
-fbase = "render_nff"
+fout = "render_nff.png"
 if len(sys.argv) > 1:
 	f = open(sys.argv[1])
-	fbase = sys.argv[1].rsplit('.',1)[0]
+	fout = sys.argv[1].rsplit('.',1)[0] + '.png'
+if len(sys.argv) > 2:
+	fout = sys.argv[2]
 
 while True:
 	line = f.readline()
@@ -104,4 +106,4 @@
 sampler = DefaultSampler(imagesize)
 rt.setSampler(sampler)
 rt.render()
-sampler.getPixmap().writePNG(fbase+'.png')
+sampler.getPixmap().writePNG(fout)