Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Linking a keyframe to a text layer

  • Linking a keyframe to a text layer

    Posted by Craig Sinclair on September 20, 2018 at 4:29 pm

    I’m looking to link a keyframe to a text layer, so that it animates from the number 0 to whatever number is entered in the text layer.

    I was looking for an expression to do this, in order to template the comp as a mogrt designed for PP.

    Is this possible and can anyone out their help?

    Cheers team.

    Kalleheikki Kannisto replied 8 years ago 2 Members · 3 Replies
  • 3 Replies
  • Kalleheikki Kannisto

    September 20, 2018 at 7:09 pm

    Not familiar with what works in mogrts what doesn’t, but here’s an expression that does that.

    finalvalue = value;
    startvalue = 0;
    starttime = 1; // starting time in seconds
    duration = 3; // duration in seconds
    Math.round(linear(time, starttime, starttime+duration, startvalue, finalvalue))

    Well, actually what this does is animate the source text value between zero and the end value, but you can probably figure it out from there. You could simply link to this value, taking out the rounding.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Craig Sinclair

    September 21, 2018 at 8:40 am

    Yea the mogrts thing doesn’t really matter. I was just explaining for context.

    Can’t seem to understand why this wouldn’t work.

    Essentially I’m trying to get the expression on text layer A to link the numerical value of text layer B to a keyframe on Text layer A, so that text layer A animates from 0 to the numerical value of text layer B.

    Everytime I set a var to text layer B I get an error saying that “object of type TextProperty found were a number, array or property is needed.

    Is this because AE doesn’t read number inputs via a text layer? Would I be better of using a slider?

  • Kalleheikki Kannisto

    September 21, 2018 at 2:43 pm

    Oh, ok. Just add “.value” at the end of the expression, and it should read the text value rather than the text property.

    Kalleheikki Kannisto
    Senior Graphic Designer

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