Link to the relative position while keeping the original position in After Effects

Posted on Monday, 28 June 2021

 Link to the relative position while keeping the original position in After Effects

If you want to link to the relative position values in After Effects while keeping the original position.

Use this expression:

var p = thisComp.layer(“YOUR LAYER NAME”).transform.position;
(p.value – p.valueAtTime(0)) + value;

——–

One real world example of this could be for example:

p = comp(“Video_7_5”).layer(“PUPILS NULL”).transform.position;
(p.value – p.valueAtTime(0)) + value;

In this case, we wanted to apply the value from a null (which had a wiggle expression) to our current layer. There are two eyes, and we wanted both pupils layers to get the relative position from the null layers. The name of the comp that had the null was “Video_7_5”. The layer name was “PUPILS NULL”. So we simply applied the same expression to both left and right pupil layers.

It was very hard to find a solution to this online, but after a lot of search and testing, I found this expression that works.

This is for position, but it should be possible to use for other things!

Ready to partner?

    Your name*

    Your email*

    Your website

    How can we help? Details please!*

      I agree for this information to be used to respond to my enquiry.*

    * Indicates Required


    Back To Top

    How useful was this post?

    Click on a star to rate it!

    Average rating 0 / 5. Vote count: 0

    No votes so far! Be the first to rate this post.

    We are sorry that this post was not useful for you!

    Let us improve this post!

    Tell us how we can improve this post?