[Bf-python] obj importer 4x speedup

Jiri Hnidek jiri.hnidek at vslib.cz
Sat Sep 11 13:31:32 CEST 2004


Hi Cam,
good stuff. I replaced eval() with float() in the rest of code, and I 
fixed bug #1560. Let's have look:

https://projects.blender.org/tracker/?func=detail&aid=1560&group_id=9&atid=125

Tri's and fans are imported correctly now.

Example of obj file:

o octagon
v 10.000000 0.000000 0.000000
v 7.071068 0.000000 7.071068
v 0.000000 0.000000 10.000000
v -7.071068 0.000000 7.071068
v -10.000000 0.000000 0.000000
v -7.071068 0.000000 -7.071068
v -0.000000 0.000000 -10.000000
v 7.071068 0.000000 -7.071068
f 1 2 3 4 5 6 7 8

ianwill: Please, don't commit obj_import.py and obj_export.py to the cvs repository. You rewrited my changes for several times :-(. Send these files to me and I will commit it. Cam should have cvs access to the repository! ;-)

Cam: I have some other obj files for testing, are you interested?

Jiri

Campbell Barton wrote:

> Hi. I have used eval(somestring) in my obj importer- This slow and not 
> a good idea
> I replaced eval() with float() and int() both wich can handle strings 
> (I didnt know that)
> - Cam


-------------- next part --------------
A non-text attachment was scrubbed...
Name: obj_import.py
Type: text/x-python
Size: 14789 bytes
Desc: not available
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20040911/cd2d3822/attachment.py>


More information about the Bf-python mailing list