-
Source text, easeOut, animated counter without slider and setting a font’s name.
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 symbolcountStart = parseInt(thisComp.layer(“^investment1”).text.sourceText); // counter start
countStop = parseInt(thisComp.layer(“^income1”).text.sourceText); // counter endlayerStartTime = thisLayer.inPoint;
layerEndTime = thisLayer.outPoint;
layerDuration = layerEndTime – layerStartTime; // layer’s durationlayerTextOutput = currencySymbol + Math.round(easeOut(time,layerStartTime,layerStartTime + layerDuration,countStart,countStop)); // animating my counter