View Full Version : Idea about cell division scene

 sharon2612 December 2010, 04:01 PMHi I try to create a cell division scene in which one cell divides into two and four and eight..... I figure out the logic to do it but I am pretty new with using mel script to control nParticle/particle...So I am wondering if anyone can help, so here is my logic: 1)emit first particle and set a lifespanPP=1 (any small numbers) 2)when particle 1 die, record its position x, y,z 3) at the same position, generate particle 2 and 3 (so it will look like one particle come two particles) then create a loop to make every particle to go through step 1,2,3. So that my idea about how to create the cell division scene.....is there anyone can help me to convert this idea to mel script? Thanks a lot!
dizzyone
01 January 2011, 11:47 PM
I can't help you much, I'm no expert on dealing with particles individually and it's going to be pretty complex either way.

To get the position of an individual particle:
`getParticleAttr -at worldPosition particleShape.pt[x]`; //where x is the particle ID.

You can call individual particles with a simple if statement:
if(particleShape.particleID == x) { do something here }; //again x is the particle ID.

So for instance you could create a runtime expression (this is going to be pretty dumb, but I don't intend to try it out myself, sorry):

float \$lastParticle = 0;
vector \$instancePos = `getParticleAttr -at worldPosition particleShape.pt[\$lastParticle]`;
if (particleShape.particleID == \$lastParticle)
{ particleShape.lifespanPP = 0 };
if ((particleShape.particleID > \$lastParticle) && (particleShape.particleID <=\$lastParticle+2)
{particleShape.position = \$instancePos};

I might just be making a fool out of myself with that rubbish, but hey, I guess it's worth a try :)

mandark1011
01 January 2011, 05:07 PM
you could do this effect with a piece of geo that is driven by a blendshape then use a single nParticle as a goal.

CGTalk Moderation
01 January 2011, 05:07 PM
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.

1