Skip to main content
New Participant
July 20, 2024
Question

Precompose shape layer with linked expressions

  • July 20, 2024
  • 1 reply
  • 342 views

Hello!

 

I am learning about expressions and have created an offsetted chain of shape layers that is linked to a sinwave expression.  I am curious what the best method to update the shape layers with new sources would be? I have tried precomposing the shape layer and copying the expressions back after they've moved into the precomp but that doesn't seem to work. Any thoughts on this?

 

Thanks!

This topic has been closed for replies.

1 reply

Legend
July 20, 2024

You can replace thisComp with comp('Example 4 Position + Rotation')

and then you'll be able to move your layers anywhere.

 

New Participant
July 20, 2024

Thanks for getting back AirWeb_AE

Can you explain what that function is doing? -- Essentially I just want to swap each shape layer (with expressions) with a new layer (precomp) - which I suppose I can do by hand matching each new source's PositionScaleRotation to each shape and parenting it to the shape layers with expressions. But I was hoping there's a more parametric method.

Legend
July 20, 2024

In After Effects, thisComp refers to the composition in which the expression is located. In your case:

 

thisComp = comp("Example 4 Position + Rotation")

 

If you pre-compose your shape layer, thisComp will refer to the name of your new pre-composition.

Therefore:

 

thisComp.layer("Controls")

 

will generate an error because "Controls" layer isn't in your new pre-composition, it's in the "Example 4 Position + Rotation" composition.

That’s why you need to use comp("Example 4 Position + Rotation").

If you don't want to replace thisComp, you simply need to move or duplicate your "Controls" layer into your new composition.