fast export/import

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

Post Reply
keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

fast export/import

Post by keltar »

Python scripts is too slow. dna library is also very slow, but faster than python.
I thing, C API for plugins may be faster becouse it can use already loaded blend-file.
Is the faster method exists?

giza808
Posts: 0
Joined: Sun Jul 24, 2005 10:25 pm
Location: Bloomington, IL USA
Contact:

Patcience is an aquired skill

Post by giza808 »

I think that if you changed python to C API you would also have to re-work all the plugins. That seems like a lot of work.
Afrothunder has entered the building.

keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

Post by keltar »

hm.. Why change? Blender has exelent python api, but do not provide access to geometry to C-plugins. So, I talk about adding more usable api to C-plugins, because python is too slow (model with 300000 vertices exports more than 2 days!)

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo »

what exporter does take so long? sounds like something is wrong with it (maybe some brute force methods which aren't suited for python or something like that?).

keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

Post by keltar »

ok, if you like python very mach, maybe you want to trash ALL Blender C API and rewrite texture plugins on python (and ignore the low speed)??? I think, C API is the main defect of Blender. Too sad...

kakapo
Posts: 0
Joined: Sat Sep 04, 2004 2:32 pm

Post by kakapo »

sorry, i just tried to be helpful! i have no opinion about improving the c-api...

i have exported 50000 polygon models with python and it took 15 - 30 seconds on my pc!

so 300000 polygons shouldn't take 2 days unless the exporter scales exponentially which would also be a problem in c since c is only 50 - 100 times faster than python. your export would take half an hour in c. sounds like something is wrong there.

but maybe i am just talking nonsense here. :) i am no expert on this.

btw. as far as i know there will be python texture plugins. :P

keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

Post by keltar »

thanks :)
so, i will rewrite Blender parts to extend c api
PS: python slower much more than 50-100 times. I benchmarks it

keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

Post by keltar »

"yafray rendering" creates XML file contains all geometry and materials. It works VERY fast! So I rewrite 1 file and add my own file format support to blender yafray's xml generator. Now when I need export model, I chousing "yafray rendering" and seting X-resolution to 4 (minimal value) (if resolution is non-4, it generates XML for yafray). My large model exports ~30 seconds!
But how can I do fast import?...

ideasman
Posts: 0
Joined: Tue Feb 25, 2003 2:37 pm

Post by ideasman »

Python is not __THAT__ slow- make a bug report, give your mesh as an example and obviously the script that ran slow. somebody will look into it

I managed to optimize the obj importer to import a 13 meg obj in 9 seconds.

Also
What are you on about dna being slow too?

- Cam

keltar
Posts: 0
Joined: Thu Jan 01, 1970 1:00 am

Post by keltar »

very simple example : amounting of 1 million 3d-vectors
0m5.374s - python
0m0.012s - C (not C++)

5.374s / 0.012s ~= 478. So python slower than C by 478 times, isn't it?
So C-plugin should be work with my model ~6 minules (python script works 2 days).
I know that maybe I write not-optimised script (I'm not a python scripter), but interpretated language is always very slow!

I say dna is slow because it works much more slower than Blender itself.

And only one question - WHY Blender do not have good C-API if it written in C/C++ itself??

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d »

so your own export script is very slow eh?

I've loaded/saved models with several thousand polygons in less than a minute, I'd blame your script more than I'd blame python.

python isn't blazing fast, but it isn't that slow.

coelurus
Posts: 0
Joined: Sat Jun 18, 2005 9:21 pm

Post by coelurus »

There's always the possibility of reading/writing blend files directly (have a look at blend2cs for Crystal Space), to make a straight dump via Python and then process the output with C or write some Python-modules in C for some custom routines you can use in Python. Python will most probably be around so find ways around it instead :)

scourage
Posts: 0
Joined: Wed Jan 07, 2004 12:54 pm

Post by scourage »

The first rule of optimizing is to optimize where you need it. How many times per frame do you export your model-probably none. You probably export one time once you've finished modeling. Take the time that you are waiting for your model to export to get some coffee. I don't think it's a good use of your time to focus on optimizing that piece of the production pipeline.

5.3 seconds for 1 million verts does seem higher than normal. Be sure that you're releasing variables when you're done using them, especially in a loop or you could be eating memory up when you don't need to which could cause you to start using virtual memory which will make any program very slow. Check out the python docs about that.

The DNA library really has nothing to do with it. It's used for how the information is stored on disk so that different architectues can open the same blend file.

My 2 cents,

Bob
Halfway down the trail to hell....

Post Reply