[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3519] trunk/py/scripts/tools/bi_farm: fix slideshow with no images and ignore 'old' dirs.
Campbell Barton
ideasman42 at gmail.com
Fri Jun 22 11:05:37 CEST 2012
Revision: 3519
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3519
Author: campbellbarton
Date: 2012-06-22 09:05:26 +0000 (Fri, 22 Jun 2012)
Log Message:
-----------
fix slideshow with no images and ignore 'old' dirs.
Modified Paths:
--------------
trunk/py/scripts/tools/bi_farm/new_blender_setup.py
trunk/py/scripts/tools/bi_farm/slideshow/preview_images_update.py
Modified: trunk/py/scripts/tools/bi_farm/new_blender_setup.py
===================================================================
--- trunk/py/scripts/tools/bi_farm/new_blender_setup.py 2012-06-22 08:30:52 UTC (rev 3518)
+++ trunk/py/scripts/tools/bi_farm/new_blender_setup.py 2012-06-22 09:05:26 UTC (rev 3519)
@@ -185,8 +185,7 @@
rd.use_simplify = False
# default width and height
- width = 2048
- height = 1080
+ width, height = 1920, 800
# quality
if quality == "File settings":
Modified: trunk/py/scripts/tools/bi_farm/slideshow/preview_images_update.py
===================================================================
--- trunk/py/scripts/tools/bi_farm/slideshow/preview_images_update.py 2012-06-22 08:30:52 UTC (rev 3518)
+++ trunk/py/scripts/tools/bi_farm/slideshow/preview_images_update.py 2012-06-22 09:05:26 UTC (rev 3519)
@@ -47,36 +47,45 @@
exr_files = []
for root, dirs, files in os.walk(DIR):
- if "rrd" in root: # XXX - weak, we could have rrd in a path name FIXME
- print(root)
+ # print(root, files)
- for file in files:
- if file.endswith('.exr'):
- name = os.path.join(root, file)
- try:
- st = os.stat(name)
- except OSError:
- continue
+ # skip old files...
+ if (os.sep + "old") in root:
+ continue
- if st.st_size > 10:
- exr_files += [(name, st.st_mtime)]
+ for file in files:
+ # print(os.path.join(root, file))
+ if file.endswith('.exr'):
+ name = os.path.join(root, file)
+ try:
+ st = os.stat(name)
+ except OSError:
+ import traceback
+ traceback.print_exc()
+ continue
+ if st.st_size > 10:
+ exr_files += [(name, st.st_mtime)]
+
exr_files.sort(key=lambda pair: pair[1])
exr_files = exr_files[-NUM_IMAGES:]
exr_files.reverse()
# convert images
- for i in range(0, NUM_IMAGES):
- name, mtime = exr_files[0]
- print("converting big", name)
- command = CONVERT % (name, PNG_FILE + "_big" + str(i), 100)
- remote_command(command)
+ if exr_files:
+ for i in range(0, NUM_IMAGES):
+ name, mtime = exr_files[0]
+ print("converting big", name)
+ command = CONVERT % (name, PNG_FILE + "_big" + str(i), 100)
+ remote_command(command)
- for i in range(0, NUM_IMAGES):
- name, mtime = exr_files[0]
- print("converting small", name)
- command = CONVERT % (name, PNG_FILE + "_small" + str(i), 30)
- remote_command(command)
+ for i in range(0, NUM_IMAGES):
+ name, mtime = exr_files[0]
+ print("converting small", name)
+ command = CONVERT % (name, PNG_FILE + "_small" + str(i), 30)
+ remote_command(command)
+ else:
+ print("Can't find any images in:", DIR)
# sleep a while until the next up
print("sleeping for", str(SLEEP / 60), "minutes")
More information about the Bf-extensions-cvs
mailing list