Running particles along a n number of curves

   3726   4   1
User Avatar
Member
696 posts
Joined: March 2006
Offline
maybe I'm going about this all the wrong way, but I'm wondering if there is a way to creep particles along a curve inside a forloop.

I have n number of curves, which I want to randomly run particles down over time.

my first thought was to do a foreach loop on the number of curves, with a simple particle simulation inside the loop that had an impulse emission driven by the FORVALUE. But it seems like the particle simulations all end up identical.

Am I over complicating things? is there a better way?
Stephen Tucker
VFXTD
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
POPs can't be put in a foreach loop.

What you can do is separate the curves out one per leaf and then use a POP Merge SOP to reference the original pop network.

Heavy use of opdigits() allows you to build network bits that can be quickly copy-pasted and auto-configure themselves.

If you want you can wrap the repeatable network bits in to a digital asset.

Attachments:
pop_merge_on_many_curves.hip (118.4 KB)

There's at least one school like the old school!
User Avatar
Member
4262 posts
Joined: July 2005
Offline
Allegro
maybe I'm going about this all the wrong way, but I'm wondering if there is a way to creep particles along a curve inside a forloop.

I have n number of curves, which I want to randomly run particles down over time.

my first thought was to do a foreach loop on the number of curves, with a simple particle simulation inside the loop that had an impulse emission driven by the FORVALUE. But it seems like the particle simulations all end up identical.

Am I over complicating things? is there a better way?

I might be over simpilifying but the Creep POP has a prim attribute. You randomly pick which curve the particles are on with that.
if(coffees<2,round(float),float)
User Avatar
Member
696 posts
Joined: March 2006
Offline
round(rand($ID)*n-1) does the trick.

I was definitely making it more complicated than necessary.


Also, thanks for the file Jeff, not quite what I need this time around, but always useful to have files.
Stephen Tucker
VFXTD
User Avatar
Member
12 posts
Joined: Jan. 2017
Offline
Allegro
round(rand($ID)*n-1) does the trick.

I was definitely making it more complicated than necessary.


Also, thanks for the file Jeff, not quite what I need this time around, but always useful to have files.

Could somebody explain this to me in detail ?
  • Quick Links