fast export/import
Moderators: jesterKing, stiv
fast export/import
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?
I thing, C API for plugins may be faster becouse it can use already loaded blend-file.
Is the faster method exists?
Patcience is an aquired skill
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.
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.
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.

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

"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?...
But how can I do fast import?...
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??
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??
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 

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
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....