[Durian-svn] [3815] update to opengl render to only re-render new blend files

campbell institute at blender.org
Tue May 25 08:29:37 CEST 2010


Revision: 3815
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=3815
Author:   campbell
Date:     2010-05-25 08:29:37 +0200 (Tue, 25 May 2010)
Log Message:
-----------
update to opengl render to only re-render new blend files

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

Modified: pro/scripts/utilities/batch_ogl.py
===================================================================
--- pro/scripts/utilities/batch_ogl.py	2010-05-25 05:55:16 UTC (rev 3814)
+++ pro/scripts/utilities/batch_ogl.py	2010-05-25 06:29:37 UTC (rev 3815)
@@ -11,6 +11,15 @@
 
 __file__ = "/d/pro/scripts//utilities/batch_ogl.py"
 
+ANIM_DIR = "/shared/durian/anim_daily"
+
+import time
+
+def file_date(path):
+    #currtime = (year, month, day, hour, min, sec)
+    # year, month, day, hour, minute, second, weekday, yearday, daylight = now
+    return time.localtime(os.stat(path)[8])[0:6]
+
 def blend_path_list(path):
 	for dirpath, dirnames, filenames in os.walk(path):
 		for filename in filenames:
@@ -97,9 +106,8 @@
     scene.render.file_format = 'AVI_JPEG'
     scene.render.file_quality = 90
 
-    image_dir = "/shared/durian/anim_daily"
     filename = bpy.data.filename.replace(".blend", ".avi")
-    bpy.context.scene.render.output_path = os.path.join(image_dir, os.path.basename(filename))
+    bpy.context.scene.render.output_path = os.path.join(ANIM_DIR, os.path.basename(filename))
 
     # hey, lets make sintel pretty
     for mat in bpy.data.materials:
@@ -114,6 +122,7 @@
 
 
 def noblender_print_tasks():
+    ALL_TASKS = False
 
     files = list(blend_path_list("/d/pro/scenes"))
     files_anim = []
@@ -126,7 +135,13 @@
         if not f.split("/")[-1].startswith("0"):
             continue
         
-        files_anim.append((get_svn_rev(f), f))
+        if ALL_TASKS:
+            files_anim.append((get_svn_rev(f), f))
+        else:
+            avi = os.path.join(ANIM_DIR, os.path.basename(f).replace(".blend", ".avi"))
+            if os.path.exists(avi):
+                if file_date(avi) < file_date(f):
+                    files_anim.append((get_svn_rev(f), f))
 
     files_anim.sort()
     files_anim.reverse() # newest first



More information about the Durian-svn mailing list