Object based particle collision?

24 views
Skip to first unread message

Steve Davy

unread,
Nov 17, 2010, 1:57:22 PM11/17/10
to Maya Group
Is there a way to specify particle collisions with a specific collision object? The collision event editor only gives the option to specify collision number, but this isn't useful if you have a random number of PP collisions with one object, but want to trigger an event when they collide with a second object.

What I'm looking for is a way to say "when particle collides with object A do this, but when particle collides with object B do something else" but not have this based on the number of total PP collisions.

It seems like this ought to be possible without crazy coding.

Jeremy Raven

unread,
Nov 17, 2010, 5:23:54 PM11/17/10
to maya_he3d
Hi Steve,

Have a look at CollisionGeometryIndexPP

Steve Davy

unread,
Nov 19, 2010, 6:08:46 PM11/19/10
to Maya Group
Hey Jeremy,

Yeah, had a look at this thanks. This does some of the way toward doing what I want (if I can get it to work), although I think it still simply works on the basis of which object, in order, a particle has collided with? So it's no good if you ongoing overlapping collisions and want specific behavior with each collision object.

Basically I have one set of objects which will collide with a particle object and only have a basic collision. I then want a second set of objects to collide and trigger an event, i.e. turn on each particle's goal weight.

Possible?

> Date: Wed, 17 Nov 2010 14:23:54 -0800
> Subject: [maya_he3d] Re: Object based particle collision?
> From: j...@jeremyraven.co.nz
> To: maya...@googlegroups.com

Jeremy Raven

unread,
Nov 19, 2010, 11:42:11 PM11/19/10
to maya_he3d
yep, the collision index is based on the order you apply the collision
object to the particle as opposed to the number of collisions. So you
can customise your goalPP based on the index number. Not sure it works
with nParticles.

Jeremy Raven

unread,
Nov 19, 2010, 11:57:11 PM11/19/10
to maya_he3d
Forgot to mention dont use the collision event handler, just create if
statements based on geoIndex so....

if (collisionGeometryIndex==4)
goalPP=.4;

Steve Davy

unread,
Nov 22, 2010, 8:14:47 PM11/22/10
to Maya Group
Hm, yeah can't seem to get this working.

So, I simply want to tell Maya that, when a particle collides with the second collision object, set that particle's goal weight to 1.

Something like this (lifted from Matt Estela's Wiki -- thanks Matt).

int $indexID = softParticleShape.collisionGeometryIndex;

if( $indexID != -1 )

{

if ($indexID ==1)

softParticleShape.goalPP = 0;

if ($indexID ==2)

softParticleShape.goalPP = 1;


}


I'm still not getting anything happening, at all. My particle object goal weight is set to 1. Clearly I'm missing something here? One thing I've never been clear about is the difference between goalPP and goalWeightPP. Is there a difference? If not, why are these attributes named differently?.


.



> Date: Fri, 19 Nov 2010 20:57:11 -0800

Jeremy Raven

unread,
Nov 22, 2010, 8:29:25 PM11/22/10
to maya_he3d
That should do it. Just check your geoIndex by turning on numeric
display and typing in collisionGeometryIndex so you can see your PP
ids. You may have created and removed objects here and there causing
your index values to be different.

Re: your second question, Im not 100% sure actually. I think it has to
do with having different goals weights per goal objects so essentially
you are making the if statement obsolete.

Steve Davy

unread,
Nov 23, 2010, 1:28:15 PM11/23/10
to Maya Group
OK, that showed me that the index ID starts at 0, not 1 (doh!).

Everything else fell into place after that.

Thanks Jeremy!

> Date: Mon, 22 Nov 2010 17:29:25 -0800
Reply all
Reply to author
Forward
0 new messages