Skip to main content
Inspiring
April 6, 2022
Answered

Problem referencing inPoint

  • April 6, 2022
  • 1 reply
  • 533 views

I'm trying to create a bar-graph animation, where I put in the percentage, and then it automatically slides in over X number of frames (in this case, 20 frames), as dictated by a controller layer. But instead of the animation beginning at the inPoint of the layer and then ending 20 frames later, the animation begins at the inPoint and then jumps to the final value at frame 20 of the composition (not the layer). What's really strange is that it is smooth at the outPoint, without any jumping.

slideInDuration = thisComp.frameDuration * thisComp.layer("Controller").effect("Slide In+Out - frames")("Fade In Duration (frames)");
slideOutDuration = thisComp.frameDuration * thisComp.layer("Controller").effect("Slide In+Out - frames")("Fade Out Duration (frames)");
slideInAmount = linear(time, thisLayer.inPoint, thisLayer.inPoint+slideInDuration+0.001, -23, value);
slideOutAmount = linear(time, thisLayer.outPoint-slideOutDuration-0.001, thisLayer.outPoint, value, -23);

if (time<slideInDuration) {slideInAmount}
else if (time<slideOutDuration) {value}
else if (time<thisLayer.outPoint) {slideOutAmount}
else {-23}

 

Please help! Thanks.

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

Try replacing the last 4 lines with this:

time < inPoint + slideInDuration ? slideInAmount : slideOutAmount

1 reply

Inspiring
April 6, 2022

I don't know that it matters, but I use Adobe CS5.5.

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
April 6, 2022

Try replacing the last 4 lines with this:

time < inPoint + slideInDuration ? slideInAmount : slideOutAmount
Inspiring
April 6, 2022

That's exactly what I need! Thank you!