tyFlow Forum
Birth particles on shape surface? - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: Birth particles on shape surface? (/thread-144.html)



Birth particles on shape surface? - mitchfx - 04-04-2019

This is probably very simple and I'm just overlooking something obvious.  I'm trying to figure out how to birth particles on the surface of another particle shape (particle with geo).  I also need to then attach those new particles to the shape surface at birth.  Ideally I would like to do this also with a cloth shape, as well as limit the birth to a certain region of the surface based on either a map, matID or selected faces on source geo.  Any ideas?


RE: Birth particles on shape surface? - tyFlow - 04-04-2019

Not quite sure I understand what you're trying to do, but if you want to birth particles on a tyFlow cloth the easiest way is to make a second flow, and then import the first cloth flow into your second flow in a "Position Object" operator, which will then scatter particles on the cloth mesh. You can then bind them to the cloth with an Object Bind and make whatever other tweaks you want.


RE: Birth particles on shape surface? - mitchfx - 04-04-2019

(04-04-2019, 10:05 PM)tyFlow Wrote: Not quite sure I understand what you're trying to do, but if you want to birth particles on a tyFlow cloth the easiest way is to make a second flow, and then import the first cloth flow into your second flow in a "Position Object" operator, which will then scatter particles on the cloth mesh. You can then bind them to the cloth with an Object Bind and make whatever other tweaks you want.

Apologies for my poorly phrased question.  I was actually asking about two different yet similar things, which probably added to the confusion.

Example senario...

Event_001
1. Birth op to generate a particle
2. Shape op to assign a 3d cube shape (or pick selected scene geo)

Now, I want to scatter or spawn new particles on the surface of that cube, then attach those to the suface as it moves.  I want to do some two-way interaction via dynamics, etc between the cube shape particles and these new particles so not sure if having the Two Flow approach would do that.  Now take it a step further and be able to limit where on the surface you emit/attach particles.  My cloth example would be a similar workflow but instead of a "shape" it would be on the mesh of a Cloth Bind.  Once again, I'd like to attach some new particles to the surface of the cloth, bind them then sim all together.  Imagine a bunch of squishy rubber toy porcupines and you want to then procedurally scatter rigid "quills" over the surface then sim.


RE: Birth particles on shape surface? - tyFlow - 04-04-2019

The only way to do 2-way interactions like that is with PhysX. So you could use a Spawn operator in "random on shape surface" mode to generate particles on your shape, then send them out to another operator where they are bound back to that shape with a PhysX Bind operator. Make sure you have a PhysX Shape operator on your shape prior to the spawn operator, so all the resulting particles will be PhysX meshes.


RE: Birth particles on shape surface? - mitchfx - 04-04-2019

(04-04-2019, 10:57 PM)tyFlow Wrote: The only way to do 2-way interactions like that is with PhysX. So you could use a Spawn operator in "random on shape surface" mode to generate particles on your shape, then send them out to another operator where they are bound back to that shape with a PhysX Bind operator. Make sure you have a PhysX Shape operator on your shape prior to the spawn operator, so all the resulting particles will be PhysX meshes.

Thanks for the reply.  I've actually been doing some really successful sims using physX between rigid bodies and splines that have amazing two-way interaction.  Soooooo sweet and easy to set up!

I was looking for a the "random on shape surface" mode in Spawn, but only see a "parent shape surface" option which doesn't appear to distribute the spawned particles evenly or randomly at all.   Also, I can't for the life of me figure out how to spawn from the shape of a particle in one event without that original particle inheriting the new operators (shape, etc) of the newly spawned particles.  I've tried to use the "send out" operator but that does what it says and passes the original birth particles to the next event.  I'm looking for a way to send just the surface position data to the spawn so they know where to be spawned, but my orig particles keep all their original shape, etc.  Once again, probably overlooking something obvious here.

Ok, I tried using a SPAWN in the original Event, then piped that output into the new event with another Spawn to distribute new particle and checked "delete parent" to kill the original duplicate spawn.  Is this the right way to do it?


RE: Birth particles on shape surface? - tyFlow - 04-05-2019

Sorry yea I was just going by memory..."parent shape surface" is the correct label. It should sample a random point on the shape of the particle that's doing the spawning.

As for sending out particles, the spawn operator has its own little output nub as you can see, and that will send all child particles. Child particles copy all properties of their parent, but you can strip those out in the next event. For example, there is a "shape remove" operator that removes a particle's shape, and you can tweak how much spin/speed/scale child particles will inherit from their parent in the spawn operator itself.

Attached is an image/flow showing some particles with large shapes having smaller particles spawned on them.

One extra thing worth mentioning: when setting up this test I noticed at lower spawn particle counts, the distribution on the parent shape surface seems oddly biased (not all faces getting same # of particles)...most likely a bug. I will fix that for the next release.


RE: Birth particles on shape surface? - mitchfx - 04-05-2019

(04-05-2019, 12:41 AM)tyFlow Wrote: Sorry yea I was just going by memory..."parent shape surface" is the correct label. It should sample a random point on the shape of the particle that's doing the spawning.

As for sending out particles, the spawn operator has its own little output nub as you can see, and that will send all child particles. Child particles copy all properties of their parent, but you can strip those out in the next event. For example, there is a "shape remove" operator that removes a particle's shape, and you can tweak how much spin/speed/scale child particles will inherit from their parent in the spawn operator itself.

Attached is an image/flow showing some particles with large shapes having smaller particles spawned on them.

One extra thing worth mentioning: when setting up this test I noticed at lower spawn particle counts, the distribution on the parent shape surface seems oddly biased (not all faces getting same # of particles)...most likely a bug. I will fix that for the next release.

Ah that makes sense.  The clumping bias was what I was seeing, so explains why I thought I might have the wrong mode checked.  Your flow screengrab makes sense, even though I did the opposite thing on my end (spawning a single clone of the birthed shape particle, piping that out into a new event, then spawning the new ones on surface while killing the parent).  Although your method is cleaner, would it cause extra overhead if the spawned particles inherit the shape of the parent (assuming the parent has a much more complicated mesh shape) and then gets piped into the new even and assigned a new shape there?  Or does tyFlow evaluate the entire flow first and skip such redundant things?  Just curious from an optimization point of view.  

In terms of spawning, are there any plans to add more surface distribution controls?  Texture based, matID, uniform vs random, face center, vertex etc?  I also posted a feature request for more controls of the spawn particle offsets.   

Thanks!