Get Emitter Directions in Particle Expression


※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

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 もご覧ください。
添付ファイル