Added script for manually testing the blender renderer.
authorAeva Ntsc <aeva.ntsc@gmail.com>
Tue, 16 Oct 2012 05:35:37 +0000 (00:35 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 3 Dec 2012 20:40:48 +0000 (14:40 -0600)
render_test.py [new file with mode: 0644]

diff --git a/render_test.py b/render_test.py
new file mode 100644 (file)
index 0000000..58a5a76
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+import subprocess, json
+
+
+# import the model
+#model, ext, gr = ("/home/aeva/library/models/octocat_ascii.stl", "stl", 131.8)
+model, ext, gr = ("/home/aeva/library/models/psycho/printme.obj", "obj", 93.4)
+
+
+args = "blender blender_render.blend -F JPEG -P blender_render.py".split(" ")
+env = {
+    "DISPLAY" : ":0",
+    "RENDER_SETUP" : json.dumps({            
+            "out_file" : "foo.jpg",
+            "model_path" : model,
+            "model_ext" : ext,
+            "greatest" : gr,
+            "camera_coord" : [0, gr*-1.5, gr],
+            "camera_focus" : (0, 0, gr/2.0),
+            "camera_clip" : gr*10,
+            "projection" : "PERSP", # "ORTHO" or "PERSP"
+            "width" : 800,
+            "height" : 800,
+            })
+    }
+
+subprocess.call(args, env=env)
+#subprocess.call(["eog", "foo.jpg"])