Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Göran Thorén on November 20, 2008 at 9:01 am

    Hi,
    probalbly a silly question but I can´t figure it out.

    How do I reverse the cale property in an expression?

    This is what I have:
    comp(“00148P.mov ansikte”).layer(“00148P.mov”).transform.scale

    Now I need that expreesion to do the reversed thing. Does anyone know?

    Thank´s!

    Göran Thorén replied 17 years, 5 months ago 3 Members · 6 Replies
  • 6 Replies
  • Filip Vandueren

    November 20, 2008 at 11:29 am
    s=comp("00148P.mov ansikte").layer("00148P.mov").transform.scale;
    [10000/s[0],10000/s[1]];
    // or
    [10000/s[0],10000/s[1],10000/s[2]];
    

    Hi Goran,

    if by reverse you mean 50% -> 200%
    try this expression (for 2D)

    for 3D use the lqst line

  • Göran Thorén

    November 20, 2008 at 11:39 am

    Thank´s a million Filip! It worked like a charm!

  • Filip Vandueren

    November 20, 2008 at 1:13 pm

    of course, watch out for scale [0,0,0] you will get divide by zero errors

  • Göran Thorén

    November 20, 2008 at 2:32 pm

    Ok, will do.
    Could you explain what the expreesion does exactly?

  • Darby Edelen

    November 21, 2008 at 5:44 pm

    10000 is 100 squared.

    You’re dividing 100 squared by whatever your scale happens to be. So at 100% scale your result will be 100%:

    100 * 100 / 100 = 100

    This can also be written as:

    100 * (100 / scale)

    As you decrease the scale value below 100 the second term (100 / scale) will increase in value. At 50% scale the second term will evaluate to 2 which results in 100 * 2 or 200%:

    100 * (100 / 50) = 100 * 2 = 200%

    Does that help at all?

    Darby Edelen

  • Göran Thorén

    November 22, 2008 at 8:52 am

    Thank´s Darby!
    I´m really poor when it comes to math unfortunately, I´m more of a visual person. But it was well explained so I think I get the essense of it. 🙂
    I could never figure things like that out myself. I wish I could though. Thank god for guys like you!

    Göran

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