Skip to main content
Participant
July 31, 2021
Answered

Super basic expression to scale over time

  • July 31, 2021
  • 1 reply
  • 15828 views

Hi folks

An embarrisingly simple one that I'm struggling to find an answer to online.... I want to scale a layer over time, so if I change the length of the layer I don't need to keep moving keyframes. I know for Rotate it's just "time*2", but using this on Scale I get an error "expression result must be of dimension 2".  Clearly this is because there is X and Y.  Can you tell me how to do this please?

Many thanks in advance!

Correct answer Rick Gerard

Do you want it to scale between the in point and the out point of a layer?

Do you want to constantly increase the scale over time?

 

The time value is in seconds so if you just wanted the layer to increase 5% in scale every second the expression would look like this:

 

t = time - thisLayer.inPoint;
v = t * 5;
[value[0] + v, value[1] + v]

 

 If you want the layer to expand by 50% between the in point and the out point the expression would look like this:

 

t = time;
tMin = thisLayer.inPoint;
tMax = thisLayer.outPoint;
sclVal = linear(t, tMin, tMax, 0, 50);
[value[0] + sclVal, value[1] + sclVal]

 

1 reply

Rick GerardCommunity ExpertCorrect answer
Community Expert
July 31, 2021

Do you want it to scale between the in point and the out point of a layer?

Do you want to constantly increase the scale over time?

 

The time value is in seconds so if you just wanted the layer to increase 5% in scale every second the expression would look like this:

 

t = time - thisLayer.inPoint;
v = t * 5;
[value[0] + v, value[1] + v]

 

 If you want the layer to expand by 50% between the in point and the out point the expression would look like this:

 

t = time;
tMin = thisLayer.inPoint;
tMax = thisLayer.outPoint;
sclVal = linear(t, tMin, tMax, 0, 50);
[value[0] + sclVal, value[1] + sclVal]

 

David5FA1Author
Participant
July 31, 2021

Wow that is so helpful Rick!  I'd never have worked that out on my own.  The first one was perfect and I changed v = t * 5; to v = t * 1;  so that the text I have slowly scales larger in frame regardless of the clip length.  Appreciate you taking the time to reply.