Revision: 31197 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31197 Author: leifandersen Date: 2010-08-09 17:42:56 +0200 (Mon, 09 Aug 2010)
Log Message: ----------- 1. Using the loop method in the physics folderr. 2. Fixed the scripts so that it matches the new python api Modified Paths: -------------- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py branches/soc-2010-leifandersen/release/scripts/op/tests_render.py branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py branches/soc-2010-leifandersen/tests/physics/CMakeLists.txt Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-09 15:29:33 UTC (rev 31196) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-09 15:42:56 UTC (rev 31197) @@ -6,10 +6,11 @@ from bpy.props import * -class TESTS_OT_hash(bpy.types.Operator): +class Hash(bpy.types.Operator): '''Prints out a hash of the current blend file''' - bl_idname = "TESTS_OT_hash" + bl_idname = "tests.hash" bl_label = "Hash Test" + bl_options = {'REGISTER'} # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. @@ -21,6 +22,7 @@ # 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'}) + @classmethod def poll(self, context): return len(bpy.data.scenes) > 0 @@ -471,15 +473,17 @@ return {'FINISHED'} -class TESTS_OT_write_hashfile(bpy.types.Operator): +class WriteHashfile(bpy.types.Operator): '''Writes the current hash set stored into a hashfile''' - bl_idname = "TESTS_OT_write_hashfile" + bl_idname = "tests.write_hashfile" bl_label = "Write Hash File" + bl_options = {'REGISTER'} 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= "") + @classmethod def poll(self, context): return True @@ -495,15 +499,17 @@ wm.add_fileselect(self) return {'RUNNING_MODAL'} -class TESTS_OT_read_hashfile(bpy.types.Operator): +class ReadHashfile(bpy.types.Operator): '''Writes the current hash set stored into a hashfile''' - bl_idname = "TESTS_OT_read_hashfile" + bl_idname = "tests.read_hashfile" bl_label = "Read Hash File" - + bl_options = {'REGISTER'} + 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= "") + @classmethod def poll(self, context): return True @@ -532,12 +538,6 @@ wm = context.manager wm.add_fileselect(self) return {'RUNNING_MODAL'} - -classes = [ - TESTS_OT_hash, - TESTS_OT_write_hashfile, - TESTS_OT_read_hashfile, -] #def register(): # for i in classes: Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_render.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_render.py 2010-08-09 15:29:33 UTC (rev 31196) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_render.py 2010-08-09 15:42:56 UTC (rev 31197) @@ -10,10 +10,11 @@ PILTEST_PY = "run.py" IMAGEDIFF_PY = os.path.join(os.path.split(sys.argv[0])[0], 'imagediff.py') -class TESTS_OT_render(bpy.types.Operator): +class Render(bpy.types.Operator): '''''' - bl_idname = "TESTS_OT_render" + bl_idname = "tests.render" bl_label = "Render Test" + bl_options = {'REGISTER'} # List of operator properties, the attributes will be assigned # to the class instance from the operator settings before calling. @@ -25,6 +26,7 @@ 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'}) + @classmethod def poll(self, context): return True @@ -41,15 +43,17 @@ wm.add_fileselect(self) return {'RUNNING_MODAL'} -class TESTS_OT_anim(bpy.types.Operator): +class Anim(bpy.types.Operator): '''''' - bl_idname = "TESTS_OT_anim" + bl_idname = "tests.anim" bl_label = "Animation Render Test" + bl_options = {'REGISTER'} 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= "") + @classmethod def poll(self, context): return True @@ -66,15 +70,17 @@ wm.add_fileselect(self) return {'RUNNING_MODAL'} -class TESTS_OT_render_build(bpy.types.Operator): +class RenderBuild(bpy.types.Operator): '''''' - bl_idname = "TESTS_OT_render_build" + bl_idname = "tests.render_build" bl_label = "Animation Render Test" + bl_options = {'REGISTER'} 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= "") + @classmethod def poll(self, context): return True @@ -91,15 +97,17 @@ wm.add_fileselect(self) return {'RUNNING_MODAL'} -class TESTS_OT_anim_build(bpy.types.Operator): +class AnimBuild(bpy.types.Operator): '''''' - bl_idname = "TESTS_OT_anim_build" + bl_idname = "tests.anim_build" bl_label = "Animation Render Test" + bl_options = {'REGISTER'} 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= "") + @classmethod def poll(self, context): return True @@ -115,13 +123,6 @@ wm = context.manager wm.add_fileselect(self) return {'RUNNING_MODAL'} - -classes = [ - TESTS_OT_render, - TESTS_OT_anim, - TESTS_OT_render_build, - TESTS_OT_anim_build, -] #def register(): # for i in classes: Modified: branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py 2010-08-09 15:29:33 UTC (rev 31196) +++ branches/soc-2010-leifandersen/release/scripts/ui/space_tests.py 2010-08-09 15:42:56 UTC (rev 31197) @@ -8,16 +8,16 @@ def draw(self, context): layout = self.layout - layout.operator("TESTS_OT_render", text="Render Test") - layout.operator("TESTS_OT_anim", text="Animation Test") + layout.operator("tests.render", text="Render Test") + layout.operator("tests.anim", text="Animation Test") layout.operator("RENDER_OT_render", text="Render") layout.separator() - layout.operator("TESTS_OT_render_build", text="Build Render Test") - layout.operator("TESTS_OT_anim_build", text="Build Animation Test") + layout.operator("tests.render_build", text="Build Render Test") + layout.operator("tests.anim_build", text="Build Animation Test") layout.separator() - layout.operator("TESTS_OT_hash", text="File Hash") - layout.operator("TESTS_OT_read_hashfile", text="Read Hashfile") - layout.operator("TESTS_OT_write_hashfile", text="Write Hashfile") + layout.operator("tests.hash", text="File Hash") + layout.operator("tests.read_hashfile", text="Read Hashfile") + layout.operator("tests.write_hashfile", text="Write Hashfile") class TestsPanel(bpy.types.Panel): bl_space_type = 'VIEW_3D' @@ -29,23 +29,23 @@ row = layout.row() row.label(text="Blend hashcode: " + str(tests.hashfile.last_hash)) row = layout.row() - row.operator('TESTS_OT_hash', text = "Get Hash") + row.operator('tests.hash', text = "Get Hash") layout.separator() row = layout.row() row.label(text="Render Tests") row = layout.row() - row.operator("TESTS_OT_render", text="Render Test") + row.operator("tests.render", text="Render Test") row = layout.row() - row.operator("TESTS_OT_anim", text="Animation Test") + row.operator("tests.anim", text="Animation Test") row = layout.row() - row.operator("RENDER_OT_render", text="Render") + row.operator("tests.render", text="Render") row = layout.row() row.label(text="Status: " + tests.render.status) row = layout.row() row.label(text="Build Tests") row = layout.row() - row.operator("TESTS_OT_render_build", text="Image") - row.operator("TESTS_OT_anim_build", text="Animations") + row.operator("tests.render_build", text="Image") + row.operator("tests.anim_build", text="Animations") classes = [ INFO_MT_tests, Modified: branches/soc-2010-leifandersen/tests/physics/CMakeLists.txt =================================================================== --- branches/soc-2010-leifandersen/tests/physics/CMakeLists.txt 2010-08-09 15:29:33 UTC (rev 31196) +++ branches/soc-2010-leifandersen/tests/physics/CMakeLists.txt 2010-08-09 15:42:56 UTC (rev 31197) @@ -8,68 +8,14 @@ ) SET_TESTS_PROPERTIES(PH_Fluid PROPERTIES PASS_REGULAR_EXPRESSION "All tests passed") -ADD_TEST(PH_Boids ${Blender_BINARY_DIR}/bin/blender - ${Blender_BINARY_DIR}/tests/physics/boids.blend - -P ${Blender_BINARY_DIR}/bin/hash_compare.py -) -SET_TESTS_PROPERTIES(PH_Boids PROPERTIES PASS_REGULAR_EXPRESSION "OK") +FILE(GLOB SRC *.py) -ADD_TEST(PH_Continue_Physics ${Blender_BINARY_DIR}/bin/blender - ${Blender_BINARY_DIR}/tests/physics/continue_physics.blend - -P ${Blender_BINARY_DIR}/bin/hash_compare.py -) -SET_TESTS_PROPERTIES(PH_Continue_Physics PROPERTIES PASS_REGULAR_EXPRESSION "OK") - @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs