PDA

View Full Version : Emitting particles to multiple goals.


bartlebooth
02-14-2011, 03:02 PM
Hello.

I have one particle system being generated by three emitters. Particles from each emitter have their own radius and colour (emitter 1 - white particles, 1.2 radius, emitter 2 - black particles, 1.7 radius, etc...). I would like to goal these particles to three different CV curves so that each curve has a particle of differning size and colour. I am guessing that I need to use the emitterId to specify which particles emit to the curves but am unsure how to do it. Right now, my expression is like this for colour:

if (nParticleShape1.emitterId == 0)
nParticleShape1.rgbPP = <<1,1,1>>;

And this for radius:

if (nParticleShape1.emitterId == 0)
nParticleShape1.radiusPP = 1.2;

Any help you could give me would be greatly appreciated, I am somewhat new to expressions. Thank you.

Bartlebooth.

mandark1011
02-14-2011, 03:21 PM
goal your particles to all your curves then use the same expression but with this syntax

if (emitterID blah blah)
{
goalWeight1PP = 1;
goalWeight2PP = 0;
goalWeight3PP = 0;
}
etc

obviously add per particle goalweights from att tab too.

Good luck

bartlebooth
02-14-2011, 03:33 PM
Thanks for the reply mandark.

I seem to be having a problem. The particles are clumping together as opposed to goaling to the curves. Here is what I put as my expression after adding PP attribute like you suggested:

if (nParticleShape1.emitterId == 1)
{

nParticleShape1.goalWeight0PP = 0;

nParticleShape1.goalWeight1PP = 1;

nParticleShape1.goalWeight2PP = 0;

}

Is this what you meant in terms of an expression?
Thanks again for the help.

Bartlebooth.

mandark1011
02-14-2011, 03:54 PM
so is the multiple goal deal working?

if so looks like you just need to add a goalU rand expression to spread them out or if your looking to drive the particles along the curve a goalU+= expression in runtime

for evenly placed particles along your curve
goalU = rand(0,1); //in creation

for running along a curve
//creation
make a floatPP att called goalUAdd

goalUAdd = rand(.1,.15);

//runtime
goalU += goalUAdd;
if (goalU >=.99)
lifespanPP = 0;

something like that should help

bartlebooth
02-14-2011, 04:00 PM
No, the multiple goal is not working. I need a particle at the CV point of each curve. For example emitter 1 is emitting 46 particles and the curve has a corresponding number of points. I need the particles goaled to these specific points. Does this change anything? Should I try adding a gaolU rand expression? Again, I appreciate the help, this has been driving me crazy.

mandark1011
02-14-2011, 04:48 PM
no by default you should get that behaviour with a goal to a curve.

hmm when you create your goals make sure goal is set to 1...
make sure that you are getting a goalWeight0,1,2 in your channel box.....
apart from that it should work perfectly i use this technique all the time.

if it isnt working after that maybe post your scene (if you can ill try and take a look at it after work today)

mandark1011
02-16-2011, 03:08 AM
here is your file i changed hope that helps..

bartlebooth
02-16-2011, 03:37 PM
Amazing! Thanks.

One last question, kind of a dumb one but can you explain how you got that one particle constrained to the locator. I know you mentioned it previously but could you just dumb it down a bit for me. That would be really helpful.

Bartlebooth.

mandark1011
02-16-2011, 04:47 PM
very low tech solution to that one. I made a poly cube and vert snapped all the verts to the centre of the locator then goaled that emitter to that piece of geo. sooo i basically made that poly cube a point in space, but it still has the ability to be a goal.

CGTalk Moderation
02-16-2011, 04:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.