「Get Emitter Directions in Particle Expression」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
I got a trouble with emitter Speed and particle conserve.
Particle conserve is calculated AFTER emitter sets out particles according to emitter speed.
It makes gaps between creation frame and following frames.
To solve this issue, I had to include emitter Speed function to particle expression.
#image(emitterDirection.jpg,title=emitterDirection)
#highlight(c){{
/*
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);
}
}}
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.
#image(emitterDirection.jpg,title=emitterDirection)
#highlight(c){{
/*
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);
}
}}