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.
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]
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!
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now