Skip to main content
Participating Frequently
October 20, 2014
Answered

Scale over time expression

  • October 20, 2014
  • 2 replies
  • 7721 views

I'm trying to have an element scale up and do so through an expression:

startScale = 100;

endScale = 300;

scaleUpTime = 5;

s = ease(time, inPoint, inPoint + scaleUpTime, startScale, endScale);

[s,s]

This works but I'd like to modify this is that the endScale is actually a random number between 100 and 300.

I'd also like the whole thing to trigger at a specific time (or frame).

I tried random(100,300) but it gives a jittery result not a constant scale up to a random value

This topic has been closed for replies.
Correct answer Dan Ebberts

Thank you Dan,

Is there a way to express the fStart in seconds from beginning of comp rather than in frames?


So the in point is no longer part of the equation? I guess that would be like this:

scaleUpTime = 5;

tStart = 2; // start at 2 sec from beginning of comp

startScale = 100;

seedRandom(index,true)

endScale = random(100,300);

s = ease(time, tStart, tStart + scaleUpTime, startScale, endScale);

[s,s]

Dan

2 replies

Participant
March 5, 2015

So the script that was mentioned above worked perfect for me. However, how do I separate the x & y. I only want the 'Y' axis to scale up with time and I want 'X' to stay the same thickness the entire time. Allowing me to build a bar graph.

The script that worked for me was:

startScale = 0;

endScale = effect("Bar 6 Height")("Slider");

scaleUpTime = 4;

s = ease(time, inPoint, inPoint + scaleUpTime, startScale, endScale);

[s,s]

But how can I keep the x from scaling? I just want to keep it the same size.

Thanks

Dan Ebberts
Community Expert
Community Expert
March 5, 2015

Just change the last line to:

[value[0].s]

Dan

Participating Frequently
October 20, 2014

...I actually got the triggering part figured out:

transitionStart = 8;

if (time >= transitionStart)  {

    startScale = 100;

    endScale = 300;

    scaleUpTime = 5;

    s = ease(time, transitionStart, transitionStart + scaleUpTime, startScale, endScale);

    [s,s]

}

else  {

    value

}

if anyone could help with the random number...

Dan Ebberts
Community Expert
Community Expert
October 20, 2014

This is what I came up with:

scaleUpTime = 5;

fStart = 15; // start at 15 frames from in point

startScale = 100;

seedRandom(index,true)

endScale = random(100,300);

tStart = framesToTime(fStart) + inPoint;

s = ease(time, tStart, tStart + scaleUpTime, startScale, endScale);

[s,s]

Dan

Participating Frequently
October 20, 2014

Thank you Dan,

Is there a way to express the fStart in seconds from beginning of comp rather than in frames?