Page 1 of 1

Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 5:39 pm
by MarnMxxx
Can't get 2 masks onto one simple clip. Seems like it should be simple but there is absolutely nothing simple in Fusion.

2 Masks, one clip. What's the hidden secret for this easiest of things in After Effects.

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 6:06 pm
by michael vorberg
Can you show what you did so far?

You connect one mask with the other (mask output into mask input) and use both to mask the clip...
Easy as many things in fusion

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 6:54 pm
by MarnMxxx
Here's what you said to do.
Just trying to punch 2 holes into clip to show through to another clip below; seems simple but.

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 8:21 pm
by Sander de Regt
You're almost there.
Personally I'd never mask a loader/mediain, but use a matte control tool after this.
One way to do it the way you're trying to do is by starting with a rectangle mask that covers the whole frame and then use two ellipse masks set to substract to cut the holes and you should be good to go.

*edit* never mind - this is not the best suggestion, see below.

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 8:40 pm
by Hendrik Proosa
Why doesn't op's current setup work though? What is the logic of it not working?

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 8:53 pm
by Sander de Regt
You know what? I just found out you don't need the first rectangle. Just use two ellipses like the OP does.
But: the 2nd one needs to be set to subtract, and I think this is not the case in the OPs original flow.

Re: Trick to 2 masks on one clip

PostPosted: Thu Jun 06, 2019 9:13 pm
by Bryan Ray
Hendrik Proosa wrote:Why doesn't op's current setup work though? What is the logic of it not working?


One of the Ellipses is Inverted, and the second is likely set to Merge. So they're both there, but the second one is simply covered by the first.

Another way to do it would be to leave both Ellipses in their normal positive mode, then add a Bitmap tool between the second Ellipse and the footage and set that to invert instead. Then you'd have two holes in the solid mask.

Re: Trick to 2 masks on one clip

PostPosted: Fri Jun 07, 2019 5:11 pm
by MarnMxxx
You connect one mask with the other (mask output into mask input) and use both to mask the clip...
Easy as many things in fusion


Lots of folks saying how easy Fusion actually is.

Sander de Regt actually gave the easy step of just setting the second Ellipse to subtract. That worked and yes, turns out to be easy. The part that's not easy is figuring this out. Look at the other posts trying to come up with some way to do it. My first ellipse is set at invert and so was the 2nd. I turned off invert on the 2nd ellipse and set to subtract which worked great.

I'll say it again. Fusion is anything but easy. Trying to figure out a way to accomplish simple things is proving very difficult.

Thanks everyone for all the post and I'll be back very soon I'm sure looking to solve something very simple.

Re: Trick to 2 masks on one clip

PostPosted: Fri Jun 07, 2019 8:38 pm
by michael vorberg
your inital post didnt cover the part you want a inverted mask, just two masks together to one loader/mediaIn.

IMO node based compositing needs the artist more to understand what (s)he is doing. if you look node for node you can see your result and decide what to do.

if you looked at your first mask then you see a big white space with a tiny little black hole. how would you do a second hole if it was a sheet of paper? you need to cut it out (=substract) something from it.


another way would be to add both mask together and apply the "Invert mask" on the loader/mediaIn, maybe this is more like you would do it in other software.

Re: Trick to 2 masks on one clip

PostPosted: Fri Jun 14, 2019 3:54 pm
by MarnMxxx
michael vorberg wrote:another way would be to add both mask together and apply the "Invert mask" on the loader/mediaIn, maybe this is more like you would do it in other software.


Adding both masks together was what I was trying in the first place. Whats the trick to that?

Here's how logically it should have gone:
I have a mediaIn. I wanted two holes punched in.
Add a ellipse mask. It makes a circle with everything around it cut out. The opposite of what I want, so I invert the ellipse mask and looky there it punches my hole just like I want.
I needed a second hole so I added a second ellipse and like the first one which worked, I wanted the transparent part on the inside not the outside so I clicked invert. Which worked for the first but not the 2nd. Maybe it would work if I could have one mask node with multiple masks added to it but that doesn't seem to work. Long story short, what works for one mask doesn't work for the next. That is the definition of non-intuitive.

Re: Trick to 2 masks on one clip

PostPosted: Fri Jun 14, 2019 6:16 pm
by Bryan Ray
Allow me to repeat what I said above:

Another way to do it would be to leave both Ellipses in their normal positive mode, then add a Bitmap tool between the second Ellipse and the footage and set that to invert instead. Then you'd have two holes in the solid mask.

Re: Trick to 2 masks on one clip

PostPosted: Sat Jun 15, 2019 12:31 am
by MarnMxxx
Didn't work for me.

Re: Trick to 2 masks on one clip

PostPosted: Sat Jun 15, 2019 4:24 am
by Bryan Ray
Perhaps I didn't explain well. Paste this into your Flow:

Code: Select all
{
   Tools = ordered() {
      Ellipse1 = EllipseMask {
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.641104294478528, 0.5 }, },
            Width = Input { Value = 0.15, },
            Height = Input { Value = 0.15, },
         },
         ViewInfo = OperatorInfo { Pos = { 385, 82.5 } },
      },
      Ellipse2 = EllipseMask {
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.323619631901841, 0.5 }, },
            Width = Input { Value = 0.15, },
            Height = Input { Value = 0.15, },
            EffectMask = Input {
               SourceOp = "Ellipse1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 550, 82.5 } },
      },
      Bitmap1 = BitmapMask {
         Inputs = {
            Invert = Input { Value = 1, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Image = Input {
               SourceOp = "Ellipse2",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 82.5 } },
      },
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.594, },
            EffectMask = Input {
               SourceOp = "Bitmap1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 880, 82.5 } },
      }
   }
}

Re: Trick to 2 masks on one clip

PostPosted: Tue Jun 18, 2019 1:10 pm
by Frank Engel
MarnMxxx wrote:Adding both masks together was what I was trying in the first place. Whats the trick to that?


Not quite. In Fusion, a mask indicates what to include, not what to exclude.

When you "add" masks together, it adds to what is included. If you had two separate "holes" in the two masks, then each mask included everything that was not the hole. Adding them together would mean including everything that was included by either one, so each of the masks would have covered up the hole from the other one.

Re: Trick to 2 masks on one clip

PostPosted: Tue Jun 18, 2019 3:32 pm
by Hendrik Proosa
A simple analogue: you cut a hole into piece of paper. And you cut a hole in different place into another piece of paper. Put one paper over another. Do you see through either of the holes? Nope. Paper here is the mask (value 1.0), hole is where mask value is zero.

Re: Trick to 2 masks on one clip

PostPosted: Mon Dec 21, 2020 1:46 pm
by Chris Hiles
I do agree that Fusion is anything but intuitive for relative newcomers to this kind of work.
I was looking for a similar solution and came across this thread. I didn't fully understand everything but after a little trial and error (using the information here) it is actually really simple, so thanks to everyone for contributing.
Just in case anyone is looking for an easy way, here's how it can be easily achieved with (I think!) the fewest steps. (I'm only writing this to simplify it for anyone at my level, which is definitely not expert!)
Just for clarity, here was my issue:
I have a livestream clip recording of an online workout with 7 other people. My screen is horizontally flipped, meaning the clock behind me and the "You" (which indicates my screen) is mirrored.
I have to copy the clip, add it to the track above, crop, position and horizontally flip it so it is the right way around.
As I have

So, I have Rectangle 1 going into Rectangle2 which in turn goes into Media in, which is my clip.
Rectangle 1 is inverted so that the "You" shows through (on the track below).
Rectangle2 is set to "Subtract" so that the inverted "ouY" is blocked from showing. This appears at the bottom of my screen from Google Meet, which means that when I horizontally flip the clip, the "You" is also flipped.
The actual clicks to achieve this was very few, but that was only after I read this thread and followed the advice.
Hope this helps anyone trying to achieve a similar result.

Re: Trick to 2 masks on one clip

PostPosted: Mon Dec 21, 2020 1:54 pm
by Sander de Regt
Chris Hiles wrote:I have to copy the clip, add it to the track above, crop, position and horizontally flip it so it is the right way around.


Your method definitely works, but if you're using the same clip this isn't even necessary.

You can just add a merge tool after your MediaIn and drag another pipe from the MediaIn to the green arrow of the merge and do the cropping/positoning/flipping etc in that second pipe.

Depending on the complexity of the transformations, you can even do this straight in the Merge node (which contains a flipping option as well) but you can also crop/flip/transform with seperate tools inline from the MediaIn to the green arrow of the merge.

Re: Trick to 2 masks on one clip

PostPosted: Mon Dec 21, 2020 6:59 pm
by wfolta
MarnMxxx wrote:
You connect one mask with the other (mask output into mask input) and use both to mask the clip...
Easy as many things in fusion

I'll say it again. Fusion is anything but easy. Trying to figure out a way to accomplish simple things is proving very difficult.

It's not that it's not easy, it's that Adobe-ified instincts, warped shaped over many years lead us down the wrong path.

Re: Trick to 2 masks on one clip

PostPosted: Mon Dec 21, 2020 9:32 pm
by Kel Philm
Fusion can be a little tricky at times, sometimes things aren't as intuitive as we'd like. But Fusion is designed that way to provide absolute flexibility, there is very little you cannot achieve in a node based compositor and as complexity of your Comp increases it really becomes beneficial. Something like AE becomes a nightmare as complexity increases, but it is easier to learn.

Sander - I noticed you don't like masking the input to a Loader? Just wondering why? I often do this as I figure the Loader will require less cache memory/processing than using a matte node.