ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Layer Alpha Boundary Size?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Royce Jennings
Layer Alpha Boundary Size?
on Jul 15, 2019 at 12:54:04 am

So in the Layers panel there's a button at the bottom to show the Alpha Boundary, and when applied to a transparent image or video, the result will show that the program has determined the layer's outermost boundaries of opaque data.

Since AE has been so great to already do this work, can I somehow get this boundary size data? I want to be able to scale a layer (with expressions) so the opaque area fills the comp window regardless of how much "dead" space is outside of it. Thanks for any ideas! 😃



Something like this?

//on Scale:
sizeX = 100*thisComp.width/thisLayer.blahblahAlphaBoundary.width;
sizeY = 100*thisComp.height/thisLayer.blahblahAlphaBoundary.height;
lesserScale = Math.min(sizeX,sizeY);//only scale to nearest edge, so as not to exceed the comp size
[lesserScale,lesserScale]//set x & y the same to maintain layer aspect ratio

//on Scale:
sizeX = 100*thisComp.width/thisLayer.blahblahAlphaBoundary.width;
sizeY = 100*thisComp.height/thisLayer.blahblahAlphaBoundary.height;
lesserScale = Math.min(sizeX,sizeY);//only scale to nearest edge, so as not to exceed the comp size
[lesserScale,lesserScale]//set x & y the same to maintain layer aspect ratio


Return to posts index

Miguel de Mendoza
Re: Layer Alpha Boundary Size?
on Jul 15, 2019 at 3:21:28 pm

As I can see inspecting scripting layer properties, there is no such property. Maybe you can precomp the matted image and use "sampleImage()" to get alpha values of the precomp. Not trivial, not elegant and not eficient but may work


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]