Page 1 of 1

Adding Polygon node to smoke mask

PostPosted: Fri Jul 01, 2022 1:05 pm
by lou2100
I created a smoke and pixel mask and that works fine.

I have created a polygon rotoscope and want to apply it to the median1 .
As I am trying to apply the Pixel mask just to the masked polygon image.
Can this be done?

Here is what I have set up in fusion. I have detached the channelboolean I want to apply the polygon1 node to the median1 but when i do it disconnects from the main mask.
Any suggestions on how I can get this done?

Pixel-polygon.JPG
Pixel-polygon.JPG (36.01 KiB) Viewed 1959 times

Re: Adding Polygon node to smoke mask

PostPosted: Sat Jul 02, 2022 11:39 am
by Sam Steti
You want to apply an effect to just a rotoed part of the image ?
Don't understand what doesn't work for you but if I didn't apply the mask into the clip node itself (which in some case would not be handy if you need the whole image later on), I would add a merge or a matte control somewhere after the clip and pipe the polygon into the mask input of it...

Re: Adding Polygon node to smoke mask

PostPosted: Sun Jul 03, 2022 1:25 am
by lou2100
Sam Steti wrote:You want to apply an effect to just a rotoed part of the image ?
Don't understand what doesn't work for you but if I didn't apply the mask into the clip node itself (which in some case would not be handy if you need the whole image later on), I would add a merge or a matte control somewhere after the clip and pipe the polygon into the mask input of it...



yes that is correct. I am just trying to apply the effect to the rotoed part of the image.
Can you clarify where I would put the merge or matte control?
Fairly new to this. I do not want the whole image , just the polygon portion to display

Re: Adding Polygon node to smoke mask

PostPosted: Sun Jul 03, 2022 9:03 am
by Sam Steti
Ok, since I see you have an instance of your mediaIn, either you create another instance of it (for the sake of my example since you may want to use one of these yet there) and you input your polygon mask into the blue input of this instance, or you add a matte control node after a MediaIn and add the polygon into its blue mask input and go to the MC settings and tick "multiply by mask").
These 2 options will give you just the portion you need... ;) Which you can then merge later on.
(this is so basic that I still hope it's what you wanted)

Here the code you can copy and paste anywhere in an empty space of your node flow (I renamed the loaders with "mediain" for you).
Code: Select all
{
   Tools = ordered() {
      MediaIn_1 = Loader {
         Clips = {
         },
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["Clip1.PNGFormat.PostMultiply"] = Input { Value = 1, },
            EffectMask = Input {
               SourceOp = "Polygon1_1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 660, 49.5 } },
      },
      Polygon1_1 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon1_1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 49.5 } },
      },
      Polygon1_1Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.476394849785408, Y = -0.0345622119815668, LX = 0.0350500715307582, LY = 0.0414746543778802, RX = 0.0100143061516452, RY = -0.129032258064516 },
                     { Linear = true, X = -0.446351931330472, Y = -0.421658986175115, LX = -0.0100143061516452, LY = 0.129032258064516, RX = 0.231759656652361, RY = 0.000768049155145926 },
                     { Linear = true, X = 0.248927038626609, Y = -0.419354838709677, LX = -0.231759656652361, LY = -0.000768049155145926, RX = -0.00715307582260372, RY = 0.175115207373272 },
                     { Linear = true, X = 0.227467811158798, Y = 0.105990783410138, LX = 0.00715307582260372, LY = -0.175115207373272, RX = -0.199570815450644, RY = -0.0053763440860215 },
                     { Linear = true, X = -0.371244635193133, Y = 0.0898617511520737, LX = 0.199570815450644, LY = 0.0053763440860215, RX = -0.0350500715307582, RY = -0.0414746543778802 }
                  }
               } }
         }
      },
      MatteControl1 = MatteControl {
         CtrlWZoom = false,
         Inputs = {
            MultiplyByMask = Input { Value = 1, },
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            EffectMask = Input {
               SourceOp = "Polygon1",
               Source = "Mask",
            },
            PostMultiplyImage = Input { Value = 1, },
            Background = Input {
               SourceOp = "MediaIn",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 49.5 } },
      },
      MediaIn = Loader {
         Clips = {
         },
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["Clip1.PNGFormat.PostMultiply"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 165, 49.5 } },
      },
      Polygon1 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 16.5 } },
      },
      Polygon1Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.476394849785408, Y = -0.0345622119815668, LX = 0.0350500715307582, LY = 0.0414746543778802, RX = 0.0100143061516452, RY = -0.129032258064516 },
                     { Linear = true, X = -0.446351931330472, Y = -0.421658986175115, LX = -0.0100143061516452, LY = 0.129032258064516, RX = 0.231759656652361, RY = 0.000768049155145926 },
                     { Linear = true, X = 0.248927038626609, Y = -0.419354838709677, LX = -0.231759656652361, LY = -0.000768049155145926, RX = -0.00715307582260372, RY = 0.175115207373272 },
                     { Linear = true, X = 0.227467811158798, Y = 0.105990783410138, LX = 0.00715307582260372, LY = -0.175115207373272, RX = -0.199570815450644, RY = -0.0053763440860215 },
                     { Linear = true, X = -0.371244635193133, Y = 0.0898617511520737, LX = 0.199570815450644, LY = 0.0053763440860215, RX = -0.0350500715307582, RY = -0.0414746543778802 }
                  }
               } }
         }
      }
   }
}

Re: Adding Polygon node to smoke mask

PostPosted: Mon Jul 04, 2022 1:54 pm
by lou2100
Sam Steti wrote:Ok, since I see you have an instance of your mediaIn, either you create another instance of it (for the sake of my example since you may want to use one of these yet there) and you input your polygon mask into the blue input of this instance, or you add a matte control node after a MediaIn and add the polygon into its blue mask input and go to the MC settings and tick "multiply by mask").
These 2 options will give you just the portion you need... ;) Which you can then merge later on.
(this is so basic that I still hope it's what you wanted)

Here the code you can copy and paste anywhere in an empty space of your node flow (I renamed the loaders with "mediain" for you).
Code: Select all
{
   Tools = ordered() {
      MediaIn_1 = Loader {
         Clips = {
         },
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["Clip1.PNGFormat.PostMultiply"] = Input { Value = 1, },
            EffectMask = Input {
               SourceOp = "Polygon1_1",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 660, 49.5 } },
      },
      Polygon1_1 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon1_1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 49.5 } },
      },
      Polygon1_1Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.476394849785408, Y = -0.0345622119815668, LX = 0.0350500715307582, LY = 0.0414746543778802, RX = 0.0100143061516452, RY = -0.129032258064516 },
                     { Linear = true, X = -0.446351931330472, Y = -0.421658986175115, LX = -0.0100143061516452, LY = 0.129032258064516, RX = 0.231759656652361, RY = 0.000768049155145926 },
                     { Linear = true, X = 0.248927038626609, Y = -0.419354838709677, LX = -0.231759656652361, LY = -0.000768049155145926, RX = -0.00715307582260372, RY = 0.175115207373272 },
                     { Linear = true, X = 0.227467811158798, Y = 0.105990783410138, LX = 0.00715307582260372, LY = -0.175115207373272, RX = -0.199570815450644, RY = -0.0053763440860215 },
                     { Linear = true, X = -0.371244635193133, Y = 0.0898617511520737, LX = 0.199570815450644, LY = 0.0053763440860215, RX = -0.0350500715307582, RY = -0.0414746543778802 }
                  }
               } }
         }
      },
      MatteControl1 = MatteControl {
         CtrlWZoom = false,
         Inputs = {
            MultiplyByMask = Input { Value = 1, },
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            EffectMask = Input {
               SourceOp = "Polygon1",
               Source = "Mask",
            },
            PostMultiplyImage = Input { Value = 1, },
            Background = Input {
               SourceOp = "MediaIn",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 49.5 } },
      },
      MediaIn = Loader {
         Clips = {
         },
         NameSet = true,
         Inputs = {
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["Clip1.PNGFormat.PostMultiply"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 165, 49.5 } },
      },
      Polygon1 = PolylineMask {
         DrawMode = "InsertAndModify",
         DrawMode2 = "InsertAndModify",
         Inputs = {
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Polyline = Input {
               SourceOp = "Polygon1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 16.5 } },
      },
      Polygon1Polyline = BezierSpline {
         SplineColor = { Red = 173, Green = 255, Blue = 47 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { Linear = true, X = -0.476394849785408, Y = -0.0345622119815668, LX = 0.0350500715307582, LY = 0.0414746543778802, RX = 0.0100143061516452, RY = -0.129032258064516 },
                     { Linear = true, X = -0.446351931330472, Y = -0.421658986175115, LX = -0.0100143061516452, LY = 0.129032258064516, RX = 0.231759656652361, RY = 0.000768049155145926 },
                     { Linear = true, X = 0.248927038626609, Y = -0.419354838709677, LX = -0.231759656652361, LY = -0.000768049155145926, RX = -0.00715307582260372, RY = 0.175115207373272 },
                     { Linear = true, X = 0.227467811158798, Y = 0.105990783410138, LX = 0.00715307582260372, LY = -0.175115207373272, RX = -0.199570815450644, RY = -0.0053763440860215 },
                     { Linear = true, X = -0.371244635193133, Y = 0.0898617511520737, LX = 0.199570815450644, LY = 0.0053763440860215, RX = -0.0350500715307582, RY = -0.0414746543778802 }
                  }
               } }
         }
      }
   }
}

Thank you that worked perfectly . I am new to this so if i may ask you another question in this thread.
I have a polygon1 of a person holding a phone. The phone screen is visible, I have masked the phone in a separate polygon, polygon2.
Would it be possible to input a video/picture/text to the output/media out to that polygon. So for example a different video/picture/text is displayed in the space of polygon2 in the end result. or would I have to do an over lay and play with the zoom and size?

Re: Adding Polygon node to smoke mask

PostPosted: Mon Jul 04, 2022 2:02 pm
by Sam Steti
For this you have to track the screen and insert the graphic by operating a match move overlay, with screen blend mode.
Usually, the color corrector node you add alog with potential matte controls to both sides also sells the whole stuff...

Re: Adding Polygon node to smoke mask

PostPosted: Wed Jul 06, 2022 6:46 pm
by lou2100
Sam Steti wrote:For this you have to track the screen and insert the graphic by operating a match move overlay, with screen blend mode.
Usually, the color corrector node you add alog with potential matte controls to both sides also sells the whole stuff...



Thank you greatly appreciate you providing help and directions