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

Font Size Expression Not Working in Pre-Comp's Essential Properties

Explorer ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

I have a few pre-comps to use as titles in other comps. Each pre-comp includes a text layer and a control layer with a "Font Size" slider. The Source Text of the text layer has the following expresion:

text.sourceText.style
.setFontSize(thisComp.layer("control").effect("Font Size")("Slider"))
.setAutoLeading(true)
;

Changing the slider in the pre-comp's control layer works great. I've added the slider to the Essential Graphics panel and it works great there too. However, when I add the pre-comp to another comp and try changing the Font Size in the Essential Properties, nothing happens.

Amozza_0-1677015394820.png

I tried enabling the Font Size Adjustment in the EG panel, by that doesn't show up in the Essential Properties list. This is why I implemented the slider. 

 

I exported it as a MOGRT and tried it in Premiere, and it works fine there too. So why is it not working in AE? I'm on AE v23.1.0

TOPICS
Error or problem , Expressions

Views

670

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

correct answers 1 Correct answer

Explorer , Feb 22, 2023 Feb 22, 2023

UPDATE: The issue occurs after you edit the text in the Essential Properties (Source Text was added to the EG panel). It makes sense. When you edit the text, you replace the expression that the Font Size slider references, so it no longer works. 

 

To fix this I added a new text layer "title-text" and turned off visibility. I added this layer's source text to the EG panel instead of the other text layer. Then, on the original text layer I modified the expression as follows:

sourceTextContent = this
...

Votes

Translate

Translate
Community Expert ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

I attempted to replicate the steps you outlined and found that everything worked as expected. Please refer to the attached file for reference.

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
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Thanks for testing OussK. Your file worked for me too, and I created a new one which also worked. I think I will need to recreate my main project in case there is some corruption.

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
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

LATEST

UPDATE: The issue occurs after you edit the text in the Essential Properties (Source Text was added to the EG panel). It makes sense. When you edit the text, you replace the expression that the Font Size slider references, so it no longer works. 

 

To fix this I added a new text layer "title-text" and turned off visibility. I added this layer's source text to the EG panel instead of the other text layer. Then, on the original text layer I modified the expression as follows:

sourceTextContent = thisComp.layer("title-text").text.sourceText; 
text.sourceText.style
	.setText(sourceTextContent)
	.setFontSize(thisComp.layer("control").effect("Font Size")("Slider"))
	.setAutoLeading(true)
	;

 This now works fine.

Amozza_0-1677080528616.png

 

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