Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions createPath and pixel ratios

  • createPath and pixel ratios

    Posted by Mike Foran on June 12, 2023 at 12:52 pm

    Hello all. I’m teaching myself how to use the createPath expression. As my first test I’m trying to create an X that auto conforms to the size of the comp. It wasn’t that hard, with two shape paths using a script. The first shape script looks like this, and the second path uses the opposite corners:

    w = thisComp.width;
    h = thisComp.height;

    createPath(points = [[0,0], [w,h]], inTangents = [], outTangents = [], isClosed = false)

    However, I get an issue when I have a comp that doesn’t have a square pixel ratio, where it doesn’t calculate the ends of the lines at the corners of the comp. Is there a way for the expression to determine pixel aspect and make the appropriate corrections?

    Brie Clayton replied 2 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    June 12, 2023 at 1:59 pm

    Try it this way:

    w = thisComp.width*thisComp.pixelAspect;
    h = thisComp.height;
    createPath(points = [[0,0], [w,h]], inTangents = [], outTangents = [], isClosed = false)
  • Mike Foran

    June 12, 2023 at 2:10 pm

    Yep, that was the ticket. Didn’t know there was an expression for pixel aspect. Thank you Dan!

  • Brie Clayton

    June 13, 2023 at 2:41 pm

    Thanks for your solve, Dan!

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