[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30194] branches/soc-2010-leifandersen/ tests/render/run.py: 1.

Leif Andersen leif.a.andersen at gmail.com
Sun Jul 11 02:17:16 CEST 2010


Revision: 30194
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30194
Author:   leifandersen
Date:     2010-07-11 02:17:16 +0200 (Sun, 11 Jul 2010)

Log Message:
-----------
1. Initial work done showing HTML output for animations.  Showing that theres likely some bug in how the animations are storred.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/tests/render/run.py

Modified: branches/soc-2010-leifandersen/tests/render/run.py
===================================================================
--- branches/soc-2010-leifandersen/tests/render/run.py	2010-07-10 23:21:25 UTC (rev 30193)
+++ branches/soc-2010-leifandersen/tests/render/run.py	2010-07-11 00:17:16 UTC (rev 30194)
@@ -403,9 +403,10 @@
         print "All tests passed"
     print 'Check index.html for more information'
 
-def generate_output(images, output_file):
+def generate_output(images, output_path):
     ''''''
-    file = open(output_file, "w")
+    file = open(output_path, "w")
+    (output_directory, output_file) = os.path.split(output_path)
     file.write('<html><head>\n')
     file.write('<link rel="stylesheet" href="style.css" type="text/css" />\n')
     file.write('<title>Render Test Output</title>\n</head>\n')
@@ -430,7 +431,7 @@
             file.write('<tr>\n')
             if image.ID == 'Animation':
                 file.write('<td><a href="' + string.replace(image.name, '.blend', '.html') + '">' + image.name + '</a></td>\n')
-                anim_output(imaage, os.path.join(output_folder, string.replace(image.name, '.blend', '.html'))
+                anim_output(image, os.path.join(output_directory, string.replace(image.name, '.blend', '.html')))
             else:
                 file.write('<td>' +  image.name + '</td>\n')
             file.write('<td><a href="' + image.good_path + '"><img src="' + image.good_path + '" alt="Good Image" width="200" height="150"></a></td>\n')
@@ -461,7 +462,7 @@
             file.write('<tr>\n')
             if image.ID == 'Animation':
                 file.write('<td><a href="' + string.replace(image.name, '.blend', '.html') + '">' + image.name + '</a></td>\n')
-                anim_output(imaage, os.path.join(output_folder, string.replace(image.name, '.blend', '.html'))
+                anim_output(image, os.path.join(output_directory, string.replace(image.name, '.blend', '.html')))
             else:
                 file.write('<td>' +  image.name + '</td>\n')
             file.write('<td><a href="' + image.good_path + '"><img src="' + image.good_path + '" alt="Good Image" width="200" height="150"></a></td>\n')
@@ -484,17 +485,22 @@
     file.close()
 
 
-def anim_output(animation, output_location):
-    file = open(output_location, 'w')
+def anim_output(animation, output_path):
+    file = open(output_path, "w")
+    (output_directory, output_file) = os.path.split(output_path)
     file.write('<html><head>\n')
-    file.write('<link rel="stylesheet" href="_static/default.css" type="text/css" />\n')
-    file.write('<link rel="stylesheet" href="_static/pygments.css" type="text/css" />\n')
-    file.write('<title>' + animation.name + '</title></head>\n')
+    file.write('<link rel="stylesheet" href="style.css" type="text/css" />\n')
+    file.write('<title>Render Test Output</title>\n</head>\n')
     file.write('<body>\n')
-    file.write('<h1>' + animation.name + '</h1>')
-    file.write('<table border="1"\n')
+    file.write('<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features & Gallery" alt="Features & Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials & Help" alt="Tutorials & Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div> \n')
+    file.write('<div class="document">\n')
+    file.write('<div id="pageheader"></div>\n')
+    file.write('<div class="documentwrapper">\n<div class="bodywrapper">\n<div class="body">\n')
+    file.write('<h1>Images</h1>\n')
+    file.write('<h2>Failed Images</h2>\n')
+    file.write('<table border="1">\n')
     file.write('<tr>\n')
-    file.write('<th>Frame Number</th>\n')
+    file.write('<th>Filename</th>\n')
     file.write('<th>Good Image</th>\n')
     file.write('<th>Latest Render</th>\n')
     file.write('<th>Diff</th>\n')
@@ -502,17 +508,30 @@
     file.write('</tr>\n')
 
     i = 1
-    for frame in animation.diff_image:
+    for frame in animation.diff_animation:
         file.write('<tr>\n')
-        file.write('<td>' + i + '</td>\n')
-        file.write('<td><a href="' + os.path.join('render', string.replace(animation.name, '.blend', '_000' + i + '.png')) + '"><img src="' + os.path.join('render', string.replace(animation.name, '.blend', '_000' + i + '.png')) + '" alt="Good Image" width="200" height="150"></a></td>\n')
-        file.write('<td><a href="' + os.path.join('output', string.replace(animation.name, '.blend', '_000' + i + '.png')) + '"><img src="' + xos.path.join('output', string.replace(animation.name, '.blend', '_000' + i + '.png')) + '" alt="Latest Render" width="200" height="150"></a></td>\n')
-        file.write('<td><a href="' + os.path.join('output', string.replace(animation.name, '.blend', '_diff_000' + i + '.png')) + '"><img src="' + os.path.join('output', string.replace(animation.name, '.blend', '_diff_000' + i + '.png')) + '" alt="Image Diff" width="200" height="150"></a></td>\n')
-        
-        file.write('</tr>\n')
+        file.write('<td>' +  animation.name + str(i) +  '</td>\n')
+        file.write('<td><a href="' + animation.good_path_arr[i-1] + '"><img src="' + animation.good_path_arr[i-1] + '" alt="Good Image" width="200" height="150"></a></td>\n')
+        file.write('<td><a href="' + animation.test_path_arr[i-1] + '"><img src="' + animation.test_path_arr[i-1] + '" alt="Latest Render" width="200" height="150"></a></td>\n')
+        file.write('<td><a href="' + animation.diff_path_arr[i-1] + '"><img src="' + animation.diff_path_arr[i-1] + '" alt="Image Diff" width="200" height="150"></a></td>\n')
+        file.write('<td>')
+        if animation.passed:
+            file.write('<font color="ooffoo">OK</font>: ' + str(animation.bad_pixels) + ' of ' + str(animation.pixel_count) + ' pixels different, ' + str(animation.difference) + '% different.')
+        else:
+            file.write('<font color="ff0000">FAIL</font>: ' + str(animation.bad_pixels) + ' of ' + str(animation.pixel_count) + ' pixels different, ' + str(animation.difference) + '% different.')
+        if animation.message != None:
+            file.write(" " + animation.message)
+        file.write('</td>\n</tr>\n')
         i+=1
-    file.write('</table>\n</body>\n</html>')
 
+    file.write('</table>\n')
+    file.write('</div>\n</div>\n</div>\n')
+    file.write('<div class="clearer"></div>\n')
+    file.write('<div class="footer">Render Comparison Tests</div>\n')
+    file.write('</div><b class="round"><b id="r1"></b><b id="r2"></b><b id="r3"></b><b id="r4"></b></b>\n')
+    file.write('</div>\n</body>\n</html>')
+    file.close()
+
 def generate_css(filepath):
     file = open(filepath, 'w')
     file.write('''#navcontainer {height: 50px;margin: 0 auto;position: relative;width: 980px;}





More information about the Bf-blender-cvs mailing list