Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Dynamics & Special Effects (https://simplymaya.com/forum/forumdisplay.php?f=33)
-   -   Particle Death Question (https://simplymaya.com/forum/showthread.php?t=32686)

Calvin 04-07-2009 03:17 AM

Particle Death Question
 
Hello all.

I'm dabbling into nParticles now, and I was wondering if there was a good way to kill particles that leave a certain area? Sort of like that Daemon in ReelFlow, where particles only exist in a certain volume. The reason for this is to speed up calculations. If particles are spilling off screen then I don't really need them around much anymore.

I've been told to have the particles die upon collision, but how do you get particles to die only when colliding with a specific object?

Or To script it so that when the particles position goes beyond a locator's for example, it dies. But I don't know the script. I can possibly dissect some other script but if anyone knows how I'd much appreciate it.

Thanks in advance,

Calvin :)

ragecgi 04-07-2009 05:18 AM

Are you talking about killing your nParticles?

...or regular particles?

Sorry, I just want to clarify, and make sure i don't tell you the wrong methods:)

gster123 04-07-2009 07:58 AM

You can use fields to kill particles with a runtime before dynamics expression using the inpfut force of a volume axis field


if(inputForce[0]>0)
{
lifespanPP = 0;
}

think that this will work with both types of paticles.

Calvin 04-07-2009 08:10 AM

To RagecgI: I was asking for nParticles, but I don't think the procedure would be that different with legacy particles, would it?

To gester123: Thanks, will try that, and get back to you guys on how it goes. :)


Thanks :)

ragecgi 04-07-2009 08:35 AM

Yep, gster123's post should do you just fine:)

Calvin 04-07-2009 09:00 AM

Hmmm... not working for me.

ParticleDeath is the name of my cube volume axis field:

if (ParticleDeath.inputForce[0] >0)
{

nParticleShape1.lifespanPP = 0;
}

I've got a simple emitter emitting water particles, but they still live past the volume axis field.

Any idea what I'm doing wrong? :)


Thanks :)

gster123 04-07-2009 09:31 AM

hi calvin, make sure that thats the correct number for the field, uif you have more in the scene it changes the number, should have said that in my previous post as the example there is only the vol axis field there.

YOu alsn eed to set tup the particles lifespan to be Per particle. Its not the fields force wither its the particles

Full script without being lazy

if(particleShape1.inputForce[0]>0)
{
particleShape1.lifespanPP = 0;
}

Calvin 04-07-2009 11:19 AM

Hey everyone,

This is fun :) I did forget to turn the particle lifespan to LifespanPP only. Its working now except that the particles die upon entering the volume axis field. What if I want the reverse? I want to emit particles and they can only live inside the field, and die when they exit.

Thanks :)

gster123 06-07-2009 10:48 AM

cant test it out at the moment but owuld changiong the input force not to it, so that when the input force is equall to 0 (I.e not being effected by the field) it kills em.

rhonedog 21-12-2011 05:09 PM

I don't know if you ever got this technique working, but I have a quick tutorial I wrote up doing exactly what you wanted. Killing Maya particles via inputForce


All times are GMT. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018