Adobe After Effects Expressions Forum
Expression to keep layer centred even if comp size changes
Expression to keep layer centred even if comp size changes
by jesse richards on Apr 2, 2020 at 5:47:52 pm

Hi all.

I'm looking for an expression that can be applied to the position of a layer that keeps it centred to the composition even if the comp size and ratio change.

I'm guessing its somehow dividing the comp height and width by 2 but not sure how you do that in an expression.

Thanks in advance

Jesse




Re: Expression to keep layer centred even if comp size changes
by Dan Ebberts on Apr 2, 2020 at 6:03:46 pm

Try this:

[thisComp.width,thisComp.height]/2

Dan




Re: Expression to keep layer centred even if comp size changes
by jesse richards on Apr 2, 2020 at 6:06:17 pm

Works perfectly. Thanks so much!







© CreativeCOW.net