-
Multiple conditions for text opacity relative to number of lines
Hello
I have difficulties to solve problems with a project that is a little bit complex.
*I have a text layer used as “source text”.
* 3 text layers, for 1 line / 2 lines / 3 lines text, with opacity linked with the number of lines in the “source text”. I control the text with essential graphics. The size of the text for 1 line or 2/3 lines is different.
* I have a dropdown menu too, used to switch between the text, or a logo, or a Live logo using the opacity parameter.
Here is the problem, when I choose “logo” or “live” in the dropdown menu, the text layers do not disappear because they are also linked to the lines number. And I need to have only “text”, or only “live”, or only “logo”.
I need to use a if/or/and / else statement, but I can not find the right way of writing it.
For example, I wrote this in the opacity of the 2 lines text layer:
===================================
OPAC = transform.opacity.value;
dropMenu2 = comp(“ES_TITLE_CUSTOM”).layer(“CLOSER_CUSTOM 4”).effect(“PART 2”)(1).value;
switch ( dropMenu2 )
{
case 3: [100]
break;
default: [0]
};
thisComp.layer(“EVENT NAME”).text.sourceText.split(‘\r’).length === 2 || thisComp.layer(“EVENT NAME”).text.sourceText.split(‘\3’).length > 1 ? OPAC : 0
===================================
As you can see the opacity is controlled by the dropdown menu and by number of lines, with so many conditions I do not find how to make a correct code.
You can also find the project, because it is not easy to explain it in details.
If someone can help me, it would be great help.
Thanks in advance.