Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linear Expression for the Scale Property

  • Linear Expression for the Scale Property

    Posted by Christian Simpson on February 25, 2023 at 3:17 am

    Hey All,

    I am attempting to map an image’s scale that is currently scaled at 15% to a null that is currently at 100%. I would like to use the linear expression to do this. I’ve tried to write this several different ways and I keep getting an error that says “argument 1 to linear() must be scalar”. I can use linear expressions with values no problem but am running into trouble with the scale property. Any ideas how to write a simple linear expression for scale?

    var input = thisComp.layer("Null 30").transform.scale
    linear(input,0,100,[0,0],[15,15]);
    Dan Ebberts replied 3 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 25, 2023 at 3:33 am

    You were close. Try it this way:

    var input = thisComp.layer("Null 30").transform.scale[0];
    linear(input,0,100,[0,0],[15,15]);
  • Christian Simpson

    February 25, 2023 at 4:46 am

    Darn! Thank you as always Dan. I don’t understand the 0 beside transform.scale but it works!

  • Dan Ebberts

    February 25, 2023 at 5:31 am

    The [0] gives you just the x value of the scale, which meets the requirements for the scalar value required by linear().

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