Highlighted

Parent layer with expressions like Normal parent

Explorer ,
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...

Correct answer by Deepwell | Community Beginner

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

Topics

Expressions

Views

1.3K

Likes

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

Parent layer with expressions like Normal parent

Explorer ,
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...

Correct answer by Deepwell | Community Beginner

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

Topics

Expressions

Views

1.3K

Likes

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
Most Valuable Participant ,
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

Likes

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
Reply
Loading...
Community Beginner ,
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

Likes

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

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...