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

Controller/Switch Opacity for layers within a Precomp

Engaged ,
Feb 01, 2022 Feb 01, 2022

Hi everybody,

 

I'm trying to build a guide precomp where I can shuffle through a set of layers/images with a controller of some kind. Does anybody know of a tutorial that shows this?

 

I found this one:
https://www.youtube.com/watch?v=BIXC4791338&list=PLjN2jfPjVmBMNS-a5qXBfxiz2PIJUQvzl&index=4

...but it involves using essential graphics, I was hoping to learn one thing at a time as this adds another layer of complexity.

Thanks for reading.

 

TOPICS
Expressions , How to , Resources
2.1K
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 01, 2022 Feb 01, 2022

I'll give it one more try.

1. Add a null layer to your comp of images and name it Ctrl.
2. Add a Slider Control to the null.
3. Move the null to the bottom of the layer stack.
4. Add this opacity expression to first image layer:

src=thisComp.layer("Ctrl").effect("Slider Control")("Slider");
if (src== index) {100} else {0}

5. Make sure the Opacity property is selected on the first image layer.
6. Edit > Copy Expression Only
7. Select all the other image layers
8. Edit > Paste
9. Set the Slider Control to t

...
Translate
Community Expert ,
Feb 01, 2022 Feb 01, 2022

If you just do the Icon Selection Rig section of the tutorial (4:45), does that not give you what you want?

Translate
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
Engaged ,
Feb 01, 2022 Feb 01, 2022

It uses essential graphics, if I try using just common elements it doesn't track. He doesn't say where or how he arrived at the icon selection rig portion. The code is linking to an object that isn't explained. 

 

Like when he pickwhips the image it puts up an expression element .effect("Icon-Select"), mine doesn't. Mine says .effect("Slider Control")("Slider") which goes from 1-100 alpha. I don't know where he's getting that from. It's part of essential graphics but it's not explained. It's a given without connection.

 

I imagine I could learn all about essential graphics and maybe that would help but...At this point I'm trying to find something more straight forwar in terms of scripting. 

Translate
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
Community Expert ,
Feb 01, 2022 Feb 01, 2022

That part of the tutorial doesn't even mention essential graphics. He just adds a control layer (and names it Ctrl), adds a Slider Control (and names it Icon-Select), moves the control layer to the bottom of the layer stack, and adds this opacity expression to each of the icon layers:

src=thisComp.layer("Ctrl").effect("Icon-Select")("Slider");
if (src== index) {100} else {0}

 

Translate
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
Engaged ,
Feb 01, 2022 Feb 01, 2022

Exactly. He doesn't mention it but that's what the 'icon-select' portion is. It's referring to essential graphics that aren't mentioned. 

 

If not, I can't tell what he's referring to. I kept scrubbing through the video trying to find out what he's referencing but nothing is mentioned. 

 

 

Translate
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
Community Expert ,
Feb 01, 2022 Feb 01, 2022

I'll give it one more try.

1. Add a null layer to your comp of images and name it Ctrl.
2. Add a Slider Control to the null.
3. Move the null to the bottom of the layer stack.
4. Add this opacity expression to first image layer:

src=thisComp.layer("Ctrl").effect("Slider Control")("Slider");
if (src== index) {100} else {0}

5. Make sure the Opacity property is selected on the first image layer.
6. Edit > Copy Expression Only
7. Select all the other image layers
8. Edit > Paste
9. Set the Slider Control to the index of the image you want visible

Translate
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
Engaged ,
Feb 07, 2022 Feb 07, 2022
LATEST

Excellent! Sorry for the delay in response, I got super busy in work. Thanks so much Dan!

Translate
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