ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

linking layers between comps when one layer is not at time 0

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
alex uragallo
linking layers between comps when one layer is not at time 0
on Sep 21, 2017 at 1:42:18 pm

IF my precomp layer is offset in time in the main comp, how can i parent a layer in main comp to a layer in the precomp?

if anyone knows i would be forever in your debt!

all the best

al


Return to posts index

Dan Ebberts
Re: linking layers between comps when one layer is not at time 0
on Sep 21, 2017 at 4:24:01 pm

If you want a property in the main comp to follow one in the precomp, it would look like this:

comp("precomp").layer("1").position.valueAtTime(time - thisComp.layer("precomp").startTime)

If you want a property in the precomp to follow one in the main comp, it would look like this:

comp("main comp").layer("1").position.valueAtTime(time + comp("main comp").layer(thisComp.name).startTime)


Dan



Return to posts index

Al Michaels
Re: linking layers between comps when one layer is not at time 0
on Sep 22, 2017 at 10:15:05 am

Thanks Dan, If i wanted a layer in my main comp to follow the scale from a layer in the precomp, i'm guessing i add this in and then it should work once i've renamed the layers and the precomp within the expression.

Below is the expression i'm using. i'm getting no errors but also nothing is happening.

Basically I have a sqaure in the main comp and a red dot in the precomp. I would like the square to reference the red dots scale animation. However I would like to have it further along the timeline than the red dots animation. I understand thatyour expression works however i'm so new to expressions i dont know how to confidently manipulate is to work in my favour.

I hope this makes sense

comp("animation").layer("layers").transform.scale
comp("animation").layer("layers").position.valueAtTime(time - thisComp.layer("animation").startTime)


all the best

al


Return to posts index


Dan Ebberts
Re: linking layers between comps when one layer is not at time 0
on Sep 22, 2017 at 3:41:06 pm

My example was for positon. For scale it would be like this:

comp("animation").layer("layers").scale.valueAtTime(time - thisComp.layer("animation").startTime)


Dan



Return to posts index

Al Michaels
Re: linking layers between comps when one layer is not at time 0
on Sep 22, 2017 at 5:10:38 pm

Thanks Dan! Sorry I didnt see that!

Sadly there is still a problem. To avoid any miscommunication I've attached a project.

The script works but it seems to react the same way it would if i just pick whipped it.

Thanks for you help

https://www.dropbox.com/s/zuryve8goa6gpoo/LinkingLayers_01.aep?dl=0

all the best

al


Return to posts index

Dan Ebberts
Re: linking layers between comps when one layer is not at time 0
on Sep 22, 2017 at 5:20:34 pm

Sorry, I misunderstood how you had it set up. Try it this way:

comp("animation").layer("layer").scale.valueAtTime(time - inPoint)


Dan



Return to posts index


Al Michaels
Re: linking layers between comps when one layer is not at time 0
on Sep 22, 2017 at 5:30:11 pm

Dan! Amazing!

Thanks so much Great way to end the week!

Alex!

all the best

al


Return to posts index

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