Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Maintain Stroke Width Expression error : Couldn’t turn result into numeric value

  • Maintain Stroke Width Expression error : Couldn’t turn result into numeric value

    Posted by Aurora Wang on May 23, 2024 at 5:51 pm

    I used this expression to maintain the stroke thickness for many years.

    • value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001;

    Recently, After Effects started reporting an error on this expression even though it still works ” Error: Couldn’t turn result into numeric value”. Does anyone know how to make the expression perfect?

    Brie Clayton replied 1 year, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Hector Vera

    May 23, 2024 at 6:08 pm

    The error message basically means that After Effects was unable to convert the result of the expression into a numeric value that can be used to modify the attribute value of the shape layer.

    After Effects most likely is having issues interpreting the length function.

    One solution to this error is to replace the length function with a calculation that does not use the length function.

    One way to do this is to use the value^2 and 0.5 * 0.5 math operators, instead.

    Here’s an updated expression that should work:

    value / (value^2 + 0.5^2) || 0.001;

    This expression divides the value by the sum of the square of value and 0.5 squared, taking the square root of the result. The result is then multiplied by 0.5. This expression should produce the same result as the original expression, while avoiding the use of the length function.

    Hopefully this can help you in some ways.

  • Aurora Wang

    May 23, 2024 at 6:20 pm

    I would say wooooooow!!!! I really appreciate your help!

    I just learned a lot based on what you mentioned. May I know where did you learn these complex scripts? Or any resources you would recommend:)

  • Brie Clayton

    May 23, 2024 at 7:59 pm

    Thank you for solving this issue, Hector!

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