Skip to main content
Inspiring
January 16, 2024
Answered

Set Matte behavior

  • January 16, 2024
  • 2 replies
  • 551 views

Hi Friends,

I use Set Matte to add the alpha channel from layer2 to layer1.

But if offset the inPoint from layer2 to sec 1, I still see the alpha in layer1 from 0-1sec and actually I expected to see nothing. If I use the Track Matte this works fine.

Anybody know how I can correct this behavior?

 

thanks

Tudor

This topic has been closed for replies.
Correct answer Graf Tudor

After some try and error and help from Rick I think I found a good solution for me.

I use CC composite to copy the layer and put in the opacity attribute an expression.

Its not absolute the same like the track layer option, but I think not bad to merge multiple layers.

var myLayer = effect("CC Composite")("Top Layer")
time<myLayer.inPoint || time>myLayer.outPoint ? 0 : myLayer.transform.opacity;

2 replies

Graf TudorAuthorCorrect answer
Inspiring
January 19, 2024

After some try and error and help from Rick I think I found a good solution for me.

I use CC composite to copy the layer and put in the opacity attribute an expression.

Its not absolute the same like the track layer option, but I think not bad to merge multiple layers.

var myLayer = effect("CC Composite")("Top Layer")
time<myLayer.inPoint || time>myLayer.outPoint ? 0 : myLayer.transform.opacity;
Community Expert
January 17, 2024

If you want to turn Set Matte on and off, you have to add a mask to the layer that has set matte applied by double clicking the rectangle tool, add the mask as compositing options, and then, to avoid using keyframes, add this expression to mask opacity:

 

matteLayer = thisComp.layer("Matte layer");
lStrt = matteLayer.inPoint;
lEnd = matteLayer.outPoint;
if (time > lStrt && time < lEnd)
	t = 100;
else
	t = 0;

 

I've used this approach a few times with multiple copies of Set Matte and other effects on the same layer to turn an effect on and off automatically based on another layer's in and out points. You can even add an Ease function to both the in- and out-point calculations to make the effect fade in and out based on the Matte layers' in and out points.

 

Inspiring
January 17, 2024

Hmmm ok,
I thing this not bad to trun the visibility on and off, but to work with a mask is a bit to much to setup.
I think will use the calculation Fx and apply to the Second Layer Opacity attribute the expression:

var myLayer = effect("Calculations")("Second Layer");
time<myLayer.inPoint || time>myLayer.outPoint ? 0 : 100; 

It seems to work fine. 🙂
Thanks for your inspiration 

Community Expert
January 17, 2024

You can also add a fade in and fade out to the effect using something like this:

var myLayer = thisComp.layer("My Layer");
t = time - myLayer.inPoint;
t0 = time - myLayer.outPoint;
fadeIn = ease(t, 0, .5, 0, 100);
fadeOut = ease(t0, -.5, 0, 0, -100);
time<myLayer.inPoint || time>myLayer.outPoint ? 0 : fadeIn + fadeOut;