nParticle trails starting too late?


#1

I have a nParticle system that follows a nurbs surface with a goalPP and a ramp to move up the U.
I want this particle system to leave a trail of particles behind it, so I made it an emitter.
Unfortunately, there seems to be a delay before emitting the trails which leaves a small gap between the emitting particle and the trail particles?

Does anyone know of a fix for this?


#2

If you increase the emission per second amount, does that help?


#3

Hey Richard,

it seems to me like the position of the emitting particles is evaluated after the emission of the trail particles. You could revert the position of the emitting particles with an expression by the u value step they made. But this may result in wrong motion blur values.

I don’t know a clean way to fix it, only workarounds. Sorry.

Another slow way would be to use the emit command in a runtime expression or interpolate the trail position random between the original position and the position of the emitting particle.

Cheers


#4

Yes I think the only way is to use the emit command, however that also lets you do just about anything.
Here is a simple scene with one particle emitting into another with exactly uniform spacing of the particles:
particle_uniform_emit_particle.ma

In this the nParticle1 has an added per particle vector attribute “lastEmitPosition”. This is require to get nice uniform spacing.

In the creation expression for nParticle1 we simply set:
lastEmitPosition = position;

The runtime after dynamics expression does the emission:

"
float $separationDistance = 0.05;
vector $p = nParticleShape1.position;
vector $lastP = nParticleShape1.lastEmitPosition;
vector $dif = $p-$lastP;
float $len = mag($dif);
int $count = $len/$separationDistance;
if( $count > 0 ){
string $cmd = “emit -o nParticle2”; // build an emit command string
int $i;
vector $step = $dif * $separationDistance/$len;
for( $i = 0; $i < $count; $i++ ){
$lastP += $step;
$cmd += ("-pos " + $lastP.x + " " + $lastP.y + " " + $lastP.z); // add the position to list of points to emit. Other lines could be added to set properties like velocity.
}
eval $cmd; // evaluate the command
lastEmitPosition = $lastP;
}
"

This is simply emitting a uniformly dotted line… one could easily add randomization to the position if desired. For example:
$lastP += $step * (0.5+ rand(1.0));

(instead of “$lastP += $step”)


#5

Did you increase your oversampling numbers? Usually it set to 1, you can increase it to larger numbers so it will evaluate your emission multiple times pre-sec. This shoud fix the gap between emissions.