Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Source text, easeOut, animated counter without slider and setting a font’s name.

Tagged: 

  • Source text, easeOut, animated counter without slider and setting a font’s name.

    Posted by Rustam Bainazarov on December 3, 2020 at 4:33 pm

    Hello.

    I use a plugin to create a giant bunch of videos from a template using a data-table. It’s powerful, yet it can’t affect layer effects. I need to create a template with animated counters using a dynamic data, thus cornering me to avoid, for instance, slider control and to use an expression that retrieves data from hidden text layers. It does work, pretty damn good, in fact. Just one problem: it resets the font I apply for the layer with a counter.

    Here’s the expression I use for the layer’s Source Text:

    fontName = thisComp.layer(“City:”).text.sourceText.style.font; //my attempt to get the font’s name from other layer
    currencySymbol = thisComp.layer(“^currencySymbol”).text.sourceText; // getting the currency symbol

    countStart = parseInt(thisComp.layer(“^investment1”).text.sourceText); // counter start
    countStop = parseInt(thisComp.layer(“^income1”).text.sourceText); // counter end

    layerStartTime = thisLayer.inPoint;
    layerEndTime = thisLayer.outPoint;
    layerDuration = layerEndTime – layerStartTime; // layer’s duration

    layerTextOutput = currencySymbol + Math.round(easeOut(time,layerStartTime,layerStartTime + layerDuration,countStart,countStop)); // animating my counter

    Dan Ebberts replied 5 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    December 3, 2020 at 4:56 pm

    Add this to the end of your expression:

    createStyle().setFont(fontName).setText(layerTextOutput)

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