Jump to: Board index » General » Fusion

Applying a mask to multiple (merged) elements

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

byte12

  • Posts: 3
  • Joined: Mon Dec 03, 2018 4:12 pm
  • Real Name: Pieter De Decker

Applying a mask to multiple (merged) elements

PostMon Dec 03, 2018 4:19 pm

I've combined two lines of 2D text using a Merge node. How can I apply a gradient mask to them? As in: ensure that all text gradually fades from full opacity to full transparency.

I noticed that when I attach a gradient Background node to the Merge node, that it only applies to the second bit of text. How do I apply it to both?
Offline

Sander de Regt

  • Posts: 984
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Applying a mask to multiple (merged) elements

PostMon Dec 03, 2018 7:18 pm

You can also apply a gradient direcly to the Text 2D itself in the shading tab. That might be more easy in this case?

If not, just let us know and I'm sure someone will help you out.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

byte12

  • Posts: 3
  • Joined: Mon Dec 03, 2018 4:12 pm
  • Real Name: Pieter De Decker

Re: Applying a mask to multiple (merged) elements

PostMon Dec 03, 2018 7:43 pm

I see what you mean, but I want to animate it later. I want to create that gradually "reveals" itself by means of a moving gradient mask.

I wonder what happens if I use a Merge node with only the Foreground and Mask inputs connected...
Offline

Okke Verbart

  • Posts: 130
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: Applying a mask to multiple (merged) elements

PostMon Dec 03, 2018 8:19 pm

Hi Pieter - sounds what you're doing is that you're masking out the foreground. You probably hooked up the background node to the effect mask input. This input is normally used to mask the foreground. So, it would only mask out the text+ node that is set as the foreground.

What you can do (there are many other ways though), is to add a brightness/contrast after the merge output. Tick alpha, and set the gain to zero. Then add a rectangular mask, add softness and animate it.

See example below (just copy & paste into a comp, display the brightness/contrast node in the viewer and hit play)

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "ONE", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 632, 131 } },
      },
      Rectangle1 = RectangleMask {
         Inputs = {
            SoftEdge = Input { Value = 0.0812, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input {
               SourceOp = "Path1",
               Source = "Position",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 898, 46 } },
      },
      Path1 = PolyPath {
         DrawMode = "InsertAndModify",
         Inputs = {
            Displacement = Input {
               SourceOp = "Path1Displacement",
               Source = "Value",
            },
            PolyLine = Input {
               Value = Polyline {
                  Points = {
                     { Linear = true, LockY = true, X = 0, Y = -0.0148148148148148, RX = 0, RY = 0.109259259259259 },
                     { Linear = true, LockY = true, X = 0, Y = 0.312962962962963, LX = 0, LY = -0.109259259259259 }
                  }
               },
            },
         },
      },
      Path1Displacement = BezierSpline {
         SplineColor = { Red = 255, Green = 0, Blue = 255 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 19.3333333333333, 0.333333333333333 }, Flags = { Linear = true, LockedY = true } },
            [58] = { 1, LH = { 38.6666666666667, 0.666666666666667 }, Flags = { Linear = true, LockedY = true } }
         }
      },
      BrightnessContrast1 = BrightnessContrast {
         CtrlWZoom = false,
         Inputs = {
            Alpha = Input { Value = 1, },
            Gain = Input { Value = 0, },
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 901, 161 } },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text2",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 791, 161 } },
      },
      Text2 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Center = Input { Value = { 0.5, 0.418518518518519 }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "TWO", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 631, 164 } },
      }
   },
   ActiveTool = "BrightnessContrast1"
}
www.ablackbirdcalledsue.com
Offline
User avatar

Bryan Ray

  • Posts: 719
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Applying a mask to multiple (merged) elements

PostMon Dec 03, 2018 9:47 pm

byte12 wrote:I wonder what happens if I use a Merge node with only the Foreground and Mask inputs connected...


You'll get an error since the Merge requires a Background to set its format. You could put a black, 0 alpha Background node in the Background input of the Merge, though, to give you an empty canvas on which to work.

Another method is to connect your mask to the Effect Mask input of both Text nodes. That won't work so well if you're doing any transformations of the text after the generator itself since the mask will be transformed right along with the text. That looks like this:

Code: Select all
{
   Tools = ordered() {
      Rectangle1 = RectangleMask {
         CtrlWZoom = false,
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.245827984595635, 0.5 }, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 82.5 } },
      },
      Text2 = TextPlus {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Center = Input { Value = { 0.5, 0.45662100456621 }, },
            Size = Input { Value = 0.1368, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "Two Fish", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Red1 = Input { Value = 0.048616, },
            Green1 = Input { Value = 0.048616, },
            Blue1 = Input { Value = 0.472, },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 605, 115.5 } },
      },
      Text1 = TextPlus {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Center = Input { Value = { 0.5, 0.53972602739726 }, },
            Size = Input { Value = 0.192, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "One Fish", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Red1 = Input { Value = 0.336, },
            Green1 = Input { Value = 0.00672000000000001, },
            Blue1 = Input { Value = 0.00840000000000019, },
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 605, 82.5 } },
      },
      Merge2 = Merge {
         Inputs = {
            UseOpenCL = Input { Value = 0, },
            Background = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text2",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 115.5 } },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

byte12

  • Posts: 3
  • Joined: Mon Dec 03, 2018 4:12 pm
  • Real Name: Pieter De Decker

Re: Applying a mask to multiple (merged) elements

PostWed Dec 05, 2018 4:57 pm

Bryan Ray wrote:You'll get an error since the Merge requires a Background to set its format. You could put a black, 0 alpha Background node in the Background input of the Merge, though, to give you an empty canvas on which to work.

That did the trick for me, thanks!
Offline

TinaNamdev

  • Posts: 1
  • Joined: Sat Dec 08, 2018 5:46 am
  • Real Name: TinaNamdev

Re: Applying a mask to multiple (merged) elements

PostSat Dec 08, 2018 7:54 am

I noticed that when I attach a gradient Background node to the Merge node
Capital Vraddhi Reviews

Return to Fusion

Who is online

Users browsing this forum: No registered users and 12 guests