Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 04-07-2009 , 03:17 AM
Registered User
Join Date: Nov 2002
Location: Philippines
Posts: 136

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 user added image

# 2 04-07-2009 , 05:18 AM
ragecgi's Avatar
Registered User
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
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 methodsuser added image


Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
# 3 04-07-2009 , 07:58 AM
gster123's Avatar
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
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.


"No pressure, no diamonds" Thomas Carlyle
# 4 04-07-2009 , 08:10 AM
Registered User
Join Date: Nov 2002
Location: Philippines
Posts: 136
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. user added image


Thanks user added image

# 5 04-07-2009 , 08:35 AM
ragecgi's Avatar
Registered User
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Yep, gster123's post should do you just fineuser added image


Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
# 6 04-07-2009 , 09:00 AM
Registered User
Join Date: Nov 2002
Location: Philippines
Posts: 136
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? user added image


Thanks user added image

# 7 04-07-2009 , 09:31 AM
gster123's Avatar
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
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;
}


"No pressure, no diamonds" Thomas Carlyle

Last edited by gster123; 04-07-2009 at 09:35 AM.
# 8 04-07-2009 , 11:19 AM
Registered User
Join Date: Nov 2002
Location: Philippines
Posts: 136
Hey everyone,

This is fun user added image 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 user added image

# 9 06-07-2009 , 10:48 AM
gster123's Avatar
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
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.


"No pressure, no diamonds" Thomas Carlyle
# 10 21-12-2011 , 05:09 PM
Registered User
Join Date: Jul 2004
Location: Vancouver
Posts: 1

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads