ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Referencing Essential Graphics Presets in Expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rob McDougall
Referencing Essential Graphics Presets in Expressions
on Oct 2, 2017 at 2:30:56 pm

Hey all,

I'm building an after effects template and hit upon something which would be nice to be able to include!

On my lower thirds, I have the option for one line or two lines of text. The background shape changes width based on the amount of text in the two boxes. I have rigged up a checkbox to enable / disable the second line. Obviously I can hide the second line of text by making it transparent, but it would be great to be able to delete the text if the second line is unchecked, as my background shape sets its width based on the amount of text in the text boxes.

This lead me to wonder - is there a way to interact with the Essential Graphics panel with expressions?

I want to do something like


if (checkbox ==0){
"";}
else{
--insert text as per essential graphics panel-- }


Any thoughts on this? I've not seen any documentation at all for expressions interacting with Essential Graphics.

Cheers!


Return to posts index

Rob McDougall
Re: Referencing Essential Graphics Presets in Expressions
on Oct 2, 2017 at 2:50:42 pm

moreover, it would be great to be able to "get" the input from the essential graphics panel and IF the second line is empty, to resize the box to fit only one line…


Return to posts index

Scott McGee
Re: Referencing Essential Graphics Presets in Expressions
on Oct 2, 2017 at 4:46:58 pm

I've used it a lot but not tried check, I use sourcetext to trigger.

But if you can add a checkbox to essential graphics (not at a machine to try)

Simplest option would be to do a opacity expression like below.

If(effect(“Checkbox Control”)(“Checkbox”) ==0) 0 else 100;

If you just want to do text this should do it.

If(effect(“Checkbox Control”)(“Checkbox”) ==0) "" else text.sourceText;

Too be fair it'd probably be simpler for me to do it that way, but I've gotten into the habit of typing on/off in a sourceText expression that does the exact same thing.


Return to posts index


Rob McDougall
Re: Referencing Essential Graphics Presets in Expressions
on Oct 2, 2017 at 4:52:27 pm

Thanks Scott.

I had no trouble coming up with the if statement, but the challenge for me is how to address the source text…

If sourcetext >0? I can't figure out the syntax to either a) address the Essential Graphics text coming in or b) assuming the source text is set by essential graphics, how to have an if statement act on a lack of source text.


Return to posts index

Scott McGee
Re: Referencing Essential Graphics Presets in Expressions
on Oct 2, 2017 at 5:48:11 pm

Just got in front of my machine and it works fine. It works as if it was After Effects. I have a lot of stations to look after and can't be bothered making one for each station...So I use if/else statements alot, or try/catch (Depending on if I need to). So I can provide one template that each station. Types into the sourceText (I label it Station), their station and it hides everything else and only uses their station logo, web address etc.

If you add the sourceText for both lines into essential graphics.



I also have a double line like yourself and I use a lot for Vox Pops and subtitles. So you shouldn't have any problems with the below working. No expressions need to be added to the sourceText, it just needs to be added to the opacity. Then drag the sourceText's into essential graphics. Again doesn't matter what you label them as, as it references what they are called in the AE Comp, not essential graphics.

If you add this expression to the opacity of the line 1 background.

txt = thisComp.layer("Line 2").text.sourceText;
if(txt.length<=0)100 else 0;


and this to the Double line back ground.

txt = thisComp.layer("Line 2").text.sourceText;
if(txt.length>0)100 else 0;


When the sourceText of line 2 is deleted and you hit enter. It'll use the line one background. If you enter any text, it'll use the double background.

Hope this works for you.


Return to posts index

Rob McDougall
Re: Referencing Essential Graphics Presets in Expressions
on Oct 3, 2017 at 9:08:37 am

Very handy! Thank you.


Return to posts index

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