## Adobe Community

• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• How to manage the bottom layer in the hierarchy

# How to manage the bottom layer in the hierarchy

Community Beginner ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

I don't understand how to make blocks that are 2 levels below the main composition play an animation when they cross the middle of the top composition?

I tried expression writing from the top composition to get low blocks coordinates, and from the lowest block to get its position[0] in the composition of the top level - nothing works!

Can anyone help, at least with advice or direction?

Sample project included.

TOPICS
Expressions , Scripting

Views

87

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
3 Replies 3
Engaged ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

I hope you're trying to do something like that.

Scale Expression:

``````offset = 100;
mainCompWidth = comp('MAIN').width;
allBlocksWidth = comp('ALL_BLOCKS').width;
base = mainCompWidth + allBlocksWidth;
allBlocksPos = comp('MAIN').layer('ALL_BLOCKS').position[0];
blockPos = base - allBlocksPos - comp('ALL_BLOCKS').layer(thisComp.name).position[0];
middle = (mainCompWidth + allBlocksWidth) / 2;

scl = Math.min(linear(blockPos, middle + offset, middle - offset, 59.2, 80), linear(blockPos, middle + offset, middle - offset, 80, 59.2));

[scl, scl]``````

Votes

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 Beginner ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

Hi!
Great, but a little bit not what I need.

In the DOT element (MAIN -> ALL_BLOCKS -> BLOCKS_nn -> DOT) I meant any animation, not just scale.

When every "BLOCK_nn" cross the middle of MAIN, the composition starts playing from the first frame (the original 'DOT' would have multiple elements and complex animation).

BLOCKS_nn compositions will be created by duplicating the original BLOCKS_01 in ALL_BLOCKS.

Maybe Time remaping can help?

Anyway, thanks 4 help!

Votes

Report

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

Copy link to clipboard

Copied

LATEST

You can use this expression for any property :

Rotation Expression:

``````offset = 100;
mainCompWidth = comp('MAIN').width;
allBlocksWidth = comp('ALL_BLOCKS').width;
base = mainCompWidth + allBlocksWidth;
allBlocksPos = comp('MAIN').layer('ALL_BLOCKS').position[0];
blockPos = base - allBlocksPos - comp('ALL_BLOCKS').layer(thisComp.name).position[0];
middle = (mainCompWidth + allBlocksWidth) / 2;

val = linear(blockPos, middle + offset, middle - offset, 0, -90);

val``````

Votes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects