Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fruit machine REVISITED! – expressions help?

  • Fruit machine REVISITED! – expressions help?

    Posted by Jimmy Brunger on December 6, 2006 at 11:11 am

    Hi guys,

    Thought it better to start a new thread for this as the other one is quite a way down now..

    Basically I’ve made up a fruit machine style comp using the motion tile effect for the spinning reels – works well.

    Though I did like the idea of the reels bouncing gradually to a halt as per someone’s suggestion in the previous thread using the following expression:

    ——–

    freq = 5;
    amplitude = 35;
    decay = 1.0;

    y = amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time);
    position + [0,y]

    ———

    Now this was originally to be applied to the layer’s position data, but when I try to paste it into motion tile as an expression (which is serving a similar purpose to position – the movement of the reels) it doesn’t work…presumably because the following expression is already applied to mo tile:

    ———————

    effect(“Motion Tile”)(1)

    ———————

    If I try add the decay expr after this or in place of it, it doesn’t work.

    Apologies for my niavety – I am *VERY* new to expressions and haven’tyet got my head around how they work.

    Any ideas very much appreciated.
    Jim.

    Aharon Rabinowitz replied 19 years, 5 months ago 3 Members · 7 Replies
  • 7 Replies
  • Mylenium

    December 6, 2006 at 2:52 pm

    Your reference is still linked to the position property. It should read something like that:

    “y = amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time);
    effect(“Motion Tile”)(1) + [0,y]”

    Mylenium

    [Pour Myl

  • Jimmy Brunger

    December 6, 2006 at 3:31 pm

    Still not working I’m afraid…

    Presumably I delete the current expression: effect(“Motion Tile”)(1)

    and then copy/paste yours Mylenium?

    It’s coming up with the following when I do that:

    After Effects warning: Unterminated string constant Expression disabled.

    Error occurre at line 1.
    Comp: ‘fruity ANI w/RAMP’
    Layer: 2 (‘fruity_strip.psd’)
    Property: ‘Tile Center’

    Any ideas? Sorry to be a pain (and a totally niave expression virgin! Do you know any good books/sites I could reference to learn more about expressions btw?)

    Thanks again, J.

  • Mylenium

    December 6, 2006 at 4:37 pm

    Try again:

    freq = 5;
    amplitude = 35;
    decay = 1.0;

    y=amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time);
    effect(“Motion Tile”)(1) + [0,y]

    Maybe I’ve messed up something and you mistook the quotation marks for something belonging to the expression.

    Mylenium

    [Pour Myl

  • Jimmy Brunger

    December 6, 2006 at 5:10 pm

    No, I’m afraid it’s still not working…what I applied before was without the quotation marks. It applies without an error message now, but doesn’t seem to be doing anything than if there were no expression added at all.

    Just incase it’s something else going wrong…

    I am applying the expression to the Motion Tile Tile Center property, which itself has an easy ease interpolation applied to the the KFs. I’ve pulled the curve about a bit in the Graph editor to get it to speed up and slow down just right. But on the other hand – I just changed the KFs back to linear to see if it was that and the reel just spun constantly as a loop with that expression applied…..?!?

    :-~

  • Mylenium

    December 6, 2006 at 5:28 pm

    Works fine here. Dunno what could be the problem.

    Mylenium

    [Pour Myl

  • Aharon Rabinowitz

    December 6, 2006 at 10:54 pm

    [Dave LaRonde] “Because most of the time, you don’t need to use expressions, and let’s face it — expressions are a pain in the neck.”

    I have to disagree with you on this statement. Simple expressions can save hours of work. Well…If you know what you’re doing.

    You can wiggle something by hand, with the wiggler or via an expression. If you do it by hand or with the wiggler, if you have to make changes later it can be a nightmare. The expression requires a change of 1 or 2 numbers for a completely different look.

    It’s like saying that if you want to colorize an entire composition, add 7 effects to each layer instead of using a single adjustment layer with the same effects. Yes there are pitfalls when using adjustment layers, but if you know how to use them they save a ton of time.

    In this case, expressions may not be the way to go, but they often save so much time, there’s no reason not to use them – other than not knowing how.

    Don’t get me wrong – expressions scare the bejeebers out of me, because I’m not a programmer, but a simple looping expression is my daily savior. I use that one almost every day instead of copying and pasting keyframes over and over.

    —————————————-
    Aharon Rabinowitz
    aharon(AT)yahoo(DOT)com
    http://www.allbetsareoff.com
    —————————————-
    Creative Cow Master Series DVD
    particleIllusion Fusion Volume 1
    available @ http://www.pIllusionFusion.com

  • Aharon Rabinowitz

    December 7, 2006 at 4:50 pm

    If your in production mode and have a deadline, that’s no time to experiment, so I agree with that. However, the only way you’ll ever learn expressions is if you take the time to do it. It’s like learning any other complex tool (Such as motion tracking) in After Effects.

    I’ll admit that I’ve lost some serious time on projects with deadlines trying to create an expression that ultimately didn’t pan out. But these days I basically say to myself I have the next 30 minutes to figure out an elegant solution that will be easily updateable – after that, do it manually, and worry about client changes when they happen.

    I don’t have much free time to learn expressions, so for me, coming up with “complex” expression are like gambling with time. You place a cap on how much you can bet, and then you know when to walk away from the table. But you’ll never come out ahead (i.e., with more knowledge or a good solution) unless you gamble a little bit.

    But everyone has got their own way of doing things. To the real expression experts, I probably seem like an expression pansy, but hey, There are other skills I have, so I don’t let it get me down. Do your own thing.

    —————————————-
    Aharon Rabinowitz
    aharon(AT)yahoo(DOT)com
    http://www.allbetsareoff.com
    —————————————-
    Creative Cow Master Series DVD
    particleIllusion Fusion Volume 1
    available @ http://www.pIllusionFusion.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy