Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control opacity with multiple checkbox selections

  • Control opacity with multiple checkbox selections

    Posted by Dalibor Mitic on March 14, 2022 at 12:48 pm

    Hello,

    I am doing language versioning and I have been using this expression for controlling which text will be shown for which language https://i.imgur.com/puIGXzB.png

    if(comp(“Language”).layer(“Language”).effect(“EN”)(“Checkbox”)==0) 0 else 100;


    But now I need particular text to be shown only in some languages but not in others.

    How can I extend this expression to include only languages I need. For example, I want to show it when my checkbox is on EN, DE, ES but not show on other ones?

    Thank you.

    View post on imgur.com

    Dalibor Mitic replied 4 years, 1 month ago 3 Members · 5 Replies
  • 5 Replies
  • Liran Tabib

    March 14, 2022 at 1:28 pm

    Hi!

    If I understand correctly your issue is to show only one language at a time- so I suggest a different approach:

    Use dropdown menu (expression control) that contains the languages and using the sourceText of the text layer with a switch/case expression to select the correct text content according to the dropdown selection.

    This way you will only need to use and code one layer.

    Cheers!

  • Dalibor Mitic

    March 14, 2022 at 1:38 pm

    Hi Liran, thanks for anwer.
    But no, with a current expression and set up I can just choose language and it will show all my text that has this expression for the chosen language.
    My issue is how to show 1 text layer in some languages, and not in others.
    I can duplicate this text couple of times and just apply this expression for each language, but I want to do it on one text layer if possible.
    Also, I have no idea what switch/case expression is and how to do it.
    The thing is most of the text layers have different positions and sizes etc, so I can’t just use one text layer to show each text, need to have a separate text layer for each text and each Language.
    This method I am using works great for me. I just need to figure out how to do what I need.

  • Dalibor Mitic

    March 14, 2022 at 2:15 pm

    Like this
    if EN,DE,ES is checked show this layer, else (don’t show it), simple as that. Just need to extend the current expression to include this or make a new one

  • Dan Ebberts

    March 14, 2022 at 5:52 pm

    Like this maybe:

    L = comp("Language").layer("Language");

    cb1 = L.effect("EN")("Checkbox").value;

    cb2 = L.effect("DE")("Checkbox").value;

    cb3 = L.effect("ES")("Checkbox").value;

    cb1 || cb2 || cb3 ? 100 : 0

  • Dalibor Mitic

    March 19, 2022 at 6:32 pm

    Yes Dan,

    holly… that worked.
    Thank you so much.
    Now I know how to do this and include other layers when I need them.

    Thank you, thank you.

    You are amazing.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy