Get Emitter Directions in Particle Expression


I got a trouble with emitter Speed and particle conserve.
Particle conserve is calculated AFTER emitters set out particles according to emitter speed.
It makes gaps between the creation frame and following frames.

To solve this issue, I had to include emitter Speed function to particle expression.

    In Expression Editor, use this command like below
    float $emiDir[] = emitterDirection("particleShape1", particleShape1.emitterId);
    velocity = <<$emiDir[0], $emiDir[1], $emiDir[2]>>;
global proc float[] emitterDirection(string $particleShape, int $emitterId){
	/* Get Emitter Name from emitterId */
	string $emitters[] = `listConnections($particleShape + ".newParticles["  + $emitterId + "]")`;
	/* emitter Matrix */
	float $m[] =  `xform -q -ws -matrix $emitters[0]`;
	/* convert to vector */
	float $p[] = {0,1,0};
	return pointMatrixMult($p, $m);


ヘルプ / FAQ もご覧ください。