ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

using both source text and tracking / character size expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
bart stevens
using both source text and tracking / character size expressions
on Apr 1, 2020 at 9:37:13 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


Return to posts index

Dan Ebberts
Re: using both source text and tracking / character size expressions
on Apr 1, 2020 at 9:46:31 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



Return to posts index

bart stevens
Re: using both source text and tracking / character size expressions
on Apr 1, 2020 at 10:03:31 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.


Return to posts index


Dan Ebberts
Re: using both source text and tracking / character size expressions
on Apr 1, 2020 at 11:27:03 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



Return to posts index

bart stevens
Re: using both source text and tracking / character size expressions
on Apr 2, 2020 at 3:26:59 pm

That works perfect!
You're amazing Dan
Thanks again


Return to posts index

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