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

Set matte expressions

New Here ,
Nov 08, 2020 Nov 08, 2020

Copy link to clipboard

Copied

Hi!

Is there a way to set matte on layer with expression?

TOPICS
Expressions

Views

1.5K
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 ,
Nov 08, 2020 Nov 08, 2020

Copy link to clipboard

Copied

Pop-ups/ dropdown lists can of course be automated, but how would you even determine which layers to set as the matte? If there is any merit to whatever you are trying to do, you have to explain it much, much better and tell us what it is supposed to do and how you would want it to work.

 

Mylenium

Votes

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 ,
Nov 11, 2020 Nov 11, 2020

Copy link to clipboard

Copied

All right, some explanaition is here.

Let I have Comp 1 with tree layers like this.

pic-1.png

 

Then I want to precomp layers Scis 1 and Scis 2 into Scissors comp for further animation. Scissors will clip and Star in Comp 1 will change their points number. Well, do precomp.

pic-2.png

 

Now I have two nested comps: and Scissors and Comp 1.

pic-3.png

 

pic-4.png

 

Obviously I have to set matte to layer 'Scissors.Scis 1'. How I can do that? Maybe using Set Matte effect. But this effect give a choice any layers from Scissors comp however I need 'Comp 1.Star' matte.

pic-5.png

 

pic-6.png

 

So, is there a way to set matte on layer with expression? Or any other way?

Votes

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
Community Expert ,
Nov 11, 2020 Nov 11, 2020

Copy link to clipboard

Copied

If you can set a keyframe for a property then you can almost always control that property with an expression. In earlier versions of AE, masks were an exception. I'm not sure if there are still exceptions because I have not tried every effect, but you can pretty much count on the ability to use and expression on any property that can be animated. If you cannot set a keyframe and animate the property, you cannot drive that property by an expression. Set Matte does not have a stopwatch so you cannot drive that property with an expression. 

 

If that was my project I might make all 3 layers 3D, pre-compose the top and bottom layer, then collapse transformations. Then I would add these expressions to the top and bottom layer Anchor Point.

 

 

// Top Layer
ofst = comp("Comp 1").layer("Middle").transform.anchorPoint[2];
[value[0], value[1], ofst + 1]

// Bottom Layer
ofst = comp("Comp 1").layer("Middle").transform.anchorPoint[2];
[value[0], value[1], ofst - 1]

 

 

As long as you keep the X, Y rotation, and orientation properties of the 3 layers set to zero, and as long as you keep the Z position of all layers the same, this will work because the layers will always be separated by 1 pixel.

Screenshot_2020-11-11 06.37.18_C6lr63.png

The other option is to keep the layers 2D, duplicate the middle layer, set the middle layer as a track matte for the back layer, and tie the position property of the middle layer copy in the pre-comp to the position property of the middle layer in the main comp.

Screenshot_2020-11-11 06.52.20_irnGY5.png

Votes

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

Copy link to clipboard

Copied

It's pretty lame that you can't add an expression for layers. It makes me wonder why Adobe left the property pickwhip next to them. I really just wanted to use thisComp.layer(index - 1) for mine so I could more quickly hack something together. 

And before anyone gets all upiddy about just using a trackMatte, they aren't the same. I've got a rather complex title box that is Fairly responsive, driven by essential graphics. Checking continuously rasterize fails. It was not designed for that. And my coworker wants the background blurred behind each instance. So my hack was to use a set matte effect to point to the layer above, alpha, then I crushed the alpha gamma 3 times. It only lets you get to gamma of 5. The layer above has a rectangle that is 60% transparent. So the first one probably brought it to close to 10%, the second one probably got it to 1% or so, so I added another one for good measure. Then I used That layer as a trackMatte for the adjustment layer below. 

It was fairly low on the time consuming scale, and it did it's job for now. But there are a Lot of titles. It would have been nice if I could have done an expression so that all I had to do was duplicate the two layers and move them below the next title. And repeat. But I then have to select each one, and select the title from the dropdown one at a time. 
I hoped to cheat it somehow with a pickwhip, but no such luck. Sure would have been nice if they had that open to expressions, or Some way to drive it.

Votes

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 ,
Nov 11, 2020 Nov 11, 2020

Copy link to clipboard

Copied

I concur with Rick. That old scissors thing is tricky to do strictly in 2D and your use of shape layers would require additional pre-composing to get the Set Matte effect to behave correctly in the first place. If a faux 3D approach works, then use that. Otherwise you would have to work with multiple duplicates and create the illusion with invisible cuts/ opacity animation switching back and forth different layers.

 

Mylenium

Votes

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 ,
Nov 11, 2020 Nov 11, 2020

Copy link to clipboard

Copied

Well done, guys! 3D layers with z-position - nice decision.
Look at left arm of that character, it works fine. Thank you!

Votes

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 ,
Jan 30, 2024 Jan 30, 2024

Copy link to clipboard

Copied

LATEST

hello how can I animate scissor vector

i want scissor to open and close

I can`t do it

Votes

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