ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to drive Anchor Point

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Chris Voelz
Expression to drive Anchor Point
on Sep 18, 2018 at 8:17:08 pm

I am building a template project that can be easily imported and changed for each video we produce. I can't quite wrap my brain around how to achieve this super specific expression. I want the size of a shape layer box to control the anchor point of a Null object. For every 1 pixel added, or subtracted, to the width of the shape layer I want the Null object's Anchor Point to shift by 0.5 pixels. So increasing the width would shift the Anchor Point to the right and decreasing the width would shift it to the left. The point of this is to keep the middle of the shape layer center to the comp so when it animates in it is from the center. Normally it wouldn't be an issue but I have some graphics on the left side of the shape layer and want to maintain their positional relationship, so the shape layer is anchored to the left. The starting width for the shape layer is 1322. I also have rounded corners and have the other expressions set up to help maintain their ratio.



The arrow in the image is pointing out what will drive the anchor point. "Text Box" is the shape layer that the slider is controlling and showing current expressions being used.

Thanks for any help or insight you can provide!


Return to posts index

Chris Voelz
Re: Expression to drive Anchor Point
on Sep 18, 2018 at 10:15:45 pm

After walking away for a couple hours I figured it out. I just needed to think of it from a different perspective. Established that the starting value as 1322 and everything fell into place. Pretty simple actually.

temp = thisComp.layer("Layer Name").effect("Slider Name")("Slider");
[((temp-1322)/2), 0]


Return to posts index

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