Page 1 of 1

Add background to masked clip.

PostPosted: Sat Dec 02, 2017 3:55 pm
by Caleb Rodgers
I have masked a clip using the poly line mask. Now I want to add a background image behind the masked clip. I have tried connecting the picture to the mask too, adding a second mask for my background and connecting that to the first mask tool, and adding it with merge. I have no ideas left on how to do this. My image is just the color blue, so if its possible to change the alpha color that would be great. Thanks

Re: Add background to masked clip.

PostPosted: Sun Dec 03, 2017 6:20 am
by Bryan Ray
Two different methods:

Untitled.png
Untitled.png (64.73 KiB) Viewed 1281 times


Copy the following code and paste it into your Flow View to get a copy of these nodes. Obviously you'll need to replace my jpeg with your own clip and change the image size of the Backgrounds to suit.

Code: Select all
{
   Tools = ordered() {
      Polygon2 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon2Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1265, 214.5 } },
      },
      Polygon2Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.119329385459423, Y = 0.316901393759419, LX = 0.0999342525998751, LY = -0.0993740169217749, RX = -0.0476660057902336, RY = -0.199530514752921 },
                     { Linear = true, X = -0.262327402830124, Y = -0.281690150499344, LX = 0.0476660057902336, LY = 0.199530514752921, RX = 0.147600258537063, RY = 0.100156497740783 },
                     { Linear = true, X = 0.180473372340202, Y = 0.0187793429940939, LX = -0.147600258537063, LY = -0.100156497740783, RX = -0.0999342525998751, RY = 0.0993740169217749 }
                  }
               } }
         }
      },
      Loader2 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\freds\\Desktop\\podcast\\episode 6\\src\\std.jpg",
               FormatID = "JpegFormat",
               StartFrame = -1,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0
            }
         },
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            EffectMask = Input {
               SourceOp = "Polygon2",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 1375, 214.5 } },
      },
      Merge3 = Merge {
         CtrlWZoom = false,
         Inputs = {
            Background = Input {
               SourceOp = "Background3",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Loader2",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 1485, 280.5 } },
      },
      Background3 = Background {
         Inputs = {
            Width = Input { Value = 2800, },
            Height = Input { Value = 1178, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.0975609756097561, },
            TopLeftGreen = Input { Value = 0.341463414634146, },
            TopLeftBlue = Input { Value = 0.579268292682927, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1375, 280.5 } },
      },
      Loader2_1 = Loader {
         Clips = {
            Clip {
               ID = "Clip1",
               Filename = "C:\\Users\\freds\\Desktop\\podcast\\episode 6\\src\\std.jpg",
               FormatID = "JpegFormat",
               StartFrame = -1,
               LengthSetManually = true,
               TrimIn = 0,
               TrimOut = 0,
               ExtendFirst = 0,
               ExtendLast = 0,
               Loop = 0,
               AspectMode = 0,
               Depth = 0,
               TimeCode = 0,
               GlobalStart = 0,
               GlobalEnd = 0
            }
         },
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 2255, 214.5 } },
      },
      Background3_1 = Background {
         Inputs = {
            Width = Input { Value = 2800, },
            Height = Input { Value = 1178, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 0.0975609756097561, },
            TopLeftGreen = Input { Value = 0.341463414634146, },
            TopLeftBlue = Input { Value = 0.579268292682927, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 2255, 280.5 } },
      },
      Merge3_1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background3_1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Loader2_1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
            EffectMask = Input {
               SourceOp = "Polygon2_1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 2365, 280.5 } },
      },
      Polygon2_1 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon2_1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 2365, 313.5 } },
      },
      Polygon2_1Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.119329385459423, Y = 0.316901393759419, LX = 0.0999342525998751, LY = -0.0993740169217749, RX = -0.0476660057902336, RY = -0.199530514752921 },
                     { Linear = true, X = -0.262327402830124, Y = -0.281690150499344, LX = 0.0476660057902336, LY = 0.199530514752921, RX = 0.147600258537063, RY = 0.100156497740783 },
                     { Linear = true, X = 0.180473372340202, Y = 0.0187793429940939, LX = -0.147600258537063, LY = -0.100156497740783, RX = -0.0999342525998751, RY = 0.0993740169217749 }
                  }
               } }
         }
      }
   }
}


Re: Add background to masked clip.

PostPosted: Mon Dec 04, 2017 6:54 pm
by Caleb Rodgers
Thanks a lot. I haven't tried it yet as I ended up scraping this unusable trash I made. Image

I will try it sometime soon as I will inevitably need this later.