Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Aptjel on December 8, 2005 at 10:22 am

    Hi I’m new to expressions and I was hoping to recreate something similar to the apple doc using expressions where it scales increases near to a given point

    What Iv’e been trying to achieve is a similar effect, has anyone got any ideas?

    looking forward to any suggestions

    thanks

    Colin Braley replied 20 years, 5 months ago 3 Members · 5 Replies
  • 5 Replies
  • Colin Braley

    December 8, 2005 at 11:45 am

    I responded to your exact same post yesterday: 🙂

    https://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=2&postid=865824

    ~Colin

  • Rhett Robinson

    December 8, 2005 at 6:32 pm

    Hi Colin,
    Realize I’m getting in the middle of this, but I usually try to work and understand most of the projects on the boards. Part of the problem is I guess I don’t know what effect I’m working to achieve, so…

    Anyway, just from guessing, I set up a 5 second 640X480 comp, then put a photo on one layer, and applied the expression youd posted to the scale. It complained, so I made a 50X50 solid layer above just named “mouse layer”. The expression still complains, saying the results need to be of dimension 2, not 1. I reread your instructions several times, saying to pickwhip the layer for the mouse layer, but I guess I’m still not getting it… any suggestions, or perhaps even a link or desription to the effect?

    Thanks in advance for your help, and I greatly appreciate you posting expressions. Although I’ve generated a few of my own, I typically modify ones I’ve seen that are cool, or simply use the pickwhip with the “built-ins”, as I’m definitely a student, and not a master!
    Rhett

  • Colin Braley

    December 8, 2005 at 7:54 pm

    My apoligies Rhett, the code I posted diddn’t work right. I just tested it (I wasn’t in front of AE when I wrote it) but I forgot to add in the last line I needed it to work correctly. I wrote it between classes and didn’t have AE there. The expression was meant to change the scale of a layer based on how far away mouse_layer is. This is similar to what happens on the dock on Mac computers. The closer the mouse gets to an icon, the bigger it gets. Well the expression should look like this:

    //Begin expression
    mouse_layer = thisComp.layer(“mouse layer”);//Mouse layer
    beginScale = 100;//Scale begins at this
    endScale = 250;//Scale ends at this
    beginDistance = 200;//Distance to begin magnifying in pixels
    endDistance = 0;//Distance to end magnifying in pixels
    //–Don’t modify below here
    dis = length(this.position, mouse_layer.position);
    val = linear(dis, beginDistance, endDistance, endScale, beginScale);
    [val, val]
    //end expression

    It was giving you an error because all I was supplying was single number, and scale has both an x and y component. If you want some more info on how the expressoin works I’l let you know.

    ~Colin Braley

  • Rhett Robinson

    December 8, 2005 at 8:52 pm

    Hey Colin,
    Thanks for the quick response! I modified my comp by putting in 10 .eps files that I resized in Illustrator (to continuously rasterize as they get bigger), lined them up in a dock-like fashion, pasted the expression on the scale of each (I couldn’t find a way to do that all at once), and it worked beautifully! That’s a cool one that I’ll definitely use again! I tried a couple of other variations as well, changing the scale factor etc. I was toying with trying to have a little more “easy-ease” look to the scale, but had little success. Anyway, regardless, like I said, this is really good to me, and I appreciate your help!
    Rhett

  • Colin Braley

    December 9, 2005 at 2:09 am

    Rhett,
    I’m glad I could help. If you want to paste the expression I gave you onto multiple layers just select it, go to edit>copy expression only. Then highlight the other layers and press paste. To get a smoother look try this:

    //Begin expression
    mouse_layer = thisComp.layer(“mouse layer”);//Mouse layer
    beginScale = 100;//Scale begins at this
    endScale = 250;//Scale ends at this
    beginDistance = 200;//Distance to begin magnifying in pixels
    endDistance = 0;//Distance to end magnifying in pixels
    //–Don’t modify below here
    dis = length(this.position, mouse_layer.position);
    val = ease(dis, beginDistance, endDistance, endScale, beginScale);
    [val, val]
    //end expression

    I just used the interpolation method ease() as opposed to linear()

    ~Colin

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