ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking range - Height Scale to Y Position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Saber Na
Linking range - Height Scale to Y Position
on Aug 7, 2017 at 7:04:35 pm

Hi, I'm trying to make the white triangle's height to follow the yellow triangle's Y position. I've tried this script but it is not working. Any help would be greatly appreciated.




temp = thisComp.layer("Shape Laye 2").transform.position[1]*-100/350+174;
[transform.scale[0], temp]


Return to posts index

Andrei Popa
Re: Linking range - Height Scale to Y Position
on Aug 8, 2017 at 9:46:18 am

I made it this way. On the anchor property of your size-modifiyng layer add the expression

temp = thisLayer.sourceRectAtTime(time,false).height/2;
[value[0],temp]


and on the size position (Rectangle 1>Rectangle path 1> Size) addd the expression

temp = (thisComp.layer("Shape Laye 2").transform.position[1]*-1 + height)/2;
[value[0], temp]


replace "height" with the starting coordinates of your layers, or align the size-modifiyng layer to the bottom of the composition. I added an image for easier understanding.



Andrei


Return to posts index

Saber Na
Re: Linking range - Height Scale to Y Position
on Aug 8, 2017 at 7:10:35 pm

Wow! Thank you very much Andrei, it works exactly the way it should!


Return to posts index


Andrei Popa
Re: Linking range - Height Scale to Y Position
on Aug 9, 2017 at 9:08:28 am

Glad i could help!

Andrei


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]