PDA

View Full Version : finding out which point a particle was emitted from


gmask
08-23-2008, 03:10 AM
I have a particle that is using expressions and a goal object to force the particle to crawl on the surface.

Those particles are emitting more particles to create a trail.

I'm assigning the new particles to the same goal object as well so that they stick to the surface as it deforms.

The trick is to get the uv values from the emitting particle to assign to the new particles goalUV settings when it's created.

So far I cannot figure out how to determine which particle is emitting the new one so I can query it for it's goalUV info.

I've tried a bunch of the attributes from the particle node but none of them seem to hold this info.

gmask
08-23-2008, 04:01 AM
okay parentId.. I've almost got it

gmask
08-23-2008, 04:06 AM
the solution

$x=particleShape2.parentId;

$pu=`particle -at goalU -id $x -q particleShape1`;
$pv=`particle -at goalV -id $x -q particleShape1`;

particleShape2.goalU=$pu[0];
particleShape2.goalV=$pv[0];

Aikiman
08-23-2008, 04:18 AM
The UV values of the Original particle will be its goalU and goalV. I think the best way to obtain these values and transfer them over to the second particle shape is to use the emit command rather than use the original particle as an emitter and goal your second particle as well.

So something like

if (frame%20==0) {
float $goalU = particleShape1.goalU;
float $goalV = particleShape1.goalV;
emit -object particle2 -pos 0 0 0 -at goalU -fv ($goalU) -at goalV -fv ($goalV);
}


This will emit one particle every 20 frames at every particleShape1.goalU and goalV coords. Hope this helps.

Aikiman
08-23-2008, 04:19 AM
Arhh okay, you found a solution already :)

gmask
08-23-2008, 04:33 AM
Arhh okay, you found a solution already :)

thanks for that anyway ;-)

I tried the emit command awhile back but it was really slow and I need a really high emission rate.

CGTalk Moderation
08-23-2008, 04:33 AM
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.