ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Counting text fields that are not empty in an AE Essential Graphics template within Premiere

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mikael Holmström
Counting text fields that are not empty in an AE Essential Graphics template within Premiere
on Feb 12, 2018 at 1:05:42 pm

Hi again,

I'm still trying to figure out how to get this AE Essential Graphics template to work in Premiere Pro.

I have a three input fields in the template: the text.textSource of text layer "Heading 1 Line 1", "Heading 1 Line 2" and "Heading 1 Line 3".

Everything works fine in AE, but the code below that is supposed to return the number of text fields that has content, "crashes" when I open the template in Premiere.

Anyone has any idea how to fix this?

Thanks
Mikael

n = 3;
t1 = thisComp.layer("Heading 1 Line 1").text.sourceText;
t2 = thisComp.layer("Heading 1 Line 2").text.sourceText;
t3 = thisComp.layer("Heading 1 Line 3").text.sourceText;
if (t3 == "") {n = 2}
if (t2 == "" && t3 == "") {n = 1}
n


Return to posts index

Mikael Holmström
Re: Counting text fields that are not empty in an AE Essential Graphics template within Premiere
on Feb 12, 2018 at 1:36:32 pm

I thought I found a workaround by checking the width of each layer instead of if they are empty or not. I'm a bit surprised that this didn't do the trick. :(

n = 3;
t1 = thisComp.layer("Heading 1 Line 1").sourceRectAtTime().width;
t2 = thisComp.layer("Heading 1 Line 2").sourceRectAtTime().width;
t3 = thisComp.layer("Heading 1 Line 3").sourceRectAtTime().width;
if (t3 == 0) {n = 2}
if (t2 == 0 && t3 == 0) {n = 1}
n


Return to posts index

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