Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Precompose shape layer with linked expressions

New Here ,
Jul 20, 2024 Jul 20, 2024

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!

TOPICS
Expressions
237
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 20, 2024 Jul 20, 2024

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

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

screenshot.pngexpand image

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2024 Jul 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 20, 2024 Jul 20, 2024
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines