Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Oh please! I need to change result values, 82-100 to be 0-400, simple math isn’t enough

  • Oh please! I need to change result values, 82-100 to be 0-400, simple math isn’t enough

    Posted by Kris Alvarado on April 15, 2015 at 9:43 pm

    Ah I am dying, I’ve been looking all day and my eye are about to fall out. Any help and I would really appreciate it.

    I want to make it when I scale up a precomp it’s linked to a matching drop shadow. Fake 3D basically

    So my precomp scales from 82-100 and my drop shadow needs to go from 0-400.
    I added transform.scale[0] in the drop shadow size, so now it goes from 82-100. I’ve racked my brain multiply and dividing with -81*100 but nothing works, I need to go form 0 or maybe 1.

    oh please help, I’m a total noob and at your mercy!

    transform.scale[0]-81*100

    Kevin Camp replied 11 years, 5 months ago 3 Members · 6 Replies
  • 6 Replies
  • Kevin Camp

    April 17, 2015 at 7:01 pm

    try this:
    linear( scale[0], 81, 100, 0, 400 )

    [edit]
    I see dan had responded to your second post… doh!

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Kris Alvarado

    April 17, 2015 at 7:06 pm

    Thank you! Yes worked perfectly!

    You guys rock!

    Also how do you write it if your connecting to another comp? Right now I have:

    thisComp.layer(“Brick_Icon”).linear(transform.scale[0],100,83.3,100,0);

    I don’t get an error but it also doesnt work :/ This is for the opacity of a type layer to be linked to scale as well

  • Dan Ebberts

    April 17, 2015 at 7:37 pm

    Try it this way:

    s = thisComp.layer(“Brick_Icon”).transform.scale[0];
    linear(s,82,100,0,400)

    Dan

  • Kris Alvarado

    April 17, 2015 at 7:46 pm

    Yup, worked perfectly!

    Thank you!

    If you don’t mind me asking, what is the “s” that made it all work? I tried researching instead of bothering you guys again I can’t find it, I wanna really learn

  • Dan Ebberts

    April 17, 2015 at 7:59 pm

    s is just a variable, a temporary location to store the x scale value.

    Dan

  • Kevin Camp

    April 17, 2015 at 8:03 pm

    by signing the value that is in another comp to ‘s’ it makes it easier to update

    you could have done it like this:
    linear( thisComp.layer("Brick_Icon").transform.scale[0], 82, 100, 0, 400 )
    but by defining ‘s’ as the value in another comp, you could more easily change to a value in another comp by changing ‘s’.

    — note, you could name the variable anything alpha-numerical, as long as it doesn’t start with a number, you could name the variable ‘scale1’ for example.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

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