Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Need correct expression for scale

  • Need correct expression for scale

    Posted by Sean Kimber on November 2, 2007 at 12:59 pm

    I won’t lie…I’ve avoided Expressions like the plague (other than using the pickwhip). But, I”m making a promo where it looks like I”m going to have to use one with actual values, and I’m not entirely sure what I should do.

    I’m basically making a moving picture within a moving picture. What I mean by that is I have my personality saying something from within a postcard, and then I zoom out quickly from the postcard to where he’s standing holding it. What I did for this move is I had him hold a blue card and zoomed out quickly on the camera. I tracked the motion of the original layer source (the zoomed out footage where he’s holding the postcard) starting with after it was zoomed out and applied the tracker to a red solid with a mask where I want the postcard to be. Then I manually figured out the scale and position points throughout the zoom on the red solid layer. I turned off the opacity for the red solid and have my postcard layer parented to it. Now, obviously, since I manually tracked backwards, that means my red solid starts it’s scale at 469% and ends around 100%. (I tracked the scale, too, so it varies a little bit.) This obviously means that my “postcard layer” is way too large when I have it parented. So, I know I need to use an expression, but I’m not sure how to write it. Sorry for the long explanation. I just wanted to make sure it was clear. Any help would be greatly appreciated! Thanks in advance!

    -Sean Kimber

    Dan Ebberts replied 18 years, 6 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 2, 2007 at 3:47 pm

    It sounds like you just need to multiply your scale value by some factor. So for example, if you wanted to end up at around 20%, you could use an expression like this:

    scaleFactor = .2;
    value * scaleFactor

    Just fiddle with scaleFactor until you get what you need.

    Dan

  • Sean Kimber

    November 6, 2007 at 7:59 pm

    All right. This is driving me crazy. I was able to manually keyframe my scale/position values in the other comp that I was previously talking about, but it looks like I’m going to have to use an expression for this one, and I can’t figure out how to figure out the formula. Basically, it’s the same idea as my previous comp, only the camera zooms in instead of out. Basically, if I track the layer that I want to be the “postcard,” it gets too large, because my tracking matte layer’s top value is 224.5%, and my postcard layer is parented to it. So, I know that I have to create an expression on my track matte that says “scale/*”, but I’m not sure what the value of “*” is. Here is what I can tell you. My lowest scale value on the track matte is 48.91% and my upper value is 224.5%. Obviously, I want the top value to be 100% and want the rest to keep the same ratio. If someone could help me with the formula, I would be eternally grateful. (And if you have time to say how you figured out the formula, that would help, too. I’m a firm believer in learning why, not just plugging in numbers). Thanks in advance!

    -Sean Kimber

  • Sean Kimber

    November 6, 2007 at 8:54 pm

    In an effort to try and figure it out myself, I just watched Aharon Rabinowitz’s After Effects Expressions #1 tutorial where he talked about linear function. I tried to follow it and put in this formula

    x=(then I used the pickwhip to attach the scale value to the track matte’s scale value)
    linear(x,109.8,224.5,48.91,100)

    I got an error message saying “After Effects warning: Bad argument: argument 1 to linear() must be scalar. Error occured at line 2. Expression disabled.”

    What did I do wrong? Thanks.

  • Dan Ebberts

    November 6, 2007 at 9:03 pm

    You can probably fix it like this:

    x=(then I used the pickwhip to attach the scale value to the track matte’s scale value)
    s = linear(x[0],109.8,224.5,48.91,100);
    [s,s]

    Dan

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