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

Parent layer with expressions like Normal parent

Explorer ,
Aug 12, 2018 Aug 12, 2018

Copy link to clipboard

Copied

Hi there,

How to parent a layer to other layer using expressions so that it acts like normal parent child.i.e

1.Rotate parent moves child etc...

TOPICS
Expressions

Views

6.2K

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Beginner , Sep 04, 2018 Sep 04, 2018

Well, sort-of. You can directly link the "child's" position to the "parents" position. For scaling and rotation you need a "relative link" (adding the parent's and child's values), if you still want to be able to animate the child's scaling and rotation. Important is that to animate/set the child's position, you need to use its anchor instead of its position value.

See it in action here:

AAE: Parent-Child via Expressions on Vimeo

Download the AAE document at:

http://tiefenbrunner.net/Parent-Child%20via%20Expressions.aep.zip

...

Votes

Translate

Translate
LEGEND ,
Aug 16, 2018 Aug 16, 2018

Copy link to clipboard

Copied

There is no such thing. You would have to re-create all transforms inside the expressions code using real hard math, so I suggest you explore other venues and structure your project suitably rather than making it require convoluted expressions.

Mylenium

Votes

Translate

Translate

Report

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
Community Beginner ,
Sep 04, 2018 Sep 04, 2018

Copy link to clipboard

Copied

Well, sort-of. You can directly link the "child's" position to the "parents" position. For scaling and rotation you need a "relative link" (adding the parent's and child's values), if you still want to be able to animate the child's scaling and rotation. Important is that to animate/set the child's position, you need to use its anchor instead of its position value.

See it in action here:

AAE: Parent-Child via Expressions on Vimeo

Download the AAE document at:

http://tiefenbrunner.net/Parent-Child%20via%20Expressions.aep.zip

Votes

Translate

Translate

Report

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
Community Beginner ,
Jun 25, 2020 Jun 25, 2020

Copy link to clipboard

Copied

LATEST

Position is fairly easy you can use this expression to link to any layer's position within the comp no matter if its a child of other layers or not:

thisComp.layer("Null 1").toComp([0,0])

 

You can then try to link with expressions the other properties like scale and rotation but this might not always work, particularly if the parent is rotating or scaling.

 

When it comes to a true parent which includes rotation and scaling things get a bit more tricky. I think there are some complex expressions out there but a quick work around is much easier to remember. One method would be to duplicate the comp containing the child you wish to track, then link all the animating properties to the original comp with pickwhipped expressions (so you have an identical instance of that comp). Then simply hide all the linked layers and do a standard parent to the child layer you want to track. This is effectively rebuilding the parent tree with expressions. Might not always work but it's one way of doing it.

Votes

Translate

Translate

Report

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