如何禁用各个粒子?

 
 
 

禁用某一粒子 ID 的唯一办法是使其寿命为 0。例如:

//RUN TIME EXPRESSION FOR REMOVING PARTICLES AFTER THEY REACH
//10 ON Y AXIS
//GET THE POSITION OF PARTICLES
vector $pos= particleShape1.position;
//CHECK TO SEE IF THEY HAVE PASSED A CERTAIN Y VALUE (10 in this example)
if ($pos.y>=10)
{
int $pi=particleId;
//PRINT IDs OF PARTICLES TO BE REMOVED
print ($pi+"\n");
particle -e -at lifespanPP -id $pi -fv 0 particle1;
}

将该脚本附加到发射器:

  1. 显示 particalShape 并打开“属性编辑器”(Attribute Editor)
  2. 将寿命从“永生”(live forever)更改为“仅寿命 PP”(lifeSpanPP Only)
  3. “每粒子(数组)属性”(Per Particle (Array)Attributes)区域中,在“位置”(Position)属性上按鼠标右键 () 并选择“运行时表达式”(Runtime Expression)(在动力学计算之前或之后)。
  4. 将该脚本粘贴到“表达式编辑器”(Expression Editor),然后单击“创建”(Create)