vacum_demo.mb (71.3 KB, 504 views)
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
#
3
20-05-2008
, 12:37 AM
Registered User
Join Date: May 2008
Location: Europe (Germany)
Thanks for your quick response!
Your solution is an interesting approach. The reason I'm using a newton field is to accelerate the particles towards the head when it's approaching, like in real world. The idea is to actually see them get sucked in the cleaner head.
As I wrote in the updated post above, all I need is a way to make the particular particle (lol!) stop existing when the collision with the head occurs. I think there must be a kind of command that can be executed in the expression (exactly where I change the particle color to red at the moment) that makes the particle die.
In my first post I somehow missed the chance of adding an attachment with the scene file, so here it is again.
There must be a way =)
|
cleaner.mb (72.4 KB, 496 views)
#
4
20-05-2008
, 02:05 AM
Registered User
Join Date: Sep 2002
Location: Minnesota, USA
Sadly with longform expressions like that I am clueless, hehe, so I wouln't be the one to ask about that
Regarding your collision event, however, have you checked the event editor at the bottom of the dialog is a checkmark to "Kill" the particles rather than split or emit others?
Just making sure, as mine kept defaulting to split, so I had to check it twice before it took correctly
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
#
5
20-05-2008
, 02:39 AM
Registered User
Join Date: May 2008
Location: Europe (Germany)
Dynamics, especially expression driven, is also totally new to me. But hey, there's always one day when you have to jump into the cold water and get along with it - somehow :headbang:
If I could manually do what this kill checkbox does in the event editor, I'd be happy. Well, I'll keep searching. Perhaps there's one expression magician out there who stumbles over this thread one day.
For now I'll call it a day
greetings,
Rob
#
6
20-05-2008
, 01:59 PM
Registered User
Join Date: May 2008
Location: Europe (Germany)
It's done, there was just a little tweak to be done :attn: . So here's a little walkthrough for those who want to use it. Quite simple, but it's just to get the idea across:
Let's say you want to have particles raining down on two cubes. Particles that collide with cube 1 shall become red and bounce off the cube (and eventually collide with cube 2), cube 2 shall kill the particles once they collide with it.
- Create an emitter that lets the particles rain down (omni, gravity field)
- Create 2 (or more, it doesn't matter) poly cubes and place them under the emitter in a way that some particles collide with cube 1 and some with cube 2
- name the transform node (pcube1 not pcube1shape) to cube_A and the other one to cube_B
- Make the particles collide with both of them (Particles-->Make collide)
- Select the particleShape and add a per particle collisionGeometryIndex via Add Dynamics Attibutes-->General-->Particle-->collisionGeometryIndex
- Also add an rgbPP Attribute (Add Dynamics Attibutes-->Color-->Add per particle attribute)
- now create a runtime expression on the lifespanPP and rgbPP attribute:
Code:
int $index = particleShape1.collisionGeometryIndex;
if( $index != -1 )
{
string $geoC[] = `listConnections particleShape1.collisionGeometry[$index]`;
string $shape[] = `listConnections ( $geoC[0] + ".localGeometry" )`;
if ($shape[0] == "cube_A")
{
particleShape1.rgbPP = <<1,0,0>>;
}
if ($shape[0] == "cube_B")
{
particleShape1.lifespanPP=0;
}
}
Important!!! You have to set the lifespan mode to "lifespanPP only" under Attribute Editor --> particleShape1 --> Lifespan Attributes. It took me hours and buckets of coffee to notice that. Rob was raging again
You can easily add more collision objects with different effects on the particles, I think a switch-case condition would be more elegant for that.
I attached a scene file with the stuff above, have fun!
|
collisions.mb (59.9 KB, 635 views)
Last edited by RaginRob; 20-05-2008 at 02:03 PM.
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
|