Use the Particle Collision Event Editor to emit, kill, or split particles upon contact
 
 
 

You can use the Particle Collision Event Editor to 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.

NoteWhen creating particle collision events using nParticles, be aware of the following:

To create a particle or nParticle collision event

  1. Select the particle or nParticle object you want to be affected by the event.
  2. (For classic particles only.) Make the particles and geometry collide.
  3. Depending on the particle type, do one of the following:
  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.
    NoteIf you select an Emit or Split Event type for a particle or an nParticle collision event, Maya creates the default Target particle, which is a classic particle object (particleShape). Currently, for best results use the default Target particle. Do not specify an nParticle object as a Target particle.
  8. Play the animation and watch the event.

To delete a particle or nParticle collision event

  1. Depending on the particle type, do one of the following:
  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. Depending on the particle type, do one of the following:

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

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