From 8f496712d04387af1eb9d0127d309c4179da2b10 Mon Sep 17 00:00:00 2001 From: Aeva Ntsc Date: Tue, 16 Oct 2012 00:35:37 -0500 Subject: [PATCH] Added script for manually testing the blender renderer. --- render_test.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 render_test.py diff --git a/render_test.py b/render_test.py new file mode 100644 index 00000000..58a5a760 --- /dev/null +++ b/render_test.py @@ -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"]) -- 2.25.1