[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29694] branches/soc-2010-leifandersen: 1.

Leif Andersen leif.a.andersen at gmail.com
Fri Jun 25 22:50:03 CEST 2010


Revision: 29694
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29694
Author:   leifandersen
Date:     2010-06-25 22:50:03 +0200 (Fri, 25 Jun 2010)

Log Message:
-----------
1.  Split up properties_tests.py into two files, one for the operators, one for the ui.

2.  Moved the files into release/scripts/(respective folder).

3.  Moved other superfluous tests into tests/scripts for clerity, possibly removed or dealt with in the near future.

4.  Some other modifications to the UI, so it works better.

5.  Render split into rendering individual tests, and rendering all tests.  Opens up a file manager now, and stores the test.

Added Paths:
-----------
    branches/soc-2010-leifandersen/release/scripts/op/tests_render.py
    branches/soc-2010-leifandersen/release/scripts/ui/properties_tests.py
    branches/soc-2010-leifandersen/tests/scripts/TestPanel.py
    branches/soc-2010-leifandersen/tests/scripts/properties_tests.py.elube

Removed Paths:
-------------
    branches/soc-2010-leifandersen/tests/TestPanel.py
    branches/soc-2010-leifandersen/tests/properties_tests.py
    branches/soc-2010-leifandersen/tests/properties_tests.py.elube

Added: branches/soc-2010-leifandersen/release/scripts/op/tests_render.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/op/tests_render.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/release/scripts/op/tests_render.py	2010-06-25 20:50:03 UTC (rev 29694)
@@ -0,0 +1,60 @@
+import bpy
+from bpy.props import *
+
+# Probably will be rewritten in C
+def compareimage(image1, image2):
+    pass
+
+class TESTS_OT_render(bpy.types.Operator):
+    ''''''
+    bl_idname = "TESTS_OT_render"
+    bl_label = "Render Test"
+
+    # List of operator properties, the attributes will be assigned
+    # to the class instance from the operator settings before calling.
+
+    # Properties stored in properties (self.properties.filepath for example)
+
+    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= "")
+    # check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
+
+    def poll(self, context):
+        return True
+
+    def execute(self, context):
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        wm = context.manager
+        wm.add_fileselect(self)
+        return {'RUNNING_MODAL'}
+
+
+class TESTS_OT_render_all(bpy.types.Operator):
+    ''''''
+    bl_idname = "TESTS_OT_render_all"
+    bl_label = "All Render Tests"
+
+    def poll(self, context):
+        return True
+
+    def execute(self, context):
+        return {'FINISHED'}
+
+classes = [
+    TESTS_OT_render,
+    TESTS_OT_render_all,
+]
+
+def register():
+    for i in classes:
+        bpy.types.register(i)
+
+def unregister():
+    for i in classes:
+        bpy.types.unregister(i)
+
+if __name__ == "__main__":
+    register()

Copied: branches/soc-2010-leifandersen/release/scripts/ui/properties_tests.py (from rev 29671, branches/soc-2010-leifandersen/tests/properties_tests.py)
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/ui/properties_tests.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/release/scripts/ui/properties_tests.py	2010-06-25 20:50:03 UTC (rev 29694)
@@ -0,0 +1,35 @@
+import bpy
+
+class INFO_MT_tests(bpy.types.Menu):
+    ''''''
+    bl_idname = "INFO_MT_tests"
+    bl_label = "Tests"
+
+    def draw(self, context):
+        layout = self.layout
+#        layout.operator_context = 'EXEC_AREA'
+#        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("RENDER_OT_render", text="Render")
+
+
+classes = [
+    INFO_MT_tests,
+]
+
+menu_func = (lambda self, context: self.layout.menu("INFO_MT_tests"))
+
+
+def register():
+    for i in classes:
+        bpy.types.register(i)
+    bpy.types.INFO_HT_header.append(menu_func)
+#    bpy.types.INFO_MT_help.append(menu_func)
+
+def unregister():
+    for i in classes:
+        bpy.types.unregister(i)
+
+if __name__ == "__main__":
+    register()
\ No newline at end of file

Deleted: branches/soc-2010-leifandersen/tests/TestPanel.py
===================================================================
--- branches/soc-2010-leifandersen/tests/TestPanel.py	2010-06-25 16:32:57 UTC (rev 29693)
+++ branches/soc-2010-leifandersen/tests/TestPanel.py	2010-06-25 20:50:03 UTC (rev 29694)
@@ -1,71 +0,0 @@
-class hashcode(bpy.types.Operator):
-    bl_idname = "Hashcode"
-    bl_label = "Hashcode"
-    
-    def poll(self, context):
-        return True
-    
-    def execute(self, context):
-        print("Foobarred")
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.manager
-        wm.add_fileselect(self)
-        print("Selecting file")
-        return {'RUNNING_MODAL'}
-
-
-class hashopener(bpy.types.Operator):
-    bl_idname = "tests.open"
-    bl_label = "Hashfile Opener"
-
-    def poll(self, context):
-        return True
-
-    def execute(self, context):
-        print("Sample")
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.manager
-        wm.add_fileselect(self)
-        print("Selecting file")
-        return {'RUNNING_MODEL'}
-
-
-class hashpanel(bpy.types.Panel):
-    bl_space_type = 'VIEW_3D'
-    bl_region_type = 'TOOLS'
-    bl_label = "Testing Tools"
-
-    def draw(self, context):
-        layout = self.layout
-        row = layout.row()
-#        row.label(text="Render")
-#        row.operator_context = 'INVOKE_REGION_WIN'
-        row.operator('Hashcode', text = "Foo")
-	
-classes = [
-    hashcode,
-    hashpanel,
-]
-
-#Note used, there for notes while writing.
-#def menu_func(self, context):
-#    default_path = bpy.data.filename.replace(".blend", ".off")
-#    self.layout.operator(ExportOFF.bl_idname, text="Object File Format (.off)").path = default_path
-
-
-def register():
-    for i in classes:
-        bpy.types.register(i)
-        #bpy.types.INFO_MT_file_export.append(menu_func)
-
-def unregister():
-    for i in classes:
-        bpy.types.unregister(i)
-        #bpy.types.INFO_MT_file_export.remove(menu_func)
-
-if __name__ == '__main__':
-    register()
\ No newline at end of file

Deleted: branches/soc-2010-leifandersen/tests/properties_tests.py
===================================================================
--- branches/soc-2010-leifandersen/tests/properties_tests.py	2010-06-25 16:32:57 UTC (rev 29693)
+++ branches/soc-2010-leifandersen/tests/properties_tests.py	2010-06-25 20:50:03 UTC (rev 29694)
@@ -1,46 +0,0 @@
-import bpy
-
-class TESTS_OT_render(bpy.types.Operator):
-    ''''''
-    bl_idname = "TESTS_OT_render"
-    bl_label = "Render Tests"
-
-    def execute(self, context):
-        pass
-
-
-class INFO_MT_tests(bpy.types.Menu):
-    ''''''
-    bl_idname = "INFO_MT_tests"
-    bl_label = "Tests"
-
-    def draw(self, context):
-        layout = self.layout
-#        layout.operator_context = 'EXEC_AREA'
-        layout.operator_context = 'INVOKE_AREA'
-        layout.operator("TESTS_OT_render", text="Run All...")
-        layout.separator()
-        layout.operator("RENDER_OT_render", text="Render")
-        layout.separator()
-
-
-classes = [
-    TESTS_OT_RENDER,
-    INFO_MT_tests,
-]
-
-menu_func = (lambda self, context: self.layout.menu("INFO_MT_tests"))
-
-
-def register():
-    for i in classes:
-        bpy.types.register(i)
-    bpy.types.INFO_HT_header.append(menu_func)
-#    bpy.types.INFO_MT_help.append(menu_func)
-
-def unregister():
-    for i in classes:
-        bpy.types.unregister(i)
-
-if __name__ == "__main__":
-    register()
\ No newline at end of file

Deleted: branches/soc-2010-leifandersen/tests/properties_tests.py.elube
===================================================================
--- branches/soc-2010-leifandersen/tests/properties_tests.py.elube	2010-06-25 16:32:57 UTC (rev 29693)
+++ branches/soc-2010-leifandersen/tests/properties_tests.py.elube	2010-06-25 20:50:03 UTC (rev 29694)
@@ -1,58 +0,0 @@
-import bpy
-import unittest
- 
-class ModifierTests(unittest.TestCase):
-    def testSubsurf(self):
-        cube = bpy.data.objects['Cube']
-        scene = bpy.context.scene
-        scene.objects.active = cube
-        scene.objects.active.selected = True
-        bpy.ops.object.modifier_add(type='SUBSURF')
- 
-class ModifierTestOp(bpy.types.Operator):
-    ''''''
-    bl_idname = "object.modifier_tests"
-    bl_label = "Modifier Tests"
- 
-    def poll(self, context):
-        return True
- 
-    def execute(self, context):
-        suite = unittest.TestLoader().loadTestsFromTestCase(ModifierTests)
-        unittest.TextTestRunner(verbosity=2).run(suite)
-        return {'FINISHED'}
- 
- 
-# Menu for Tests
-class INFO_MT_tests(bpy.types.Menu):
-    bl_label = "Unit Tests"
- 
-    def draw(self, context):
-        layout = self.layout
- 
-        layout.operator("object.modifier_tests", text="Modifier Tests")
- 
-        layout.separator()
- 
-classes = [
-    ModifierTestOp,
-    INFO_MT_tests]
- 
- 
-menu_func = (lambda self, context: self.layout.menu("INFO_MT_tests"))
-   
-def register():
-    print('register')
-    register = bpy.types.register
-    for cls in classes:
-        register(cls)
-    bpy.types.INFO_MT_help.append(menu_func)
- 
- 
-def unregister():
-    unregister = bpy.types.unregister
-    for cls in classes:
-        unregister(cls)
- 
-if __name__ == "__main__":
-    register()

Copied: branches/soc-2010-leifandersen/tests/scripts/TestPanel.py (from rev 29629, branches/soc-2010-leifandersen/tests/TestPanel.py)
===================================================================
--- branches/soc-2010-leifandersen/tests/scripts/TestPanel.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/tests/scripts/TestPanel.py	2010-06-25 20:50:03 UTC (rev 29694)
@@ -0,0 +1,71 @@
+class hashcode(bpy.types.Operator):
+    bl_idname = "Hashcode"
+    bl_label = "Hashcode"
+    
+    def poll(self, context):
+        return True
+    
+    def execute(self, context):
+        print("Foobarred")
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        wm = context.manager
+        wm.add_fileselect(self)
+        print("Selecting file")
+        return {'RUNNING_MODAL'}
+
+
+class hashopener(bpy.types.Operator):
+    bl_idname = "tests.open"
+    bl_label = "Hashfile Opener"
+
+    def poll(self, context):
+        return True
+
+    def execute(self, context):
+        print("Sample")
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        wm = context.manager
+        wm.add_fileselect(self)
+        print("Selecting file")
+        return {'RUNNING_MODEL'}
+
+
+class hashpanel(bpy.types.Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'TOOLS'
+    bl_label = "Testing Tools"
+
+    def draw(self, context):
+        layout = self.layout
+        row = layout.row()
+#        row.label(text="Render")
+#        row.operator_context = 'INVOKE_REGION_WIN'
+        row.operator('Hashcode', text = "Foo")
+	
+classes = [
+    hashcode,
+    hashpanel,
+]
+
+#Note used, there for notes while writing.
+#def menu_func(self, context):

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list