faster way to create particle cloud?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2005
faster way to create particle cloud?


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.
  03 March 2005
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.
  03 March 2005
Originally Posted by Anders Egleus: ...but you could try to store all the text file info in two vector arrays first before you go into the particle edit loop.

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!
  03 March 2005
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:49 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.