[Bf-blender-cvs] SVN commit: /data/svn/repos/bf-blender [61511] trunk/lib/tests/cycles/ ctests: Cycles ctests: Update reference images to changes in particle distribution

Sergey Sharybin sergey.vfx at gmail.com
Wed Apr 1 11:19:47 CEST 2015


Revision: 61511
          https://developer.blender.org/rBL61511
Author:   sergey
Date:     2015-04-01 09:19:47 +0000 (Wed, 01 Apr 2015)
Log Message:
-----------
Cycles ctests: Update reference images to changes in particle distribution

Modified Paths:
--------------
    trunk/lib/tests/cycles/ctests/render_all.py
    trunk/lib/tests/cycles/ctests/reports/reference_renders/T42475_1.png
    trunk/lib/tests/cycles/ctests/reports/reference_renders/T42475_2.png

Modified: trunk/lib/tests/cycles/ctests/render_all.py
===================================================================
--- trunk/lib/tests/cycles/ctests/render_all.py	2015-04-01 09:08:30 UTC (rev 61510)
+++ trunk/lib/tests/cycles/ctests/render_all.py	2015-04-01 09:19:47 UTC (rev 61511)
@@ -4,14 +4,48 @@
 import os
 import subprocess
 
-if len(sys.argv) != 2:
-    print("usage: %s /path/to/blender.bin", sys.argv[0])
+num_args = len(sys.argv)
+if num_args < 2 or num_args > 3:
+    print("usage: %s /path/to/blender.bin [/path/to/files/to/render]",
+          sys.argv[0])
     sys.exit(1)
 
 BLENDER = sys.argv[1]
-ROOT = os.path.dirname(os.path.realpath(__file__))
+if num_args == 2:
+    ROOT = os.path.dirname(os.path.realpath(__file__))
+else:
+    ROOT = sys.argv[2]
 
 
+def render_file(filepath):
+    f = os.path.basename(filepath)
+    name = '.'.join(f.split('.',)[:-1])
+    output = os.path.join(os.path.dirname(filepath),
+                          'reference_renders',
+                          name)
+
+    command = [BLENDER,
+               '-b',
+               filepath,
+               '-o', output,
+               '-f', '1']
+
+    print('Rendering ' + f)
+    try:
+        subprocess.check_output(command)
+        real_output = output + '0001.png'
+        desired_output = output + '.png'
+        if not os.path.exists(real_output):
+            print('FAILED!')
+            sys.exit(1)
+        if os.path.exists(desired_output):
+            os.remove(desired_output)
+        os.rename(real_output, desired_output)
+    except subprocess.CalledProcessError as grepexc:
+        print("FAILED!")
+        sys.exit(1)
+
+
 def render_dir(path):
     for root, dirs, files in os.walk(path):
         for f in files:
@@ -18,30 +52,9 @@
             if not f.endswith('.blend'):
                 break
             filepath = os.path.join(root, f)
-            name = '.'.join(f.split('.',)[:-1])
-            output = os.path.join(root,
-                                  'reference_renders',
-                                  name)
+            render_file(filepath)
 
-            command = [BLENDER,
-                       '-b',
-                       filepath,
-                       '-o', output,
-                       '-f', '1']
-
-            print('Rendering ' + f)
-            try:
-                subprocess.check_output(command)
-                real_output = output + '0001.png'
-                desired_output = output + '.png'
-                if not os.path.exists(real_output):
-                    print('FAILED!')
-                    sys.exit(1)
-                if os.path.exists(desired_output):
-                    os.remove(desired_output)
-                os.rename(real_output, desired_output)
-            except subprocess.CalledProcessError as grepexc:
-                print("FAILED!")
-                sys.exit(1)
-
-render_dir(ROOT)
+if os.path.isdir(ROOT):
+    render_dir(ROOT)
+else:
+    render_file(ROOT)

Modified: trunk/lib/tests/cycles/ctests/reports/reference_renders/T42475_1.png
===================================================================
(Binary files differ)

Modified: trunk/lib/tests/cycles/ctests/reports/reference_renders/T42475_2.png
===================================================================
(Binary files differ)




More information about the Bf-blender-cvs mailing list