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

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

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
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

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

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
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

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