ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

New Text Styling + Old Expression?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Szabo
New Text Styling + Old Expression?
on Mar 22, 2020 at 2:22:07 pm

Hello,

I recently started writing with the new expressions in AE2020 where you can access font styles. I want to pull font styling from either text sources or from controllers elsewhere in my project probably a combination of both, and apply it to a text source generated by an expression.

I made a simple ranger mapper using the linear expression that also rounds down as a floor. The expression works. If I combine it with a previous part of the project where I linked the text styling (that also works) between two layers, the layer doesn't work. They work separately but not when combined onto the same sourceText field. I'm not sure why, can anyone give me a hand it understanding this and the solution? Thanks for the help.

thisComp.layer("FONT SOURCE").text.sourceText.style


input = thisComp.layer("SLIDER CONTROLS").effect("ANIMATION")("Slider");
inputLow = 0;
inputHigh = 100;
outputLow = 0;
outputHigh = thisComp.layer("SLIDER CONTROLS").effect("VALUE")("Slider");

Math.floor(linear(input,inputLow,inputHigh,outputLow,outputHigh))


Return to posts index

Andrei Popa
Re: New Text Styling + Old Expression?
on Mar 24, 2020 at 10:04:27 am

To use a text generated by expressions, you need to use the .setText() function. I think this will fit your situation:

style = thisComp.layer("FONT SOURCE").text.sourceText.style;


input = thisComp.layer("SLIDER CONTROLS").effect("ANIMATION")("Slider");
inputLow = 0;
inputHigh = 100;
outputLow = 0;
outputHigh = thisComp.layer("SLIDER CONTROLS").effect("VALUE")("Slider");

myText = Math.floor(linear(input,inputLow,inputHigh,outputLow,outputHigh));
style.setText(myText)


Andrei
My Envato portfolio.


Return to posts index

Michael Szabo
Re: New Text Styling + Old Expression?
on Mar 25, 2020 at 12:09:48 pm

Yes I think that SetTExt was what I need to look into, thanks for the help


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]