[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15368] branches/soc-2008-djd/release/ scripts: some modified scripts some working tests 3 errors

Dhanannjay Deo dhandeo at gmail.com
Fri Jun 27 14:54:27 CEST 2008


Revision: 15368
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15368
Author:   djd
Date:     2008-06-27 14:53:29 +0200 (Fri, 27 Jun 2008)

Log Message:
-----------
some modified scripts some working tests 3 errors 

Modified Paths:
--------------
    branches/soc-2008-djd/release/scripts/im_ex_test_suite.py
    branches/soc-2008-djd/release/scripts/ply_export.py
    branches/soc-2008-djd/release/scripts/x3d_export.py

Modified: branches/soc-2008-djd/release/scripts/im_ex_test_suite.py
===================================================================
--- branches/soc-2008-djd/release/scripts/im_ex_test_suite.py	2008-06-27 11:35:55 UTC (rev 15367)
+++ branches/soc-2008-djd/release/scripts/im_ex_test_suite.py	2008-06-27 12:53:29 UTC (rev 15368)
@@ -13,6 +13,15 @@
 import Blender
 from off_export import write as off_write
 
+# ply x3d X fig dae_1.4 md2 fbx
+    
+from ply_export import file_callback as ply_write
+#from x3d_export import select_file as x3d_write
+#from DirectX8Exporter import write as x_write
+from xfig_export import write_ui as xfig_write
+#from colladaExport14 import write as dae14_write
+#from md2_export import write as md2_write
+from export_fbx import write as fbx_write
 
 class ExportersTest(unittest.TestCase):
     def setUp(self):
@@ -37,23 +46,53 @@
         #Blender.Save('TestData\\export_test.obj',1);
         
     def testOFF(self):
-        """Check whether OBJ files exported are in good condition """
+        """Check whether OFF files exported are in good condition """
         # Blender along with test suit crashes here  
         off_write('TestData\\export_test.off');
         
     def testWRL(self):
-        """Check whether OBJ files exported are in good condition """
+        """Check whether WRL files exported are in good condition """
         # Blender along with test suit crashes here  
         Blender.Save('TestData\\export_test.wrl',1);
         
+    # File formats that require dialogue boxes 
+    
+    def testPLY(self):
+        """Check whether PLY files exported are in good condition """
+        ply_write('TestData\\export_test.ply');
 
+    #~ def testX3D(self):
+        #~ """Check whether %s files exported are in good condition """%('X3D')
+        #~ x3d_write('TestData\\export_test.x3d');
+
+    #~ def testX(self):
+        #~ """Check whether WRL files exported are in good condition """
+        #~ x_write('TestData\\export_test.x');
+
+    def testFIG(self):
+        """Check whether FIG files exported are in good condition """
+        xfig_write('TestData\\export_test.fig',1);
+
+    #~ def testDAE1_4(self):
+        #~ """Check whether WRL files exported are in good condition """
+        #~ dae14_write('TestData\\export_test.dae',1);
+
+    #~ def testMD2(self):
+        #~ """Check whether WRL files exported are in good condition """
+        #~ md2_write('TestData\\export_test.md2',1);
+        
+    def testFBX(self):
+        """Check whether FBX files exported are in good condition """
+        fbx_write('TestData\\export_test.fbx',1);
+        
+
 # ===== Main block ========
 print 'Exporters test suit'
 
 # ===== Combine and run the tests ======
 
 suite = unittest.makeSuite(ExportersTest,'test')
-runner = unittest.TextTestRunner(verbosity=2)
+runner = unittest.TextTestRunner(verbosity=3)
 runner.run(suite)
 
 

Modified: branches/soc-2008-djd/release/scripts/ply_export.py
===================================================================
--- branches/soc-2008-djd/release/scripts/ply_export.py	2008-06-27 11:35:55 UTC (rev 15367)
+++ branches/soc-2008-djd/release/scripts/ply_export.py	2008-06-27 12:53:29 UTC (rev 15368)
@@ -64,13 +64,14 @@
 	
 	if not filename.lower().endswith('.ply'):
 		filename += '.ply'
-	
 	scn= bpy.data.scenes.active
-	ob= scn.objects.active
+	ob= scn.objects.active;
+
 	if not ob:
+		print 'Something'        
 		Blender.Draw.PupMenu('Error%t|Select 1 active object')
 		return
-	
+
 	file = open(filename, 'wb')
 	
 	EXPORT_APPLY_MODIFIERS = Draw.Create(1)
@@ -87,21 +88,24 @@
 	#('Edges', EXPORT_EDGES, 'Edges not connected to faces.'),\
 	]
 	
-	if not Draw.PupBlock('Export...', pup_block):
-		return
+	if(Blender.mode == 'interactive'):
+		if not Draw.PupBlock('Export...', pup_block):
+			return
+
+		is_editmode = Blender.Window.EditMode()
+		if is_editmode:
+			Blender.Window.EditMode(0, '', 0)
 	
-	is_editmode = Blender.Window.EditMode()
-	if is_editmode:
-		Blender.Window.EditMode(0, '', 0)
-	
-	Window.WaitCursor(1)
-	
-	EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val
-	EXPORT_NORMALS = EXPORT_NORMALS.val
-	EXPORT_UV = EXPORT_UV.val
-	EXPORT_COLORS = EXPORT_COLORS.val
-	#EXPORT_EDGES = EXPORT_EDGES.val
-	
+		Window.WaitCursor(1)
+		
+		EXPORT_APPLY_MODIFIERS = EXPORT_APPLY_MODIFIERS.val
+		EXPORT_NORMALS = EXPORT_NORMALS.val
+		EXPORT_UV = EXPORT_UV.val
+		EXPORT_COLORS = EXPORT_COLORS.val
+		#EXPORT_EDGES = EXPORT_EDGES.val
+	else:
+		is_editmode = 0        
+		
 	mesh = BPyMesh.getMeshFromObject(ob, None, EXPORT_APPLY_MODIFIERS, False, scn)
 	
 	if not mesh:

Modified: branches/soc-2008-djd/release/scripts/x3d_export.py
===================================================================
--- branches/soc-2008-djd/release/scripts/x3d_export.py	2008-06-27 11:35:55 UTC (rev 15367)
+++ branches/soc-2008-djd/release/scripts/x3d_export.py	2008-06-27 12:53:29 UTC (rev 15368)
@@ -1006,5 +1006,7 @@
     extension=".x3dz"
   else:
     extension=".x3d"
-  Blender.Window.FileSelector(select_file,"Export X3D",createWRLPath())
+    
+if(Blender.mode == 'interactive'):
+    Blender.Window.FileSelector(select_file,"Export X3D",createWRLPath())
 





More information about the Bf-blender-cvs mailing list