Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions New Text Styling + Old Expression?

  • New Text Styling + Old Expression?

    Posted by Michael Szabo on March 22, 2020 at 2:22 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))

    Michael Szabo replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    March 24, 2020 at 10:04 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.

  • Michael Szabo

    March 25, 2020 at 12:09 pm

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

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