IsraelAbebe / blender2ogre

Automatically exported from code.google.com/p/blender2ogre
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Exporter speed optimization O(n^2) into O(n log n) (ogre forum patch by Whyte » Sat Jan 15, 2011 7:49 pm) #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Extracts from our Ogre 3D forum topic "Blender25 Ogre Exporter + extended 
.scene format" :
http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61485&start=25

---------------------------------------------------

by Whyte » Sat Jan 15, 2011 7:49 pm

Hi!

I made a little optimization, which on my system (WinServer2008 64bit) resulted 
in speeding up a largish (6k vertices) mesh export from 8 minutes to just 20 
seconds. The output is the same (for the things I tested, and as far as my 
limited brain can foretell, anyway). This only concerns meshes with UV 
textures, all other kinds of exports do not benefit from this patch.

The patch also changes os.getlogin() (which doesn't work on Win7) to 
getpass.getuser()... not sure if it's better, but it's the only one I found.

As for the fix, it's the usual optimization of O(n^2) into O(n log n). I used a 
dictionary for this, though there were probably other ways to do it too.

---------------------------------------------------

patched file attached is from the latest addon_ogreDotScene-0.3.0.zip

Original issue reported on code.google.com by sebastie...@gmail.com on 18 Mar 2011 at 9:58

Attachments:

GoogleCodeExporter commented 8 years ago
I applied the provided patch, since it is used by many forum users with no 
trouble.

Original comment by sebastie...@gmail.com on 18 Mar 2011 at 10:39

GoogleCodeExporter commented 8 years ago

Original comment by sebastie...@gmail.com on 18 Mar 2011 at 11:42