Apply physics to particles

Wondering how to accomplish a certain animation task? Ask here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
spar9zedou
Posts: 10
Joined: Tue Feb 19, 2013 12:02 pm

Apply physics to particles

Post by spar9zedou »

Hello all,

I searched everywhere for an answer without any success so your help would be very appreciated.

How do I apply physics to particles.

Ex:

I have a tube cross section (two curved parralel walls) as my non-moving object at the bottom of my group with physics.

I want bubbles to go through the tube and react to it so I am forced to create a particle layer within the group where I set up my physics (above my non-moving layer)

The problem is that a particle layer doesn't have a physics tab. When I play my particles, they ignore completely the non-moving object and don't react to it.

Heeelp!!!
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Apply physics to particles

Post by heyvern »

Yeah, sorry but particles don't interact with physics. You won't get particles bouncing off of other shapes.

A trick I've tried is to have two particle layers, one that "spits out" and one the "bounces off" of a shape or "ground". It's sort of a fake physics interaction. So you have a particle layer that spits out and falls like normal. It ends at a specific spot and another particle layer takes over at that point to simulate the "bounce" off. You would change the force direction and spread and force settings etc etc to sort of match as close as possible the end point of the other particle layer.

Another option, depending on what effect you are trying to achieve, you could possibly use physics and a bunch of vector layers that bounce and interact with other shapes. This would require a lot of effort and a ton of layers. You wouldn't be able to have an endless stream of particles. Basically you would need to create a whole pile of layers with one tiny shape on each layer in the physics folder and give them physics properties that would simulate the particles you need.
spar9zedou
Posts: 10
Joined: Tue Feb 19, 2013 12:02 pm

Re: Apply physics to particles

Post by spar9zedou »

That's too bad.

I'll have to go with option 2...


Thanks for the reply.
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Apply physics to particles

Post by heyvern »

There is a script you can use to make this easier.

It's under the scripts menu in: Layer Effects | RT: Break Apart Shapes

What you do is draw as many particle shapes you want on a vector layer. Each shape must be a separate shape so draw one and then use copy and paste to create a whole pile of shapes. Then position your shapes where you want them. They shouldn't overlap to work with physics.

Select all the points and run the script. You want to check the "Put each shape in its own layer and group them together" option. This will put split each shape into its own layer and put inside a group. You could move them out into another physics group layer or set the physics of that group layer.

The only problem with this script is that you can't preset the physics properties. If you want to change the properties of the particles you would have to change the settings for each layer created. This can take a while if you have a lot of layers.

I have my own script that does something similar but is intended specifically for creating piles and piles of physics shape layers and it copies the original layers physics settings when breaking it apart. This saves a lot of time. My script doesn't break apart connected shapes, it only works with single closed vector filled shapes.

I will track track down this menu script and put it online for download.
spar9zedou
Posts: 10
Joined: Tue Feb 19, 2013 12:02 pm

Re: Apply physics to particles

Post by spar9zedou »

Great idea.

And your script seems to be even better for what I need (I'm actually representing red cells flowing through blood vessels).

If you ever put in online, you'd make me a happy man.



Thanks again!



spar9zedou@hotmail.com
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Apply physics to particles

Post by jahnocli »

spar9zedou wrote:...(I'm actually representing red cells flowing through blood vessels).
There was an idea by Lostmarble Himself (main developer, Mike Clifton) that appeared a while back. I'm talking years...It was a kind of mesh of bones that 'squezed' shapes through tight openings. May be exactly what you are looking for. I had a quick look through the forum back catalogue but I couldn't find it. Maybe somebody here knows what I am talking about?
You can't have everything. Where would you put it?
User avatar
slowtiger
Posts: 6240
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Apply physics to particles

Post by slowtiger »

I had the exact same task some years ago and didn't use particles, but just objects on a path. Duplicated that, changed the timing, voila, instant blood stream.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
heyvern
Posts: 7042
Joined: Fri Sep 02, 2005 4:49 am

Re: Apply physics to particles

Post by heyvern »

jahnocli wrote:
spar9zedou wrote:...(I'm actually representing red cells flowing through blood vessels).
There was an idea by Lostmarble Himself (main developer, Mike Clifton) that appeared a while back. I'm talking years...It was a kind of mesh of bones that 'squezed' shapes through tight openings. May be exactly what you are looking for. I had a quick look through the forum back catalogue but I couldn't find it. Maybe somebody here knows what I am talking about?
Yes, this was a trick using bones and translating the layers "past" the bones instead of moving the bones to move points. When you move a vector layer through or past the bones the points are influenced by the bone as they get near them. Not sure how this might work for pushing cells through veins but I suppose you could user flexible layer binding instead of point binding, and then the objects would move based on the bones.

This is so weird. I was actually trying this technique just yesterday. It popped into my head for something else I am working on.

I am with Slowtiger on this one. Using follow path or some other "by hand" technique is going to be way better and easier than trying to use physics. I did a quick test and it's such a pain trying to get things to "flow" with physics. You would spend as much or more time setting it up and testing it you could animate it by hand. ;)
User avatar
slowtiger
Posts: 6240
Joined: Thu Feb 16, 2006 6:53 pm
Location: Berlin, Germany
Contact:

Re: Apply physics to particles

Post by slowtiger »

It's even easier to do with that snake charming technique of having a straight bone chain on frame 0, then make this into whatever curls you like in frame 1 and just shift an entire layer of elements over it.
AS 9.5 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
AS 11 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
Moho 13.5 iMac Quadcore 2,9GHz 16GB OS 10.15

Moho 14.1 Mac Mini Plus OS 13.5
User avatar
neeters_guy
Posts: 1626
Joined: Mon Sep 14, 2009 7:33 pm
Contact:

Re: Apply physics to particles

Post by neeters_guy »

jahnocli wrote:
spar9zedou wrote:...(I'm actually representing red cells flowing through blood vessels).
There was an idea by Lostmarble Himself (main developer, Mike Clifton) that appeared a while back. I'm talking years...It was a kind of mesh of bones that 'squezed' shapes through tight openings. May be exactly what you are looking for. I had a quick look through the forum back catalogue but I couldn't find it. Maybe somebody here knows what I am talking about?
Found it: Object warping trick
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Apply physics to particles

Post by jahnocli »

Great! (Sometimes you wonder whether you are dreaming stuff up sometimes...)
You can't have everything. Where would you put it?
spar9zedou
Posts: 10
Joined: Tue Feb 19, 2013 12:02 pm

Re: Apply physics to particles

Post by spar9zedou »

Thanks everybody for such good replies.


I'll re-open that project, now that I have a decent solution (objects following paths, of course).

The object warping trick looks neat, i'll have to test it for myself to see its extent.

Physics is a a big mess to me so i'll stay away from it thanks to you
Post Reply