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

Leif Andersen leif.a.andersen at gmail.com
Tue Jun 1 20:40:42 CEST 2010


Revision: 29138
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29138
Author:   leifandersen
Date:     2010-06-01 20:40:42 +0200 (Tue, 01 Jun 2010)

Log Message:
-----------
1.  Added a build submodule, and than a mesh sub-sub module.  It's a bit of a hack, until I can actually get importing of files (relitive to the binary directory), working.

2.  Expanded the hash test to test building a cube.  The only problem is that now for some reason it segfaults...debugging now. :)

I committed on the off chance that merging with trunk might help resolve the problem.

Modified Paths:
--------------
    branches/soc-2010-leifandersen/CMakeLists.txt
    branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
    branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
    branches/soc-2010-leifandersen/tests/hashtests/scenes.py

Added Paths:
-----------
    branches/soc-2010-leifandersen/release/scripts/modules/tests/build/
    branches/soc-2010-leifandersen/release/scripts/modules/tests/build/__init__.py
    branches/soc-2010-leifandersen/release/scripts/modules/tests/build/mesh.py

Modified: branches/soc-2010-leifandersen/CMakeLists.txt
===================================================================
--- branches/soc-2010-leifandersen/CMakeLists.txt	2010-06-01 18:12:17 UTC (rev 29137)
+++ branches/soc-2010-leifandersen/CMakeLists.txt	2010-06-01 18:40:42 UTC (rev 29138)
@@ -286,13 +286,13 @@
 	#  INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
   
 	SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows)
-
+	
 	# Setup 64bit and 64bit windows systems
 	IF(CMAKE_CL_64)
 		message("64 bit compiler detected.")
 		SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64)
 	ENDIF(CMAKE_CL_64)
-	
+		
 	ADD_DEFINITIONS(-DWIN32)
 
 	SET(ICONV ${LIBDIR}/iconv)
@@ -304,7 +304,7 @@
 	SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include)
 	SET(LIBSAMPLERATE_LIB libsamplerate)
 	SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib)
-
+	
 	SET(PNG "${LIBDIR}/png")
 	SET(PNG_INC "${PNG}/include")
 	SET(PNG_LIBPATH ${PNG}/lib)

Modified: branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-06-01 18:12:17 UTC (rev 29137)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/__init__.py	2010-06-01 18:40:42 UTC (rev 29138)
@@ -16,4 +16,4 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-from tests import scenes, objects, meshes, hashfile
+from tests import scenes, objects, meshes, hashfile, build

Added: branches/soc-2010-leifandersen/release/scripts/modules/tests/build/__init__.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/build/__init__.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/build/__init__.py	2010-06-01 18:40:42 UTC (rev 29138)
@@ -0,0 +1 @@
+from tests.build import mesh

Added: branches/soc-2010-leifandersen/release/scripts/modules/tests/build/mesh.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/build/mesh.py	                        (rev 0)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/build/mesh.py	2010-06-01 18:40:42 UTC (rev 29138)
@@ -0,0 +1,20 @@
+import bpy
+
+def cube(object_name):
+    cube = bpy.data.meshes.new('Cube')
+    cube.add_geometry(8,0,6)
+    cube.verts[0].co = [-1,-1,-1]
+    cube.verts[1].co = [-1,-1,1]
+    cube.verts[2].co = [-1,1,-1]
+    cube.verts[3].co = [-1,1,1]
+    cube.verts[4].co = [1,-1,-1]
+    cube.verts[5].co = [1,-1,1]
+    cube.verts[6].co = [1,1,-1]
+    cube.verts[7].co = [1,1,1]
+    cube.faces[0].verts_raw = [0,1,3,2]
+    cube.faces[1].verts_raw = [0,2,6,4]
+    cube.faces[2].verts_raw = [0,1,5,4]
+    cube.faces[3].verts_raw = [4,5,7,6]
+    cube.faces[4].verts_raw = [2,3,7,6]
+    cube.faces[5].verts_raw = [1,3,7,5]
+    bpy.data.objects.new(object_name, cube)

Modified: branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py	2010-06-01 18:12:17 UTC (rev 29137)
+++ branches/soc-2010-leifandersen/release/scripts/modules/tests/hashfile.py	2010-06-01 18:40:42 UTC (rev 29138)
@@ -50,7 +50,6 @@
 		split = line.split()
 		data.append([split[0],int(split[2])])
 		line = file.readline()
-	print(data)
 	file.close()
 	return data
 

Modified: branches/soc-2010-leifandersen/tests/hashtests/scenes.py
===================================================================
--- branches/soc-2010-leifandersen/tests/hashtests/scenes.py	2010-06-01 18:12:17 UTC (rev 29137)
+++ branches/soc-2010-leifandersen/tests/hashtests/scenes.py	2010-06-01 18:40:42 UTC (rev 29138)
@@ -47,10 +47,8 @@
         self.assertEquals(empty_mesh, hashcode(bpy.data.scenes[0]))
 
     def test_cube_mesh_scene(self):
-        mesh=bpy.data.meshes.new("Cube")
-        obj = bpy.data.objects.new("Cube",mesh)
-        bpy.data.scenes[0].objects.link(obj)
-        mesh.add_geometry(6,0,8)
+        cube = tests.build.mesh.cube("Cube")
+        bpy.data.scenes[0].objects.link(cube)
         self.assertEquals(cube_mesh, hashcode(bpy.data.scenes[0]))
 
 def rand_pos_int():
@@ -72,7 +70,7 @@
     return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestEmptyScene)])
 
 if __name__ == "__main__":
-#    hashlist = tests.hashfile.read(path)
-#    empty_scene = hashlist[0][1]
-#    empty_mesh = hashlist[1][1]
+    hashlist = tests.hashfile.read(path)
+    empty_scene = hashlist[0][1]
+    empty_mesh = hashlist[1][1]
     unittest.TextTestRunner(verbosity=2).run(suite())
\ No newline at end of file





More information about the Bf-blender-cvs mailing list