Revision: 31132 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31132 Author: leifandersen Date: 2010-08-07 06:13:30 +0200 (Sat, 07 Aug 2010)
Log Message: ----------- 1. Made the final changes to the hash operator (if I do change it again, it will be to take into account all data stored in the .blend file, not just that attached to a scene). This change changed all of the hashcodes, I fixed the ones in the export import tests, as well as the physics ones, however, I did it by automation, as such, the hashfile isn't too pretty at the moment. 2. Made a few bits of code cleaning to all of the python tests. 3. Implemented the last of the python tests. The only remaining ones left are the window/gui python apis, and blender 2.5's GUI doesn't work the same way, (at least I don't think it does), as such, I could make some implementations, but others don't seem practical at this time. 3. Fixed the write_hashcode bug that appeared this morning (after chaning from an array of tuples, to an actual hashtable). 4. Adding the remaining tests to CMake. Modified Paths: -------------- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py branches/soc-2010-leifandersen/tests/hash_compare.py branches/soc-2010-leifandersen/tests/hashfile.txt branches/soc-2010-leifandersen/tests/python/Armature_example2.py branches/soc-2010-leifandersen/tests/python/BGL_example.py branches/soc-2010-leifandersen/tests/python/CMakeLists.txt branches/soc-2010-leifandersen/tests/python/Camera_example.py branches/soc-2010-leifandersen/tests/python/Constraint_example1.py branches/soc-2010-leifandersen/tests/python/Constraint_example2.py branches/soc-2010-leifandersen/tests/python/Draw_example.py branches/soc-2010-leifandersen/tests/python/Font_example.py branches/soc-2010-leifandersen/tests/python/Group_example2.py branches/soc-2010-leifandersen/tests/python/MeshPrimitives_example.py branches/soc-2010-leifandersen/tests/python/Mesh_example.py branches/soc-2010-leifandersen/tests/python/MetaBall_example.py branches/soc-2010-leifandersen/tests/python/Modifier_example.py branches/soc-2010-leifandersen/tests/python/NMesh_example.py branches/soc-2010-leifandersen/tests/python/Object_example.py branches/soc-2010-leifandersen/tests/python/Radio_example.py branches/soc-2010-leifandersen/tests/python/Render_example.py branches/soc-2010-leifandersen/tests/python/Scene_example.py branches/soc-2010-leifandersen/tests/python/Sound_example.py branches/soc-2010-leifandersen/tests/python/Sound_example.py.blend branches/soc-2010-leifandersen/tests/python/Text3d_example.py branches/soc-2010-leifandersen/tests/python/Text3d_example.py.blend branches/soc-2010-leifandersen/tests/python/Text_example.py branches/soc-2010-leifandersen/tests/python/Text_example.py.blend branches/soc-2010-leifandersen/tests/python/Timeline.py branches/soc-2010-leifandersen/tests/python/Timeline.py.blend branches/soc-2010-leifandersen/tests/python/Types_example.py branches/soc-2010-leifandersen/tests/python/Types_example.py.blend branches/soc-2010-leifandersen/tests/python/Window_example1.py branches/soc-2010-leifandersen/tests/python/World_example1.py branches/soc-2010-leifandersen/tests/python/World_example1.py.blend branches/soc-2010-leifandersen/tests/python/World_example2.py branches/soc-2010-leifandersen/tests/python/World_example2.py.blend branches/soc-2010-leifandersen/tests/python/effect_example.py branches/soc-2010-leifandersen/tests/python/image_example.py branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py =================================================================== --- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-07 02:13:39 UTC (rev 31131) +++ branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-07 04:13:30 UTC (rev 31132) @@ -27,6 +27,51 @@ hashcode = 0 for scene in bpy.data.scenes: hashcode += hash(scene.name) + if scene.world != None: + w = scene.world + hashcode += hash(w.bl_rna.name) + hashcode += hash(w.name) + hashcode += hash(w.exposure) + li = w.lighting + hashcode += hash(li.environment_color) + hashcode += hash(li.bias) + hashcode += hash(li.correction) + hashcode += hash(li.distance) + hashcode += hash(li.environment_energy) + hashcode += hash(li.error_tolerance) + hashcode += hash(li.falloff) + hashcode += hash(li.falloff_strength) + hashcode += hash(li.gather_method) + hashcode += hash(li.indirect_bounces) + hashcode += hash(li.indirect_factor) + hashcode += hash(li.passes) + hashcode += hash(li.pixel_cache) + hashcode += hash(li.samples) + hashcode += hash(li.sample_method) + hashcode += hash(li.threshold) + hashcode += hash(li.use_ambient_occlusion) + hashcode += hash(li.use_environment_lighting) + hashcode += hash(li.use_indirect_lighting) + mi = w.mist + hashcode += hash(mi.depth) + hashcode += hash(mi.falloff) + hashcode += hash(mi.height) + hashcode += hash(mi.intensity) + hashcode += hash(mi.start) + hashcode += hash(mi.use_mist) + hashcode += hash(w.paper_sky) + hashcode += hash(w.range) + hashcode += hash(w.real_sky) + st = w.stars + hashcode += hash(st.color_randomization) + hashcode += hash(st.size) + for texslot in w.texture_slots: + if texslot != None: + hashcode += hash(texslot.name) + for num in w.horizon_color: + hashcode += hash(num) + for num in w.zenith_color: + hashcode += hash(num) for ob in scene.objects: hashcode += hash(ob.name) hashcode += hash(ob.type) @@ -434,12 +479,12 @@ directory = StringProperty(name="File Directory", description="File Directory used", maxlen= 1024, default= "") def poll(self, context): - return len(tests.hashfile.data) < 0 + return True def execute(self, context): file = open(self.properties.filepath, 'w') for element in tests.hashfile.data: - file.write(element + " = " + tests.hashfile.data[element] + "\n") + file.write(element + " = " + str(tests.hashfile.data[element]) + "\n") file.close() return {'FINISHED'} Modified: branches/soc-2010-leifandersen/tests/hash_compare.py =================================================================== --- branches/soc-2010-leifandersen/tests/hash_compare.py 2010-08-07 02:13:39 UTC (rev 31131) +++ branches/soc-2010-leifandersen/tests/hash_compare.py 2010-08-07 04:13:30 UTC (rev 31132) @@ -16,6 +16,7 @@ def test_case(self): bpy.ops.tests.hash() + tests.hashfile.data[os.path.split(bpy.data.filepath)[1]] = tests.hashfile.last_hash self.assertEquals(self.hash, tests.hashfile.last_hash) def suite(): @@ -24,7 +25,7 @@ ]) if __name__ == "__main__": - print(bpy.ops.tests.read_hashfile(filepath=os.path.join(os.path.split(sys.argv[0])[0], 'hashfile.txt'))) + bpy.ops.tests.read_hashfile(filepath=os.path.join(os.path.split(sys.argv[0])[0], 'hashfile.txt')) data = tests.hashfile.data unittest.TextTestRunner(verbosity=2).run(suite()) bpy.ops.wm.exit_blender() Modified: branches/soc-2010-leifandersen/tests/hashfile.txt =================================================================== --- branches/soc-2010-leifandersen/tests/hashfile.txt 2010-08-07 02:13:39 UTC (rev 31131) +++ branches/soc-2010-leifandersen/tests/hashfile.txt 2010-08-07 04:13:30 UTC (rev 31132) @@ -1,56 +1,67 @@ -# Export_Import_Tests -all_quads.blend = 4476784385202570807 -all_tris.blend = 4476784386880585889 -edges.blend = 4476784382546500577 -fgons.blend = 4476784395924799360 -mixed_quads_and_tris.blend = 4476784389230442082 -NURBS.blend = 4476784380650705631 -vertices.blend = 4476784380650705631 - -# Physics -boids.blend = 3658705244932225025 -continue_physics.blend = 29552361635886812012 -fluidsim.blend = 6272360887841423892 -fountain.blend = 12235246013706623080 -particle_children_hair.blend = 15571841953816041222 -particle_extras_effector.blend = 29821303617275196601 -radioroom.blend = 165466738618733210673 -softbody_basics.blend = -9867193991627132880 -softbodytest.blend = 27517989050919739075 -softhairtest.blend = -12101118624995636669 - -# Python -Armature_example2.py.blend_start = -364238819647067223878 -Armature_example2.py.blend_end = -344900587044515783735 -Camera_example.py.blend_start = -14300758262507746666 +World_example1.py.blend_start = -21460235683897623202 +fountain.blend = -90408879630794019858 +continue_physics.blend = 28201081405090388890 +MetaBall_example.py.blend_end = -16465600348693923713 +vertices.blend = -2682693042075006681 +Text3d_example.py.blend_end = -67354993459007165426 +Window_example1.py.blend_start = -21460235683897623202 +all_quads.blend = -2682693037523141505 +boids.blend = -40713013047557739166 +MetaBall_example.py.blend_start = -22262356698404542388 Camera_example.py.blend_end = -31619213351238176625 -Constraint_example1.py.blend_start = -2034449402296039890 -Constraint_example1.py.blend_end = -2034449400852879826 -Constraint_example2.py.blend_start = -207409205650300112139 +Timeline.py.blend_end = -21460235683897623202 Constraint_example2.py.blend_end = -207409205650300112138 +Text3d_example.py.blend_start = -29421834119794418924 +softbodytest.blend = -9262247178309158057 +Font_example.py.blend_end = -60195516037617288890 +Camera_example.py.blend_start = -21460235683897623202 +Timeline.py.blend_start = -21460235683897623202 +mixed_quads_and_tris.blend = -2682693033495270230 +Mesh_example.py.blend_end = -20878286593088736557 +Render_example.py.blend_end = -21460235683897623202 +MeshPrimitives_example.py.blend_start = -22262356698404542388 effect_example.py.blend_start = -15342881782350963335 -effect_example.py.blend_end = -15342881782350962885 -Font_example.py.blend_start = -22262356698404542388 -Font_example.py.blend_end = -60195516037617288890 -Group_example2.py.blend_start = -2748352640926596867 -Group_example2.py.blend_end = -7145151643561397340 -image_example.py.blend_start = -14300758262507746666 -image_example.py.blend_end = -5745724874654974270 -lamp_modes_example.py.blend_start = -15330808205140559615 lamp_modes_example.py.blend_end = -29347588579616917852 +NMesh_example.py.blend_start = -21460235683897623202 +Armature_example2.py.blend_end = -344900587044515783735 +Modifier_example.py.blend_start = -21460235683897623202 +radioroom.blend = 177416463714617646500 +Armature_example2.py.blend_start = -364238819647067223878 Mesh_example.py.blend_start = -22262356698404542388 -Mesh_example.py.blend_end = -20878286593088736557 -MeshPrimitives_example.py.blend_start = -22262356698404542388 -MeshPrimitives_example.py.blend_end = -14300758262507746663 -MetaBall_example.py.blend_start = -22262356698404542388 -MetaBall_example.py.blend_end = -16465600348693923713 -Modifier_example.py.blend_start = -14300758262507746666 Modifier_example.py.blend_end = -14765986523746378294 -NMesh_example.py.blend_start = -14300758262507746666 +Types_example.py.blend_end = -21460235683897623202 +NURBS.blend = -2682693042075006681 NMesh_example.py.blend_end = -14300758261913453413 -Object_example.py.blend_start = -14300758262507746666 +fluidsim.blend = -5431925308131594804 +Font_example.py.blend_start = -22262356698404542388 +lamp_modes_example.py.blend_start = -15330808205140559615 +Constraint_example2.py.blend_start = -207409205650300112139 +all_tris.blend = -2682693035845126423 +softbody_basics.blend = -3733365799846093392509 +effect_example.py.blend_end = -15342881782350962885 +Scene_example.py.blend_start = -21460235683897623202 +Text_example.py.blend_end = -22965085122258125113 Object_example.py.blend_end = -23496178611252018289 -Render_example.py.blend_start = -14300758262507746666 -Render_example.py.blend_end = -14300758262507746666 -Scene_example.py.blend_start = -14300758262507746666 -Scene_example.py.blend_end = -20538575849302840700 \ No newline at end of file +Sound_example.py.blend_end = -21460235683897623202 +World_example2.py.blend_start = -21460235683897623202 +particle_extras_effector.blend = -26483058602446791101 +image_example.py.blend_start = -21460235683897623202 +World_example2.py.blend_end = -21460235683897623202 +particle_children_hair.blend = -25006885455320967931 +edges.blend = -2682693040179211735 +fgons.blend = -2682693026800912952 +Sound_example.py.blend_start = -21460235683897623202 +Scene_example.py.blend_end = -20538575849302840700 +Group_example2.py.blend_end = -7145151643561397340 +Render_example.py.blend_start = -21460235683897623202 +Window_example1.py.blend_end = -21460235683897623202 +softhairtest.blend = -48788699081213793148 +Constraint_example1.py.blend_end = -2034449400852879826 +Types_example.py.blend_start = -21460235683897623202 +Text_example.py.blend_start = -21460235683897623202 +image_example.py.blend_end = -5745724874654974270 +Constraint_example1.py.blend_start = -2034449402296039890 +Object_example.py.blend_start = -21460235683897623202 +World_example1.py.blend_end = -21460235683897623202 +MeshPrimitives_example.py.blend_end = -14300758262507746663 +Group_example2.py.blend_start = -2748352640926596867 Modified: branches/soc-2010-leifandersen/tests/python/Armature_example2.py =================================================================== @@ 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