Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Find object location / bounds

  • Find object location / bounds

    Posted by Erick Pinell on February 5, 2009 at 7:42 pm

    Totally new to After Effects Expressions. I’ve spent a couple days searching but haven’t seen anything that makes sense to me.

    Is it possible to get the bounds/location of an objects various sides (top, bottom, left, right)?

    What I’d like to do is align some dissimilar objects in a uniform way. So object b’s left edge would be 20 pixels to the right of object a’s right side. Does that make sense?

    TIA.

    Erick.

    Dan Ebberts replied 17 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    February 5, 2009 at 9:38 pm

    If you’re just talking about a layer’s boundaries, that’s pretty easy, using the layer’s position, width, height, scale, and pixel aspect ratio.

    If you’re talking about visible pixels, it’s a little trickier. You need to use sampleImage() sampling an entire row or column of pixels at a time, moving from one edge inward until you encounter a non-zero alpha.

    Dan

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