• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Linking Source Text and Tracking and Character size via expressions

Community Beginner ,
Apr 01, 2020 Apr 01, 2020

Copy link to clipboard

Copied

I'm a novice at expressions, but using them to build a mogrt template and trying to get over this last hurdle. 

I have a text layer that has the character size and tracking linked to a slider "Control" in my main compositoin.

 

tracking = thisComp.layer("Control").effect("Tracking")("Slider");
fontSize = thisComp.layer("Control").effect("Font Size")("Slider");
newStyle = style.setTracking(tracking);
newStyle.setFontSize(fontSize);

 

I have this text layer duplicated (for different layer styles) and I want to match the source text and tracking/ character size in the duplicates.

Usually I would just pick whip for source text, but when I do that, my character size and tracking expression doesn't work. 

I've been stumbling aroudn trying to figure out how to combine the two... Any help would be greatly appreciated. 

 

TOPICS
Expressions

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 01, 2020 Apr 01, 2020

Copy link to clipboard

Copied

I'm trying to pull source text from "Text 2"

If I have "sourceText = thisComp.layer("Text 2").text.sourceText" above 

tracking = thisComp.layer("Control").effect("Tracking")("Slider");
fontSize = thisComp.layer("Control").effect("Font Size")("Slider");
newStyle = style.setTracking(tracking);
newStyle.setFontSize(fontSize);

It will read tracking and character size, but not update source text.

If it's pasted below... It will update source text, but not character size and tracking

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 01, 2020 Apr 01, 2020

Copy link to clipboard

Copied

Can you post a screenshot of your setup, of which expressions go on which text layers?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 13, 2020 May 13, 2020

Copy link to clipboard

Copied

LATEST

Thanks for the feedback. I usually post my solutions, but this slipped under the radar.

Here was what I came up with...

txt = thisComp.layer("Title").text.sourceText;
tracking = thisComp.layer("Control").effect("Tracking")("Slider");
fontSize = thisComp.layer("Control").effect("Font Size")("Slider");
createStyle().setFontSize(fontSize).setTracking(tracking).setText(txt)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines