Jump to content

Emit Particles On Collision


Bernard

Recommended Posts

Hi Bernard,

There is an example scene in the help somewhere. Search for the dopnumrecords() expression or Impacts subdata info.

Thanks Jason,

I did search in the help but Houdini gives an error. (I typed "dopnumrecords()" and "impacts subdata")

Is it possible to give me a link or a closer spot where I can find this ?

thanks in advance,

bernard

Link to comment
Share on other sites

Thanks Jason,

I did search in the help but Houdini gives an error. (I typed "dopnumrecords()" and "impacts subdata")

Is it possible to give me a link or a closer spot where I can find this ?

thanks in advance,

bernard

I think this is the link:

$HFS/demo/helpcards/dop/sopsolver/DOP_EXAMPLE_sopsolver_DentingWithPops.cmd

Link to comment
Share on other sites

My first quick search for "Impacts" yields links to:

The "Dent With Pops" example is the link Miguel posted above.

PS. Miguel posted a .cmd file, not a webpage. You "source thefile.cmd" in a Houdini textport or File>Run Script on the file and it'll create the example network for you.

Link to comment
Share on other sites

My first quick search for "Impacts" yields links to:

The "Dent With Pops" example is the link Miguel posted above.

PS. Miguel posted a .cmd file, not a webpage. You "source thefile.cmd" in a Houdini textport or File>Run Script on the file and it'll create the example network for you.

Thanks for the info. great!

I took the example of the object collision lines. When I take this example and switch the lines SOP with a POPnet SOP, and made a little particle network, the particles are born always (collision stays)

I want the particles only to be born on impact of the objects.

How can I do this?

many thanks,

bernard

Link to comment
Share on other sites

I want the particles only to be born on impact of the objects.

How can I do this?

So, naturally, you'd have to create a particle source from the impact points, right?

Look at the Denting With Pops example, inside the SOP Solver. You'll see that metaballs are being copied to every impact record. If you copy a point (or any geometry whose shape you fancy) to each impact record in the same way, this can be fed into a Source POP in a new POP Network. Voila.

You might have to do some creative treatment; for example: before your Source POP, cull out impact points whose impact magnitude is weak. The RBD system causes hundereds of impacts to keep objects apart even when they're just resting on each other so you may want to only extract high-impact collisions.

Everything you need is in those examples.

Link to comment
Share on other sites

you could use a number of different dop expressions, such as dopfield( ) in the birth parameter of your popnet. You could use it when the impulse of the impact is greater than a certain value, then birth a specific amount of particles.

 if(dopfield("../dopnet1", "rbdobject1", "Impacts", "Impacts", 0, "impulse") > 0.5, 100, 0)

Link to comment
Share on other sites

A bit late to the party, but here's an example showing the culling of "less interesting" impacts.

Thanks Jason, SpencerL and Craig (for the example scene).

What does the expression in AttributeCreate do:

opfield("/obj/dopnet1", "rbdobject1", "Impacts", "Impacts", $PT, "impulse")/5000

Is the inpulse divided by 5000 or someting else ?

many thanks,

bernard

Link to comment
Share on other sites

If you aren't doing so already I highly recommend that you look at what is happening to the data in the DOPs simulation. Set a pane to "Details View" in DOPs and select the rbdobject. If you don't see impact data it's because there isn't any on the frame you are on. Keep playing the simulation until the impact data shows up and select the Impacts subdata (rdbobject1/Impacts/Impacts). For example look at frame 46 where there are 17 impact records. Note how most are small (the impulse setting is low) but that the first (record 0) is very large. The AttributeCreate SOP just accesses this dops impulse data so it can be used in SOPs land. The idea is to measure the impulse values so that high values can act as triggers but low impulse values are ignored.

Craig's method returns all of the impact points, examines their impulse values and deletes those that are too small (i.e. not interesting enough to trigger the POPs events). Don't get confused by the division by 5000! It's a convenience step only to get values into a smaller range (e.g 0 to 10 rather than 0 to 50,000). You can do without it but the filter expression in the delete1 SOP would have to read "$IMPULSE < 2500" instead!!

Also make sure you open a textport and look at the help for the dopfield and dopnumrecords expressions used by Craig:

> exhelp dopfield

> exhelp dopnumrecords

Cheers,

John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...