[Durian-svn] [3904] run multiple bakes at once
campbell
institute at blender.org
Wed May 26 16:12:33 CEST 2010
Revision: 3904
https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=3904
Author: campbell
Date: 2010-05-26 16:12:33 +0200 (Wed, 26 May 2010)
Log Message:
-----------
run multiple bakes at once
Modified Paths:
--------------
pro/scripts/utilities/batch_bake.py
Modified: pro/scripts/utilities/batch_bake.py
===================================================================
--- pro/scripts/utilities/batch_bake.py 2010-05-26 14:03:52 UTC (rev 3903)
+++ pro/scripts/utilities/batch_bake.py 2010-05-26 14:12:33 UTC (rev 3904)
@@ -6,11 +6,18 @@
DEBUG = False
OVERRIDE = True
+BIN = "/b/B"
-print("running", __file__)
+# print("running", __file__)
import os
import sys
+def blend_path_list(path):
+ for dirpath, dirnames, filenames in os.walk(path):
+ for filename in filenames:
+ if filename.endswith(".blend"):
+ yield os.path.join(dirpath, filename)
+
def text_replace(text_block, from_text, to_text):
st = text_block.as_string()
st = st.replace(from_text, to_text)
@@ -25,7 +32,7 @@
groups.append(grp)
break
- print(groups)
+ # print(groups)
objects = []
@@ -284,34 +291,24 @@
def noblender_print_tasks():
+ files = blend_path_list("/media/data/durian")
+ files = [l for l in files if l.endswith("_comp.blend")]
+ files.sort()
+
+ print("TOT_PROP=`cat /proc/cpuinfo | grep vendor_id | wc -l`")
+ print("LIBGL=\"/shared/software/mesa-7.8/lib/libGL.so\"")
+ print("")
- # BIN = "/media/data/blender_ideasman42/blender/blender"
- BIN = "/b/B"
+ tasks = []
+ for f in files:
+ task_bake_1 = " ".join(["DISPLAY=:1", "LD_PRELOAD=$LIBGL", BIN, "-b", f, "-P", __file__])
+ task_render_2 = " ".join(["DISPLAY=:1", "LD_PRELOAD=$LIBGL", BIN, f, "-P", __file__])
+ cmd = task_bake_1 + " && " + task_render_2 + " &"
+ print(cmd)
- os.system("find /media/data/durian/ -name '*_comp.blend' > /tmp/foo.txt")
- lines = open("/tmp/foo.txt", 'r').read().split("\n")
- lines.sort()
- for f in lines:
- print(" ".join(["DISPLAY=:1", "LD_PRELOAD=/shared/software/mesa-7.8/lib/libGL.so", BIN, "-b", f, "-P", __file__])) # bake
- print(" ".join(["DISPLAY=:1", "LD_PRELOAD=/shared/software/mesa-7.8/lib/libGL.so", BIN, f, "-P", __file__])) # render
+ print(("echo \"%s\" ; " % f) + "sleep 1 ; " + "while [ `jobs | wc -l` -gt $TOT_PROP ] ; do sleep 1 ; done")
- os.system("rm /tmp/foo.txt")
-
-def noblender_print_tasks_glrender():
-
- # BIN = "/media/data/blender_ideasman42/blender/blender"
- BIN = "/b/B"
-
- os.system("find /media/data/durian/ -name '*.blend' > /tmp/foo.txt")
- lines = open("/tmp/foo.txt", 'r').read().split("\n")
- lines.sort()
- for f in lines:
- print(" ".join(["DISPLAY=:1", "LD_PRELOAD=/shared/software/mesa-7.8/lib/libGL.so", BIN, f, "-P", __file__]))
-
- os.system("rm /tmp/foo.txt")
-
-
if __name__ == "__main__":
try:
import bpy
More information about the Durian-svn
mailing list