[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19640] trunk/blender/release/scripts/ import_obj.py: strip indentation from lines of OBJ files.

Campbell Barton ideasman42 at gmail.com
Fri Apr 10 16:33:52 CEST 2009


Revision: 19640
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19640
Author:   campbellbarton
Date:     2009-04-10 16:33:52 +0200 (Fri, 10 Apr 2009)

Log Message:
-----------
strip indentation from lines of OBJ files.
OBJ's from VMD's molecular visualization program had this.

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

Modified: trunk/blender/release/scripts/import_obj.py
===================================================================
--- trunk/blender/release/scripts/import_obj.py	2009-04-10 14:27:29 UTC (rev 19639)
+++ trunk/blender/release/scripts/import_obj.py	2009-04-10 14:33:52 UTC (rev 19640)
@@ -537,6 +537,7 @@
 	'''
 	file= open(filepath, 'rU')
 	for line in file: #.xreadlines():
+		line = line.lstrip()
 		if line.startswith('v'): # vn vt v 
 			if ',' in line:
 				return lambda f: float(f.replace(',', '.'))
@@ -590,6 +591,7 @@
 	time_sub= sys.time()
 	file= open(filepath, 'rU')
 	for line in file: #.xreadlines():
+		line = line.lstrip() # rare cases there is white space at the start of the line
 		
 		if line.startswith('v '):
 			line_split= line.split()





More information about the Bf-blender-cvs mailing list