[Durian-svn] [3635] adjustments to automatic baking

campbell institute at blender.org
Thu May 20 07:37:50 CEST 2010


Revision: 3635
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=3635
Author:   campbell
Date:     2010-05-20 07:37:50 +0200 (Thu, 20 May 2010)
Log Message:
-----------
adjustments to automatic baking
- bake high res avis.
- override user defined settings.
- only bake files sintels hair exists in.
- turn off wire draw (sintels eyes)
- DEBUG option for fast tests

Modified Paths:
--------------
    pro/scripts/utilities/batch_bake.py

Modified: pro/scripts/utilities/batch_bake.py
===================================================================
--- pro/scripts/utilities/batch_bake.py	2010-05-19 23:38:18 UTC (rev 3634)
+++ pro/scripts/utilities/batch_bake.py	2010-05-20 05:37:50 UTC (rev 3635)
@@ -1,9 +1,10 @@
 # replace
 
-# python /d/pro/scripts/utilities/batch_bake.py # build list
+# python /d/pro/scripts/utilities/batch_bake.py > /tmp/hair/bake.sh # build list
 # ./B -b /d/pro/scenes/05.8_ambushfight/05.8b_comp.blend -P /d/pro/scripts/utilities/batch_bake.py
 # ./B bzz /d/pro/scenes/05.8_ambushfight/05.8b_comp.blend -P /d/pro/scripts/utilities/batch_bake.py
 
+DEBUG = False
 
 print("running", __file__)
 import os
@@ -56,10 +57,31 @@
     return lay
 
 def check_init():
+    '''
     if "durian_init.py" not in bpy.data.texts:
         print("durian_init.py not found: Exiting!")
+        # sys.exit(0)
+    '''
+    
+    if "GEO-sintel_hair_emit" not in bpy.data.objects:
+        print("GEO-sintel_hair_emit not found: Exiting!")
         sys.exit(0)
+    
+    
+    if "durian_init.py" not in bpy.data.texts:
+        text = """
+import finals_config
+reload(finals_config)
+finals_config.setup(baked=False)"""
+        textblock = bpy.data.texts.new("durian_init.py")
+        
+    
+def use_simplify():
+    bpy.context.scene.render.use_simplify = True
+    bpy.context.scene.render.simplify_subdivision = 0
+    bpy.context.scene.render.simplify_child_particles = 0.5
 
+
 def blender_bg_bake():
     # start 
     init_script = bpy.data.texts.get("durian_init.py")
@@ -68,13 +90,11 @@
 
     # run script
     check_init()
+    use_simplify()
 
+    if DEBUG:
+        bpy.context.scene.frame_end = bpy.context.scene.frame_start + 10
 
-    # HACK, short frame range to test
-    bpy.context.scene.frame_end = bpy.context.scene.frame_start + 12
-
-
-
     import durian_init
     reload(durian_init)
 
@@ -117,7 +137,8 @@
         print("layers:", lay)
 
         bpy.ops.ptcache.free_bake(context)
-        reload(durian_init) # <--- why is this needed?
+        # reload(durian_init) # <--- why is this needed?
+        finals_config.setup(baked=False, pre_roll=0)
         bpy.ops.ptcache.bake(context, bake=True)
 
         for cmd in finals_config.pointcache_commands(psys.point_cache):
@@ -138,14 +159,14 @@
 def blender_fg_render():
     # render
     check_init()
+    use_simplify()
     
-    bpy.context.scene.render.resolution_percentage = 50
+    bpy.context.scene.render.resolution_percentage = 100
     bpy.context.scene.render.resolution_x = 2048
     bpy.context.scene.render.resolution_y = 872
     bpy.context.scene.render.file_format = 'AVI_JPEG'
     bpy.context.scene.render.file_quality = 95
 
-
     image_dir = "/tmp/hair/"
     filename = bpy.data.filename.replace(".blend", ".avi")
     bpy.context.scene.render.output_path = os.path.join(image_dir, os.path.basename(filename))
@@ -161,23 +182,28 @@
                 sp.display_render_override = True
                 sp.lock_camera_and_layers = True
                 sp.viewport_shading = 'SOLID'
-                sp.region_3d.perspective = 'CAMERA'
+                sp.region_3d.perspective = 'CAMERA' # view_
                 bpy.context.scene.update()
 
+    # looks crap when enabled
+    for obj in bpy.data.objects:
+        obj.draw_wire = False
+
     bpy.ops.render.opengl({}, animation=True)
 
     sys.exit()
 
+
 def noblender_print_tasks():
 
-    BIN = "/b/B"
-    
+    BIN = "/media/data/blender_ideasman42/blender/blender"
+
     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", BIN, "-b", f, "-P", __file__])) # bake 
-        print(" ".join(["DISPLAY=:1", BIN, f, "-P", __file__])) # render
+        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
 
     os.system("rm /tmp/foo.txt")
 



More information about the Durian-svn mailing list