Activity › Forums › Adobe After Effects Expressions › linking layers between comps when one layer is not at time 0
-
linking layers between comps when one layer is not at time 0
Posted by Al Michaels on September 21, 2017 at 1:42 pmIF 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
Al Michaels replied 8 years, 11 months ago 2 Members · 6 Replies -
6 Replies
-
Dan Ebberts
September 21, 2017 at 4:24 pmIf 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
-
Al Michaels
September 22, 2017 at 10:15 amThanks 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
-
Dan Ebberts
September 22, 2017 at 3:41 pmMy example was for positon. For scale it would be like this:
comp(“animation”).layer(“layers”).scale.valueAtTime(time – thisComp.layer(“animation”).startTime)
Dan
-
Al Michaels
September 22, 2017 at 5:10 pmThanks 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
-
Dan Ebberts
September 22, 2017 at 5:20 pmSorry, I misunderstood how you had it set up. Try it this way:
comp(“animation”).layer(“layer”).scale.valueAtTime(time – inPoint)
Dan
-
Al Michaels
September 22, 2017 at 5:30 pmDan! Amazing!
Thanks so much Great way to end the week!
Alex!
all the best
al
Reply to this Discussion! Login or Sign Up