Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 1/x expression doesnt work

  • 1/x expression doesnt work

    Posted by Joscar Diaz on March 9, 2022 at 7:06 pm

    Hello, Im doing a scale expression to compensate the scale on other object, for example when Null1 is at 50%, the Null2 must be 200%. The same say if Null 1 is 400%, Null 2 must be 25%

    Im going for a (10000/x) to get that number

    In After Effects im using this expression, but im getting error:

    10000/thisComp.layer(“Null 1”).transform.scale

    if I use a division (/) symbol I always get an error, but if I Plus or Multiply works perfectly.

    There is another way to write this? Thanks

    Joscar Diaz replied 4 years, 2 months ago 3 Members · 4 Replies
  • 4 Replies
  • Tomas Bumbulevičius

    March 9, 2022 at 7:30 pm

    If your scale is uniform, just do this:

    10000/thisComp.layer(“Null 1”).transform.scale[0]

    Scale is a 2D array and it contains x and y value.

  • Joscar Diaz

    March 10, 2022 at 11:22 am

    Hi Tomas, Thanks!, I added the [0] at the end and I got a different error message
    error: expression result must be on dimension 2, not 1


    SO I updated it like this and worked

    [10000,10000]/thisComp.layer(“Null_1”).transform.scale[0]

  • Filip Vandueren

    March 10, 2022 at 11:57 am

    And if the scale isn’t uniform, then this would work:

    s=thisComp.layer(“Null_1”).transform.scale;
    [10000/s[0], 10000/s[1]];
  • Joscar Diaz

    March 10, 2022 at 12:26 pm

    Thanks Filip! That one also worked

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