[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3483] trunk/py/scripts/tools/bi_farm/ new_blender_setup.py: adjustments not to change the percentage when rendeing file settings.

Campbell Barton ideasman42 at gmail.com
Tue Jun 12 11:37:53 CEST 2012


Revision: 3483
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3483
Author:   campbellbarton
Date:     2012-06-12 09:37:48 +0000 (Tue, 12 Jun 2012)
Log Message:
-----------
adjustments not to change the percentage when rendeing file settings.

Modified Paths:
--------------
    trunk/py/scripts/tools/bi_farm/new_blender_setup.py

Modified: trunk/py/scripts/tools/bi_farm/new_blender_setup.py
===================================================================
--- trunk/py/scripts/tools/bi_farm/new_blender_setup.py	2012-06-10 22:45:55 UTC (rev 3482)
+++ trunk/py/scripts/tools/bi_farm/new_blender_setup.py	2012-06-12 09:37:48 UTC (rev 3483)
@@ -70,7 +70,9 @@
 def get_revision(filepath):
     '''returns the revision of this blendfile'''
     import subprocess
-    lines = subprocess.Popen(["svn", "info", bpy.data.filepath], stdout=subprocess.PIPE).communicate()[0].splitlines()
+    lines = subprocess.Popen(["svn", "info", bpy.data.filepath],
+                              stdout=subprocess.PIPE
+                              ).communicate()[0].splitlines()
     rev = b""
     for l in lines:
         if l.startswith(b'Revision: '):
@@ -114,7 +116,10 @@
 
         rd.use_stamp_note = True
         rd.use_stamp_render_time = True
-        rd.stamp_note_text = "rev:%s, art_rev:%s, %s" % (bpy.app.build_revision, str(get_revision(fpath)), ip)
+        rd.stamp_note_text = ("rev:%s, art_rev:%s, %s" %
+                              (bpy.app.build_revision,
+                               str(get_revision(fpath)),
+                               ip))
 
         # stamp
         if quality != "File settings":
@@ -147,18 +152,20 @@
         rd.raytrace_method = 'AUTO'
 
         # resolution
-        if quality != "File settings":
-            rd.resolution_x = 2048
-            rd.resolution_y = 1080
-
-        rd.resolution_percentage = 100
         rd.use_border = False
         rd.image_settings.color_mode = 'RGB'
         rd.use_simplify = False
 
+        # default width and height
+        width = 2048
+        height = 1080
+
         # quality
-        if quality == "Preview 1K":
+        if quality == "File settings":
+            pass
+        elif quality == "Preview 1K":
             rd.resolution_percentage = 50
+            rd.resolution_x, rd.resolution_y = width, height
 
             rd.use_simplify = True
             rd.simplify_subdivision = 0
@@ -171,6 +178,7 @@
             #    scene.world.lighting.samples = 1
         elif quality == "NoShading 1K":
             rd.resolution_percentage = 50
+            rd.resolution_x, rd.resolution_y = width, height
 
             rd.use_textures = False
             rd.use_raytracing = False
@@ -178,6 +186,7 @@
             rd.use_shadows = False
         elif quality == "Simplified 1K":
             rd.resolution_percentage = 50
+            rd.resolution_x, rd.resolution_y = width, height
 
             rd.use_textures = True
             rd.use_raytracing = False
@@ -191,14 +200,22 @@
         elif quality == "Final 4K":
             # is this resolution right?
             rd.resolution_percentage = 200
+            rd.resolution_x, rd.resolution_y = width, height
         elif quality == "Final 1K":
             rd.resolution_percentage = 50
+            rd.resolution_x, rd.resolution_y = width, height
         elif quality == "Final 0.5K":
             rd.resolution_percentage = 25
+            rd.resolution_x, rd.resolution_y = width, height
         elif quality == "Final HD":
             rd.resolution_percentage = 100
-            rd.resolution_x = 1920
-            rd.resolution_y = 1080
+            rd.resolution_x, rd.resolution_y = 1920, 1080
+        else:
+            # this should never run really
+            print("ERROR: %r not known!" % quality)
+            rd.resolution_percentage = 100
+            rd.resolution_x, rd.resolution_y = width, height
+
         scene.frame_start = render_frame
         scene.frame_end = render_frame
 



More information about the Bf-extensions-cvs mailing list