ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

DVD Logo Style Bouncing Layer Expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Bellsmith
DVD Logo Style Bouncing Layer Expression
on Jul 2, 2010 at 5:31:45 am

I'm looking for an expression to do a super basic "dvd logo" style animation, where a layer floats around the screen forever, bouncing off the edge of the comp at a complimentary angle. This type of thing -



.

I'm sure this is super easy for those in the know, but I couldn't find one floating around online.

Can any one give me a hand? Thanks in advance!!


Return to posts index

Kevin Camp
Re: DVD Logo Style Bouncing Layer Expression
on Jul 2, 2010 at 10:06:00 pm

you could try particle playground...

you can define the logo layer in the layer map property, then keyframe the cannon emitter to produce a single particle and set gravity zero.

if you add a rectangular mask to the solid that the effect is applied to, you can set that to be the boundary for the logo, and it should now bounce off of it.

the tricky part will be preventing the logo from turning as it bounces. you could try adding a white solid, then setting that as the layer map for the persistent property. then set one of the channels (red,for example) to be used to control angle, with min and max settings of zero. the idea being that a non changing solid color should hopefully prevent the angle from changing....

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Mark Bellsmith
Re: DVD Logo Style Bouncing Layer Expression
on Jul 3, 2010 at 4:16:14 am

Wow - that worked 100%, right through the persistent property mapping! Thanks for the clear solution !!!!


Return to posts index


Jesse Stormer
Re: DVD Logo Style Bouncing Layer Expression
on Jun 21, 2016 at 4:36:37 am

For anyone else who finds this -- make sure your solid layer for 'persistent property' is LARGER than your comp. Those particles touch the edge and detect that there is no reference for rotation, they begin to rotate, but then snap back as they return to the center. Same with particles being emmitted from off-comp, they will enter comp with rotation.


Return to posts index

Joseph Pandolfi
Re: DVD Logo Style Bouncing Layer Expression
on Jun 29, 2018 at 2:40:56 am

Could anyone help me out? I've followed everything that you've said except when I set the Wall option to the mask on the solid that I have particle playground on the logo fails to move. Whenever I turn off the boundary though the logo continues to move off of the page. Not sure where I am going wrong here.


Return to posts index

Sam Hockaday
Re: DVD Logo Style Bouncing Layer Expression
on Feb 15, 2019 at 2:29:47 pm

It's been awhile since this thread was posted, but in case anyone else runs into Joseph Pandolfi's issue with the logo not moving, I found a strange solution. I'm not sure if there's something wrong in my setup, but I found that the border mask needed to be re-sized based on my zoom level.

So, if I was viewing/rendering the composition at 50%, the mask would need to be one size. If I render at 100%, I actually had to resize the mask so that it was quite a bit bigger than the composition and solid layer. The reason the logo wasn't moving is that the Particle Playground effect was treating the mask as very small, and probably touching the logo layer on all sides, holding in place. I had to trial and error when resizing the layer mask, until the logo bounced off the composition edges correctly.

Hope this helps someone else looking to do this effect! It works quite nicely once the workaround is in place.


Return to posts index


John Birchman, DSCE, CFOT
Re: DVD Logo Style Bouncing Layer Expression
on Apr 29, 2019 at 5:58:09 pm

Hello:

Can anyone help with setting the cannon emitter to produce a single particle?

I can't seem to figure this part out. Either I get no particles, or a get 0.01 particles per second.

Everything else seems to be working.

Thank you.


Return to posts index

Filip Vandueren
Re: DVD Logo Style Bouncing Layer Expression
on May 2, 2019 at 5:05:45 pm

Unless you have other important reasons for a particlesystem,
this expression on position of a layer will do the same trick

hSpeed= 222;
vSpeed= 200;

margin= 100; // how far the anchorpoint of the layer has to stay from the edges of the comp.

cw=thisComp.width - margin*2;
ch=thisComp.height -margin*2;

// calculate the layer moving at a constant speed
x = value[0] - margin + time*hSpeed;
y = value[1] - margin + time*vSpeed;

// keep the layer in bounds
x = x&lt;0 ? -x : x;
x%=2*cw;
x = x>cw ? (2*cw)-x : x;

y = y&lt;0 ? -y : y;
y%=2*ch;
y = y>ch ? (2*ch)-y : y;

[x,y]+[margin,margin]




Return to posts index

Filip Vandueren
Re: DVD Logo Style Bouncing Layer Expression
on May 2, 2019 at 5:08:44 pm

if you see &lt, in an expression, that means it should be the "lesser than" symbol: "<"



Return to posts index


john smith
Re: DVD Logo Style Bouncing Layer Expression
on May 29, 2019 at 10:04:43 pm

hey filip,using this expression results in an error. do you know whats wrong with it?


Return to posts index

Filip Vandueren
Re: DVD Logo Style Bouncing Layer Expression
on May 29, 2019 at 11:08:48 pm

See my post just below it, The forum scramblers Some of the “less than” symbols



Return to posts index

sebastian smith
Re: DVD Logo Style Bouncing Layer Expression
on May 30, 2019 at 12:14:54 am

okay it fixed it but the thing im using doesnt have the same dimensions on x and y,so kinda goes a bit over the border on the left and the ride side of the comp. how would i fix that/control that?


Return to posts index


sebastian smith
Re: DVD Logo Style Bouncing Layer Expression
on May 30, 2019 at 8:55:36 pm

cant figure it out. :(


Return to posts index

Filip Vandueren
Re: DVD Logo Style Bouncing Layer Expression
on May 30, 2019 at 10:15:44 pm

You would need 2 separate margin-variables

H_margin=150;
V_margin=80;

And then use those where needed.



Return to posts index

sebastian smith
Re: DVD Logo Style Bouncing Layer Expression
on Jun 3, 2019 at 8:20:04 pm

thanks,is there a way to loop this expression


Return to posts index


Filip Vandueren
Re: DVD Logo Style Bouncing Layer Expression
on Jun 3, 2019 at 8:34:32 pm

The best way to loop it is to find hSpeed and vSpeed such that they eventually wind up at the same place again.

Here's the expression changed so you can set it to loop at a certain time and a certain number of H en V bounces

hMargin= 100; // how far the anchorpoint of the layer has to stay from the edges of the comp.
vMargin= 50

cw=thisComp.width - hMargin*2;
ch=thisComp.height -vMargin*2;


loopTime = 5; // seconds

// next two should be integers, preferably not divisible by each other,
// for high numbers I recommend prime numbers
hLoops = 3;
vLoops = 4;


t=time%loopTime;

hSpeed = hLoops*2*cw/loopTime;
vSpeed = vLoops*2*ch/loopTime;

// calculate the layer moving at a constant speed
x = value[0] - hMargin + t*hSpeed;
y = value[1] - vMargin + t*vSpeed;

// keep the layer in bounds
x = x&lt;0 ? -x : x;
x%=2*cw;
x = x>cw ? (2*cw)-x : x;

y = y&lt;0 ? -y : y;
y%=2*ch;
y = y>ch ? (2*ch)-y : y;

[x,y]+[hMargin,vMargin]




Return to posts index

Shai Ezra
Re: DVD Logo Style Bouncing Layer Expression
on Aug 4, 2019 at 5:40:32 pm

Thank you very much! It worked perfectly!

I don't understand expressions too well but copy-paste this to the position expression worked.

I also got the errors... I located the problematic lines in the expression and just deleted them, the effect didn't change. You could even change the speed by changing the values. more luck than brains haha

once again thank you my friend (:


Return to posts index

Billy Joe
Re: DVD Logo Style Bouncing Layer Expression
on May 21, 2019 at 6:52:27 pm

I am having the same difficulty.
Did you find a solution?
Could you please explain it to me?
Thanks!


Return to posts index


Billy Joe
Re: DVD Logo Style Bouncing Layer Expression
on May 21, 2019 at 7:37:13 pm

[John Birchman, DSCE, CFOT] "Re: DVD Logo Style Bouncing Layer Expression
by John Birchman, DSCE, CFOT
on Apr 29, 2019 at 1:58:09 pm

Hello:

Can anyone help with setting the cannon emitter to produce a single particle?

I can't seem to figure this part out. Either I get no particles, or a get 0.01 particles per second.

Everything else seems to be working.

Thank you."


-----------------------------------

I am having the same difficulty.
Did you find a solution?
Could you please explain it to me?
Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]