[Durian-svn] [3663] - option to override user hair settings

campbell institute at blender.org
Thu May 20 15:45:35 CEST 2010


Revision: 3663
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=3663
Author:   campbell
Date:     2010-05-20 15:45:35 +0200 (Thu, 20 May 2010)
Log Message:
-----------
- option to override user hair settings
- set sintels hair color

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

Modified: pro/scripts/utilities/batch_bake.py
===================================================================
--- pro/scripts/utilities/batch_bake.py	2010-05-20 13:29:05 UTC (rev 3662)
+++ pro/scripts/utilities/batch_bake.py	2010-05-20 13:45:35 UTC (rev 3663)
@@ -5,6 +5,7 @@
 # ./B bzz /d/pro/scenes/05.8_ambushfight/05.8b_comp.blend -P /d/pro/scripts/utilities/batch_bake.py
 
 DEBUG = False
+OVERRIDE = True
 
 print("running", __file__)
 import os
@@ -77,9 +78,12 @@
         
     
 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
+    scene = bpy.context.scene
+    while scene:
+        scene.render.use_simplify = True
+        scene.render.simplify_subdivision = 0
+        scene.render.simplify_child_particles = 0.5
+        scene = scene.set
 
 
 def blender_bg_bake():
@@ -136,9 +140,14 @@
 
         print("layers:", lay)
 
+        finals_config.setup(baked=False, pre_roll=0) # <--- why is this needed?
         bpy.ops.ptcache.free_bake(context)
-        # reload(durian_init) # <--- why is this needed?
-        finals_config.setup(baked=False, pre_roll=0)
+
+        if OVERRIDE:
+            finals_config.setup(baked=False, pre_roll=0)
+        else:
+            reload(durian_init) # <--- why is this needed?
+
         bpy.ops.ptcache.bake(context, bake=True)
 
         for cmd in finals_config.pointcache_commands(psys.point_cache):
@@ -151,6 +160,7 @@
     # end script, should we save?
     if init_script:
         text_replace(init_script, "baked=False", "baked=True")
+        text_replace(init_script, "sim=False", "sim=True")
     
     # save so on open this renders quick
     bpy.ops.wm.save_mainfile(check_existing=False, path=bpy.data.filename)
@@ -171,9 +181,13 @@
     filename = bpy.data.filename.replace(".blend", ".avi")
     bpy.context.scene.render.output_path = os.path.join(image_dir, os.path.basename(filename))
 
+    
+    if OVERRIDE:
+        import finals_config
+        finals_config.setup(baked=True)
+
     # quick fix
     # freakin give me a 3d view!!! - make them ALL 3d camera views.
-    print(bpy.context.scene.objects.active)
 
     for ar in bpy.context.window.screen.areas:
         ar.type = 'VIEW_3D'
@@ -182,13 +196,24 @@
                 sp.display_render_override = True
                 sp.lock_camera_and_layers = True
                 sp.viewport_shading = 'SOLID'
-                sp.region_3d.perspective = 'CAMERA' # view_
+                sp.region_3d.view_perspective = 'CAMERA' # view_
                 bpy.context.scene.update()
 
     # looks crap when enabled
     for obj in bpy.data.objects:
+        if obj.max_draw_type in ('BOUNDS', 'WIRE'):
+            obj.restrict_view = True
+            continue
+            
         obj.draw_wire = False
 
+    # hey, lets make sintel pretty
+    for mat in bpy.data.materials:
+        if mat.name == "Sintel_Skin1_layer":
+            mat.diffuse_color = 0.49, 0.31, 0.22
+        elif mat.name == "sintel_hair_shabuffe":
+            mat.diffuse_color = 0.6, 0.33, 0.25
+
     bpy.ops.render.opengl({}, animation=True)
 
     sys.exit()



More information about the Durian-svn mailing list