Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Bounding box and scripts

  • Bounding box and scripts

    Posted by Mateo Mazzini on December 12, 2012 at 1:08 am

    I’m looking for a way to access the bounding box of a layer from the extendscript toolkit. I want to create a center pivot script for after effects that could work with a mask, but from using the sourceRectAtTime method I’m only getting the coordinates of the layer size. If you draw a mask, and then select it, After Effects generates the bounding box that would be ideal to center the pivot to (It’s not a real center pivot, but it’s much better that what I’ve achieved with the sourceRectAtTime).

    Does anybody know how to get to that property?

    Thanks!

    Xavier Gomez replied 13 years, 5 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 12, 2012 at 1:46 am

    The only way I can think of would be to have the script temporarily apply sampleImage() expressions to determine the non-zero alpha extents of the layer. Messy, but do-able.

    Dan

  • Xavier Gomez

    December 13, 2012 at 12:26 pm

    If the mask is open, or if it is not in ADD mode, it won’t work though.

    Few times i also would have liked to access the mask bounding box/default anchor point too and it has no corresponding script property. Recalculating it from mask data is possible but requires some knowledge on bezier things.

    This could be a new scripting feature request.

    Xavier

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