[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21382] trunk/blender/release/scripts/ export_map.py: fix for a bug reported by j michaelson, empty nodes were not exported, also noticed files were invalid if there were no meshes or surfaces.

Campbell Barton ideasman42 at gmail.com
Mon Jul 6 13:23:23 CEST 2009


Revision: 21382
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21382
Author:   campbellbarton
Date:     2009-07-06 13:23:22 +0200 (Mon, 06 Jul 2009)

Log Message:
-----------
fix for a bug reported by j michaelson, empty nodes were not exported, also noticed files were invalid if there were no meshes or surfaces.

Modified Paths:
--------------
    trunk/blender/release/scripts/export_map.py

Modified: trunk/blender/release/scripts/export_map.py
===================================================================
--- trunk/blender/release/scripts/export_map.py	2009-07-06 11:06:34 UTC (rev 21381)
+++ trunk/blender/release/scripts/export_map.py	2009-07-06 11:23:22 UTC (rev 21382)
@@ -2,14 +2,14 @@
 
 """
 Name: 'Quake 3 (.map)'
-Blender: 243
+Blender: 249
 Group: 'Export'
 Tooltip: 'Export to Quake map format'
 """
 
 __author__ = 'Campbell Barton'
-__version__ = '0.1'
-__email__ = "cbarton at metavr.com"
+__version__ = '0.1a'
+__email__ = "ideasman42 at gmail.com"
 __bpydoc__ = """\
 This script Exports a Quake 3 map format.
 
@@ -234,7 +234,7 @@
 	as a MAP node as long as it has the property name - classname
 	returns True/False based on weather a node was written
 	'''
-	props= [(p.name, p.data) for p in ob.properties]
+	props= [(p.name, p.data) for p in ob.game_properties]
 	
 	IS_MAP_NODE= False
 	for name, value in props:
@@ -287,7 +287,7 @@
 	TOTBRUSH= TOTLAMP= TOTNODE= 0
 	
 	for ob in Object.GetSelected():
-		type= ob.getType()
+		type= ob.type
 		if type == 'Mesh':		obs_mesh.append(ob)
 		elif type == 'Surf':	obs_surf.append(ob)
 		elif type == 'Lamp':	obs_lamp.append(ob)
@@ -406,11 +406,12 @@
 				
 			else:
 				print "NOT EXPORTING PATCH", surf_name, u,v, 'Unsupported'
-			
 	
-	file.write('}\n') # end worldspan
 	
+	if obs_mesh or obs_surf:
+		file.write('}\n') # end worldspan
 	
+	
 	print '\twriting lamps'
 	for ob in obs_lamp:
 		print '\t\t%s' % ob.name





More information about the Bf-blender-cvs mailing list