@@ -164,6 +164,9 @@ def GetValidBlenderName(name):
164164 return newname
165165
166166def xOpenFile (filename ):
167+ logger .info ("* Parsing file: %s ..." % filename )
168+ start = time .time ()
169+
167170 xml_file = open (filename )
168171 try :
169172 xml_doc = minidom .parse (xml_file )
@@ -173,6 +176,9 @@ def xOpenFile(filename):
173176 Report .errors .append ("File %s is not valid XML!" % filename )
174177 output = 'None'
175178 xml_file .close ()
179+
180+ logger .info ('- Done at %s seconds' % util .timer_diff_str (start ))
181+
176182 return output
177183
178184
@@ -197,7 +203,23 @@ def xCollectVertexData(data):
197203 for vb in data .childNodes :
198204 if vb .localName == 'vertexbuffer' :
199205 if vb .hasAttribute ('positions' ):
206+
207+ progressScale = 1.0 / len (vb .getElementsByTagName ('vertex' ))
208+ bpy .context .window_manager .progress_begin (0 , 100 )
209+ index = 0
210+
200211 for vertex in vb .getElementsByTagName ('vertex' ):
212+
213+ # Update progress in console
214+ percent = (index + 1 ) * progressScale
215+ sys .stdout .write ( "\r + Vertices [" + '=' * int (percent * 50 ) + '>' + '.' * int (50 - percent * 50 ) + "] " + str (int (percent * 10000 ) / 100.0 ) + "% " )
216+ sys .stdout .flush ()
217+
218+ # Update progress through Blender cursor
219+ bpy .context .window_manager .progress_update (percent )
220+
221+ index = index + 1
222+
201223 for vp in vertex .childNodes :
202224 if vp .localName == 'position' :
203225 x = float (vp .getAttributeNode ('x' ).value )
@@ -206,6 +228,8 @@ def xCollectVertexData(data):
206228 vertices .append ([x , y , z ])
207229 vertexdata ['positions' ] = vertices
208230
231+ sys .stdout .write ("\n " )
232+
209233 if vb .hasAttribute ('normals' ) and config .get ('IMPORT_NORMALS' ):
210234 for vertex in vb .getElementsByTagName ('vertex' ):
211235 for vn in vertex .childNodes :
@@ -237,7 +261,7 @@ def xCollectVertexData(data):
237261 for vt in vertex .childNodes :
238262 if vt .localName == 'texcoord' :
239263 u = float (vt .getAttributeNode ('u' ).value )
240- v = - float (vt .getAttributeNode ('v' ).value )+ 1.0
264+ v = - float (vt .getAttributeNode ('v' ).value ) + 1.0
241265 uvcoords .append ([u , v ])
242266
243267 if len (uvcoords ) > 0 :
@@ -1323,7 +1347,7 @@ def load(filepath):
13231347 fps = xAnalyseFPS (xDocSkeletonData )
13241348 if (fps and config .get ('ROUND_FRAMES' )):
13251349 logger .info (" * Setting FPS to %s" % fps )
1326- bpy .context .scene .render .fps = fps
1350+ bpy .context .scene .render .fps = int ( fps )
13271351 xCollectAnimations (meshData , xDocSkeletonData )
13281352
13291353 else :
0 commit comments