Thinking Particles from Dynamic Collisions… Part II

No Particles

No Particles

I recently had a question of how to create TP from dynamic collisions when using a Cloner Object.  In other words how do you create an emitter at the collision point of each clone.  If you haven’t seen the original tutorial on this then please check this post.

It isn’t actually that tricky once you understand the basic principle.  What you need to do is to iterate through each of the clones in the cloner and then by using the Dynamic Body State node you can output the dynamic position of each object (clone).

Xpresso Setup

Xpresso Setup

In your Xpresso setup, output the Object from the Cloner Node, then link this into a Dynamics Body Node, you can then output the Count.  This number corresponds to the number of clones in the cloner.  Use this as the Iteration End value in an Iteration Node.  Now you have an iterator which will iterate through all the clones.  You also need to link the Cloner Object Output into another Dynamics Body Node.  In this second Dynamics Body Node you can link your Iterator Output into the Object Index, this will then link the iteration value to the index of the clone.  In other words it will count through each clone and check the dynamics state.

Particles From Clones

Particles From Clones

Once you’ve done that you can link the object output into one of the Object A / B inputs of the Dynamics Collision Node, just as I did in the original tutorial.  You should find that all your clones will emit particles when they collide with the other specified collision object.

Particles Galore!

Author: admin

16 Comments

  1. Derek Hardin
    Derek Hardin On September 22, 2012 at 1:49 am Reply

    I am new to expresso. How do you attach an object to particles in this situation? Like if I wanted triangles to appear or splines to follow the position of the TP. Thanks in advance.

  2. Derek Hardin
    Derek Hardin On September 22, 2012 at 2:28 am Reply

    Found the answer from previous tutorial from Tim. I just created a P Pass and connected it to P shape desired object within P Shape. also created a Particle Geometry in Object Panel and made shape a child of my PG. this is great! Thanks Tim!

  3. Dylan
    Dylan On September 27, 2012 at 3:34 pm Reply

    Useful. If they used C4D for this, it was probably how they emitted other iPods on collision with the floor.

  4. Kim Petersen
    Kim Petersen On October 1, 2012 at 3:06 am Reply

    Tim, is there a way to kill the particles/clones that have collided, i.e. the spheres? I’ve had trouble finding a similiar way to using the Event port in the PDeflector (connected to PDie).

    Cheers,
    Kim

  5. Tim
    Tim On October 2, 2012 at 12:44 pm Reply

    @Kim I’d use the Dynamics Xpresso nodes, then check for collision between the clones and the surface and if it was greater than 1, hide the object and disable dynamics. Probably not quite as easy as that, but something along those lines.

  6. Kim Petersen
    Kim Petersen On October 3, 2012 at 5:11 am Reply

    Thanks Tim!

    I’ll keep trying to find a solution. Perhaps it’s a good idea to move those particles into a new group and let them die immediately after a collision has taken place.

    Cheers,
    Kim

    • Tim
      Tim On October 3, 2012 at 2:21 pm Reply

      @Kim If the objects colliding are TP then I would simply use PDeflector and kill them on collision, but in my setup it is a cloner object dropping down, this is why I suggested using the dynamic node to check for collision.

  7. Kyle Hegge
    Kyle Hegge On October 3, 2012 at 2:09 pm Reply

    So here’s a question, and hopefully the solution is pretty straightforward and I’ve just missed something:

    So i’m attempting to create a Thinking Particle at the center of each polygonal object within my fracture setup. The objects all have rigid body tags and are acted upon by an attractor force that pushes them outward. My problem is that I can’t seem to get the born particles to follow the objects once acted upon, instead they just continue to emit from the objects initial position. Is this something that could be solved with the Dynamic Collision Node or the Body State Node?

  8. Kyle Hegge
    Kyle Hegge On October 3, 2012 at 2:15 pm Reply

    Nevermind. all that was needed was just adding alignment through global matrix…

  9. dacosta
    dacosta On December 24, 2012 at 2:05 am Reply

    Hi Tim

    i was wondering, do you know if thinking particles can be integrated with the new R14 aerodynamics function? (for example to let 100 pieces of paper fly by wind aerodynamically, and then land on an object using TP nodes etc)

    • Tim
      Tim On January 15, 2013 at 11:51 am Reply

      TP and Dynamics will work together, might be simpler however to actually Clone onto the TP particle group and then use MoGraph, Inheritance Effector to land on the surface.

  10. Dimitris
    Dimitris On February 25, 2013 at 8:34 pm Reply

    i am trying to do your “Thinking Particles from Dynamic Collisions” tutorial but i have many dynamic objects in a scene
    and i want an emmiter to give particles only when 2 of them collide
    so basically it is a ball, some cars (inside a cloner) and a plane(ground) but i want only when a car hits the ball to give particles
    and now the ball gives even when it touches the ground
    so is there a way to exclude the ground ?

    • Tim
      Tim On February 26, 2013 at 8:34 am Reply

      @Dimitris You can use an iterator node of some kind to iterate through all of the objects you’d like to include in the collision detection. For instance, add in an Xpresso node > Iterator > Object List then link the iterator into the Dynamics Collsion node as Object A and the ‘Ball’ as object B. As you’re using a cloner and a sphere, you don’t really even need an iterator, simply link the Cloner as Object A and the Sphere as Object B and then it should work as expected.

      See this simple example…

  11. Dimitris
    Dimitris On February 26, 2013 at 11:31 am Reply

    Tim thank you very much for the fast response
    That was exactly what i wanted :)
    thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

  12. facu labo
    facu labo On June 12, 2013 at 2:21 pm Reply

    tim, this is beautiful!!
    i wanted to ask you something. what if I want the similar result but with a (mograph) fracture object?
    i have an object all shattered and inside a fracture object. i want to emit 1 (only one) particle from each piece. makes sense? sorry for bothering!
    really like and really respect your work.

    • Tim
      Tim On June 13, 2013 at 11:29 am Reply

      @facu labo – I’ve not checked but it should work by simply swapping the cloner object node for the fracture object in the Xpresso. If you only want it to emit 1 particle then you need to add a compare node and after the first collision, switch off the PStorm. You could use a monoflop node for the switch and trigger it with a compare node (if no. collisions > 1).
      Hope that helps.

Leave a Reply