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

Expression depending on 2 checkboxes

New Here ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

Good day everyone,

In AE, I synced 4 different versions of 1 short video (a white/alpha transition for the Track Matte Key effect), so when I import it into the Graphic Essential Panel, it would be possible in Premiere Pro to toggle on a hard-keyed version, a speed-up version and a combination.

Schermafbeelding 2017-10-16 om 16.35.06.png

The plan is to do it by the following scheme:

Hard-key: OFF

Speed 2x: OFF

= video 1 (soft-key, speed 1x) 100% opacity.

= video 2 (soft-key, speed 2x) 0% opacity.

= video 3 (hard-key, speed 1x) 0% opacity.

= video 4 (hard-key, speed 2x) 0% opacity.

Hard-key: OFF

Speed 2x: ON

= video 1 (soft-key, speed 1x) 0% opacity.

= video 2 (soft-key, speed 2x) 100% opacity.

= video 3 (hard-key, speed 1x) 0% opacity.

= video 4 (hard-key, speed 2x) 0% opacity.

Hard-key: ON

Speed 2x: OFF

= video 1 (soft-key, speed 1x) 0% opacity.

= video 2 (soft-key, speed 2x) 0% opacity.

= video 3 (hard-key, speed 1x) 100% opacity.

= video 4 (hard-key, speed 2x) 0% opacity.

Hard-key: ON

Speed 2x: ON

= video 1 (soft-key, speed 1x) 0% opacity.

= video 2 (soft-key, speed 2x) 0% opacity.

= video 3 (hard-key, speed 1x) 0% opacity.

= video 4 (hard-key, speed 2x) 100% opacity.

Schermafbeelding 2017-10-16 om 16.16.22.png

The only thing is, I'm looking for a way to make the opacity of each layer depending on 2 checkboxes (in instead of 1).

Trying to let it depend on just 1 checkbox with expressions already succeeded (see above)

TOPICS
Expressions

Views

783

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
Advocate ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

It's very similar, you can combine two or more conditions by using && (AND) or || (OR)

The expression for the video 3 would be:

controller = comp("Main").layer("Controller");

hardKey = controller.effect("Hard-Key").value;

speedx2 = controller.effect("Speed 2x").value;

if (hardKey==1 && speedx2==0) 100 else 0;

Similarly for other videos (adapt the last line for each video).
Also change the path to the controller layer in the first line.

Xavier

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
New Here ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

I'm trying to adapt this code to the third video and the last line to everyone, but it won't work?

I already changed comp("Main") ged and .layer("Controller") to the right names I have, but that won't work?

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
Advocate ,
Oct 16, 2017 Oct 16, 2017

Copy link to clipboard

Copied

I don't know... it should work. Check the naming of everything (you can use the pickwhip for that).

Xavier

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
LEGEND ,
Oct 17, 2017 Oct 17, 2017

Copy link to clipboard

Copied

LATEST

You might consider refactoring your expression to contain nested conditionals:

if(hardKey == 1)

{

if(speedX2 == 1)

{100}

else

{0}

}

else

{0}

Presumably in your case the evaluation is stopping after the first condition and the logic operators not processed, so it ends up only ever looking if one of the checkboxes is ticked. Forcing it into a branching test might circumvent the issue.

Mylenium

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