FORUMS: list search recent posts

Relative Position Shenanigans

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jon Mitchell
Relative Position Shenanigans
on Oct 15, 2013 at 3:51:12 pm

Hello! First posting, have used these forums oh-so-many times for expression help. They actually have led me to crafting an expression that almost works, but not quite and I cant figure out why.

The situation: 2 layers, one "parenting" the other and I want the "child's" position to change relative to the parent starting at a certain time. (NOTE: the layers are not actually set as parent and child, they are only linked by the following expression)

I used this expression:


freeze = [960, 540]
text = thisComp.layer("Show1").transform.position;

timetoStart= 5.1

if(time > timetoStart){
text-sub(text, freeze);
}else{freeze;}


I figured the simple difference of a difference calculation would do the trick, but the expression just yields a constant 960, 540 as the position. I double checked and sub(text, freeze) does yield the proper difference (and it's dynamic) but when I try to subtract the dynamic difference from text if yields a constant value.

What's going on? :(


Return to posts index


Dan Ebberts
Re: Relative Position Shenanigans
on Oct 15, 2013 at 4:22:19 pm

I think you need to reference where the Show1 layer was at timetoStart.

change this:

text-sub(text, freeze);

to this:

text - text.valueAtTime(timetoStart) + freeze;


Dan



Return to posts index

Jon Mitchell
Re: Relative Position Shenanigans
on Oct 15, 2013 at 4:28:07 pm

Dan,
Brilliant. Worked like a charm.

Thank you!

-Jon


Return to posts index

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