Your Ad Here

Emit, kill, or split particles upon contact

You can make particles emit new particles, die, or split into multiple particles when they collide with geometry. You can also execute a MEL script upon collision. The actions that occur after contact are called events.

To create a particle collision event:

  1. Select the particle object you want to be affected by the event.
  2. Make the particles and geometry collide.
  3. Select Particles > Particle Collision Events.
  4. In the Objects list of the Particle Collision Events Editor, make sure the particle object you want to be affected by the event is highlighted.
  5. Set the attributes.
  6. Click Create Event.
  7. If applicable, set attributes of the split or emitted particles to alter their appearance and behavior.
  8. Play the animation and watch the event.

To delete a particle collision event

  1. Select Particles > Particle Collision Events.
  2. In the Objects list of the Particle Collision Events Editor, select the particle object the event is applied to.
  3. Select the event you want to edit in the Events window.
  4. Click Delete Event at the bottom of the window.

To create and source a MEL procedure for use with an event

  1. Create a MEL script that contains a procedure with this format:

global proc myEventProc (string $particleObject,
int $particleId, string $geometryObject)
{
Type MEL statements here;
}

After you complete the following steps, when you play the scene and a collision occurs, the event executes and passes values to the three arguments defined in the procedure:

$particleObject—name of the particle object that collides with the geometry.

$particleId—particle id number of the particle that collides.

$geometryObject—name of the geometry.

Be aware of these issues as you create the procedure:

  1. In the Script Editor, select File > Source Script to source the script that contains the procedure.

If the procedure creates objects, Maya doesn’t delete them when you rewind. Note also that you can source a procedure without sourcing the script that contains it. See the MEL and Expressions guide for more details on working with scripts and procedures.

To edit a particle collision event

  1. Select Particles > Particle Collision Events.

See the figure on the following page for details on window items that help you select events for editing.

  1. In the Objects list of the Particle Collision Events Editor, select the particle object that the event is applied to.
  2. Select the event you want to edit in the Events window.
  3. Edit the option settings in the window.

 

Return to Autodesk Index


Your Ad Here