From f08aab441b37ae93cb3ffc6187494f29ce1b2357 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Feb 2007 14:27:36 +0000 Subject: [PATCH] used slightly faster text cleaning, fixed benchmark not to include time spent selecting a file. --- release/scripts/kmz_ImportWithMesh.py | 36 +++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/release/scripts/kmz_ImportWithMesh.py b/release/scripts/kmz_ImportWithMesh.py index d90aeb07b50..abf267e57ef 100644 --- a/release/scripts/kmz_ImportWithMesh.py +++ b/release/scripts/kmz_ImportWithMesh.py @@ -655,7 +655,7 @@ TAG4=1 eps=0.0000001 npoly=0 nedge=0 -gt1=Blender.sys.time() + def create_LINE(BROKEN_LINE,tv): global TAG4,nedge @@ -683,7 +683,7 @@ def cree_POLYGON(ME,TESSEL): if TAG5 and npoly %TAG5 == 1 : Blender.Window.Redraw(Blender.Window.Types.VIEW3D) - g2= Blender.sys.time()-gt1 + # g2= Blender.sys.time()-gt1 # print int(g2/60),':',int(g2%60) ME_verts = ME.verts @@ -762,9 +762,10 @@ def active_FORME(): if len(ME.verts)>0: ME.sel = True ME.remDoubles(0.0) - + +WW = [0.0] def wash_DATA(ndata): - if ndata!='': + if ndata: ndata=ndata.replace('\n',',') ndata=ndata.replace('\r','') while ndata[-1]==' ': @@ -778,10 +779,7 @@ def wash_DATA(ndata): ndata=ndata.replace(',,',',') ndata=ndata.replace(' ',',') ndata=ndata.split(',') - for i in xrange(len(ndata)-1, -1, -1): - if not ndata[i]: - ndata.pop(i) - + ndata = [i for i in ndata if i] return ndata def collecte_ATTRIBUTS(data): @@ -974,7 +972,7 @@ def contruit_HIERARCHIE(t,tv0=0,tv=0): def scan_FILE(nom): global NUMBER, PLACEMARK, SC, OB, ME, POLYGON_NUMBER, TAG3, TAG4, TAG5 - + dir,name=split(nom) name=name.split('.') result=0 @@ -985,7 +983,10 @@ def scan_FILE(nom): print 'Number of Polygons : ', POLYGON_NUMBER EDGES_NUMBER=t.count('