faster way to create particle cloud?


#1

Hi

I have written a script that takes a text file as input, and for each text file line, adds a particle (using emit) to a previously created paritcle system. Then, I use the particle -e command to edit the particle color to information that is also in that particles text file line -

so a line of the text file is just:

[x pos], [y pos], [z pos],[r color],[gcolor],[b color]

The problem is, that the text files I am importing in are extremely big - 26mb - some over 1million lines of particle information…

When I cut down the size of the text file to just a few thousand lines, the MEL script works great - and doesn’t take too long…

However when using one of the larger files, it just takes for ever to import the particle cloud… infact, I have never waited long enough for one to fully import (even after 3 hours, i dont reckon it is even close to being done).

Does anyone have any suggestions on how to speed this up -

again - the basics of the script…

fopen and fgetline to read the lines of the text file…

a simple loop that creates a particle (using emit), and then edits the particle to set its rgbPP.


#2

I don’t know if it would help, but you could try to store all the text file info in two vector arrays first before you go into the particle edit loop.

You could also try setting up a progressWindow for debugging purposes and having the ability to cancel.


#3

i agree here…using vectors would speed things up quite a bit i’d say…also to cut down on the file size and loading time you could use the same base equation for all position vectors and rgb vectors and mix them up a bit by adding an attribute to the generated particles to modify the code directly so that rather then loading all 6 params you only load the 2 vectors and offset them via basic expression math. theoretically i believe this would work out to load much faster. hope this helps! :smiley:


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.