Revision: 30552
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30552
Author:   leifandersen
Date:     2010-07-20 20:24:22 +0200 (Tue, 20 Jul 2010)

Log Message:
-----------
Mostly changes on the image diff operator:

1.  The python script get's copied into the build directory's bin folder.

2.  The operators now use that script, removing on requirement for the images.

3.  Support for animations now in the gui.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/release/scripts/op/tests_render.py
    branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py
    branches/soc-2010-leifandersen/source/creator/CMakeLists.txt

Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_render.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/op/tests_render.py   
2010-07-20 18:06:46 UTC (rev 30551)
+++ branches/soc-2010-leifandersen/release/scripts/op/tests_render.py   
2010-07-20 18:24:22 UTC (rev 30552)
@@ -6,13 +6,8 @@
 BLENDER_BIN = sys.argv[0]
 PYTHON_BIN = "python"
 PILTEST_PY = "run.py"
+IMAGEDIFF_PY = os.path.join(os.path.split(sys.argv[0])[0], 'imagediff.py')
 
-def render(path):
-    (directory, filename) = os.path.split(path)
-    command = BLENDER_BIN + " -b " + path + " -o " + os.path.join(directory, 
"output", (filename + "_####")) + " -F PNG -x 1 -f 1"
-    os.system(command)
-    return (directory + os.path.sep + "output" + os.path.sep + filename + 
"_0001.png")
-
 class TESTS_OT_render(bpy.types.Operator):
     ''''''
     bl_idname = "TESTS_OT_render"
@@ -33,9 +28,7 @@
 
     def execute(self, context):
         (directory, filename) = os.path.split(self.properties.filepath)
-        image1 = os.path.join(directory,"render",(filename + ".png"))
-        image2 = render(self.properties.filepath)
-        command = PYTHON_BIN + " " + os.path.join(directory, PILTEST_PY) + " 
--image " + self.properties.filepath
+        command = PYTHON_BIN + " " + IMAGEDIFF_PY + " --image " + 
self.properties.filepath + " --blender-bin " + BLENDER_BIN
         print(os.system(command))
         return {'FINISHED'}
 
@@ -69,9 +62,33 @@
         wm.add_fileselect(self)
         return {'RUNNING_MODAL'}
 
+class TESTS_OT_anim(bpy.types.Operator):
+    ''''''
+    bl_idname = "TESTS_OT_anim"
+    bl_label = "Animation Render Test"
+
+    filename = StringProperty(name="File Name", description="File name used", 
maxlen= 1024, default= "")
+    filepath = StringProperty(name="File Path", description="Filepath used", 
maxlen= 1024, default= "")
+    directory = StringProperty(name="File Directory", description="File 
Directory used", maxlen= 1024, default= "")
+
+    def poll(self, context):
+        return True
+
+    def execute(self, context):
+        (directory, filename) = os.path.split(self.properties.filepath)
+        command = PYTHON_BIN + " " + IMAGEDIFF_PY + " --animation " + 
self.properties.filepath + " --blender-bin " + BLENDER_BIN
+        print(os.system(command))
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        wm = context.manager
+        wm.add_fileselect(self)
+        return {'RUNNING_MODAL'}
+
 classes = [
     TESTS_OT_render,
     TESTS_OT_render_all,
+    TESTS_OT_anim,
 ]
     
 def register():

Modified: branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py    
2010-07-20 18:06:46 UTC (rev 30551)
+++ branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py    
2010-07-20 18:24:22 UTC (rev 30552)
@@ -11,6 +11,7 @@
 #        layout.operator_context = 'INVOKE_AREA'
         layout.operator("TESTS_OT_render", text="Render Test")
         layout.operator("TESTS_OT_render_all", text="All Render Tests")
+        layout.operator("TESTS_OT_anim", text="Animation Test")
         layout.operator("RENDER_OT_render", text="Render")
         layout.separator()
         layout.operator("TESTS_OT_hash", text="File Hash")

Modified: branches/soc-2010-leifandersen/source/creator/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/source/creator/CMakeLists.txt        
2010-07-20 18:06:46 UTC (rev 30551)
+++ branches/soc-2010-leifandersen/source/creator/CMakeLists.txt        
2010-07-20 18:24:22 UTC (rev 30552)
@@ -176,6 +176,7 @@
                        ADD_CUSTOM_COMMAND(TARGET blender POST_BUILD 
MAIN_DEPENDANCY blender
                                COMMENT "copying blender tests..."              
        
                                COMMAND rsync --exclude .svn -r 
${Blender_SOURCE_DIR}/tests/* ${Blender_BINARY_DIR}/tests
+                               COMMAND cp 
${Blender_SOURCE_DIR}/tests/render/run.py 
${Blender_BINARY_DIR}/bin/imagediff.py                             
                        )       
                ENDIF(WITH_TESTS)
                
@@ -282,6 +283,7 @@
                        ADD_CUSTOM_COMMAND(TARGET blender POST_BUILD 
MAIN_DEPENDANCY blender
                                COMMENT "copying blender tests..."              
        
                                COMMAND rsync --exclude .svn -r 
${Blender_SOURCE_DIR}/tests/* ${Blender_BINARY_DIR}/tests
+                               COMMAND cp 
${Blender_SOURCE_DIR}/tests/render/run.py ${Blender_BINARY_DIR}/bin/imagediff.py
                        )       
                ENDIF(WITH_TESTS)
 
@@ -381,6 +383,7 @@
                        ADD_CUSTOM_COMMAND(TARGET blender POST_BUILD 
MAIN_DEPENDANCY blender
                                COMMENT "copying blender tests..."              
        
                                COMMAND xcopy /E /Y 
\"${Blender_SOURCE_DIR}\tests\" \"${Blender_BINARY_DIR}\"
+                               COMMAND copy /Y 
\"${Blender_SOURCE_DIR}\tests\render\run.py\" 
\"${Blender_BINARY_DIR}\bin\imagediff.py\"
                        )       
                ENDIF(WITH_TESTS)
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to