[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18743] trunk/blender/release/scripts: [ #18241] Very minor bugfix and typo correction for wavefront obj exporter and importer python scripts

Campbell Barton ideasman42 at gmail.com
Fri Jan 30 03:01:20 CET 2009


Revision: 18743
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18743
Author:   campbellbarton
Date:     2009-01-30 03:01:16 +0100 (Fri, 30 Jan 2009)

Log Message:
-----------
[#18241] Very minor bugfix and typo correction for wavefront obj exporter and importer python scripts
from ?\239?\187?\191Michael Judd.

Also removed .keys() for a loop in impor_obj.py since its the default dictionary iterator.

Modified Paths:
--------------
    trunk/blender/release/scripts/export_obj.py
    trunk/blender/release/scripts/import_obj.py

Modified: trunk/blender/release/scripts/export_obj.py
===================================================================
--- trunk/blender/release/scripts/export_obj.py	2009-01-30 00:22:17 UTC (rev 18742)
+++ trunk/blender/release/scripts/export_obj.py	2009-01-30 02:01:16 UTC (rev 18743)
@@ -120,7 +120,7 @@
 		if img:  # We have an image on the face!
 			file.write('map_Kd %s\n' % img.filename.split('\\')[-1].split('/')[-1]) # Diffuse mapping image			
 		
-		elif not mat: # No face image. if we havea material search for MTex image.
+		elif mat: # No face image. if we havea material search for MTex image.
 			for mtex in mat.getTextures():
 				if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
 					try:

Modified: trunk/blender/release/scripts/import_obj.py
===================================================================
--- trunk/blender/release/scripts/import_obj.py	2009-01-30 00:22:17 UTC (rev 18742)
+++ trunk/blender/release/scripts/import_obj.py	2009-01-30 02:01:16 UTC (rev 18743)
@@ -424,8 +424,8 @@
 					sharp_edges[key]= None
 	
 	
-	# mat the material names to an index
-	material_mapping= dict([(name, i) for i, name in enumerate(unique_materials.keys())])
+	# map the material names to an index
+	material_mapping= dict([(name, i) for i, name in enumerate(unique_materials)]) # enumerate over unique_materials keys()
 	
 	materials= [None] * len(unique_materials)
 	





More information about the Bf-blender-cvs mailing list