Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions using both source text and tracking / character size expressions

  • using both source text and tracking / character size expressions

  • bart stevens

    April 1, 2020 at 9:37 pm

    Okay, trying to get over this last hurdle, but have hit a road block.
    I have a text layer that has tracking and character size expressions linked to a slider (Control) in the main comp.
    tracking = thisComp.layer(“Control”).effect(“Tracking”)(“Slider”);
    fontSize = thisComp.layer(“Control”).effect(“Font Size”)(“Slider”);
    newStyle = style.setTracking(tracking);
    newStyle.setFontSize(fontSize);

    (thanks to Dan Ebberts for helping me with that)

    This works great, but I also want to have the source text driven by another text layer (Text 2). (usually I would do this with a quickwhip).

    For some reason, I’m not able to utilize expressions for both the source text and tracking/character size
    If I have “sourceText = thisComp.layer(“Text 2″).text.sourceText” at the top of the expression, it will read tracking/character size fine, but not update source text.
    If I have it below the tracking/character expression, it will update the source text but not tracking/ character size.
    I’m a novice in working with expressions, but this seems like it would be a relatively easy task, but I’ve definitely hit a wall.
    Any assistance is greatly appreciated.
    Thanks

  • Dan Ebberts

    April 1, 2020 at 9:46 pm

    Try this:

    txt = thisComp.layer(“Text 2”).text.sourceText;
    tracking = thisComp.layer(“Control”).effect(“Tracking”)(“Slider”);
    fontSize = thisComp.layer(“Control”).effect(“Font Size”)(“Slider”);
    newStyle = style.setTracking(tracking);
    newStyle.setFontSize(fontSize);
    newStyle.setText(txt);

    Dan

  • bart stevens

    April 1, 2020 at 10:03 pm

    Thanks Dan!
    source text is now linked and tracking too..
    Font size is still not updating though…

    I tried changing to:
    newStyle = style.setFontSize(fontSize);
    and it updates, but tracking doesn’t.

  • Dan Ebberts

    April 1, 2020 at 11:27 pm

    Hmmm….OK–try it this way:

    txt = thisComp.layer(“Text 2”).text.sourceText;
    tracking = thisComp.layer(“Control”).effect(“Tracking”)(“Slider”);
    fontSize = thisComp.layer(“Control”).effect(“Font Size”)(“Slider”);
    createStyle().setFontSize(fontSize).setTracking(tracking).setText(txt)

    Dan

  • bart stevens

    April 2, 2020 at 3:26 pm

    That works perfect!
    You’re amazing Dan
    Thanks again

Viewing 1 - 5 of 5 posts

Log in to reply.

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