Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can i control an individual keyframe value?

  • Can i control an individual keyframe value?

    Posted by Nathan Harald on November 5, 2013 at 3:40 am

    Is it possible to control individual keyframes within After effects. I am trying to create a template where people can place a value to control the end frame. I am thinking a slider on a control layer.

    I have a comp that i want to control using time remap. Animation goes from “Frame 0” to “Frame X”. The animation time doesnt change, just the finishing frame of the remapped comp. Values Only need to go from 1-31 and 1-12

    Can Anyone please help

    Darby Edelen replied 12 years, 6 months ago 3 Members · 3 Replies
  • 3 Replies
  • William Marler

    November 5, 2013 at 9:05 am

    If you create a slider on a control layer, and pick whip the time remap to that slider, the slider value will be equal to the frames of the time remap.

    For example, when the slider = 0, time remap will be 0:00:00:00, when the slider = 25, time remap will be 0:00:01:00 (if you work at 25fps).

    So connect these two values together with the pick whip and animate the slider going from value 0 to value X. Then by moving the value X keyframe, you are altering where the end frame is placed in the timeline.

    Hope this helps.

  • Nathan Harald

    November 5, 2013 at 10:44 am

    i know about that method. This is for a template that i am creating. I am wanting to define ONLY the value of the end frame, i want to try and keep the users out of the comp for simplicity. No timing will be changed in the timeline, just the end value for the keyframe.

  • Darby Edelen

    November 5, 2013 at 11:02 pm

    [Nathan Harald] “I have a comp that i want to control using time remap. Animation goes from “Frame 0” to “Frame X”. The animation time doesnt change, just the finishing frame of the remapped comp. Values Only need to go from 1-31 and 1-12″

    You could apply something like this to the time remap property. This assumes that the animation is linear between the first and last time remapping keyframe:

    startFrame = 0;
    endFrame = effect("Last Frame")("Slider");
    t1 = key(1).time;
    t2 = key(numKeys).time;
    startTime = framesToTime(startFrame);
    endTime = framesToTime(endFrame);
    linear(time, t1, t2, startTime, endTime);

    I’d also recommend an expression like this applied to the slider to limit its input to the desired range:

    low = 12;
    high = 31;
    Math.round(Math.max(low, Math.min(high, value)));

    Darby Edelen

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy