Jump to: Board index » General » Fusion

Paint and Clone questions

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

Todd Groves

  • Posts: 453
  • Joined: Fri Sep 15, 2017 1:24 am

Paint and Clone questions

PostWed Aug 14, 2019 2:56 pm

Hi,

1. Is there a way to paint a straight line with the Paint tool?

2. With a clone stroke, am I able to slide the image underneath the stroke?

3. Am I able to create a shape with the Paint tool and move the image inside the shape, similar to what I want to do in question #1?

Thanks in advance.
Offline
User avatar

Bryan Ray

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

Re: Paint and Clone questions

PostWed Aug 14, 2019 3:24 pm

Yes, yes, and yes, but I suspect that the Paint tool may not be what you actually want. Give this a look:

Code: Select all
{
   Tools = ordered() {
      MatteControl1 = MatteControl {
         Inputs = {
            ["Garbage.Matte"] = Input {
               SourceOp = "Polygon1",
               Source = "Mask",
            },
            ["Garbage.MaskNest"] = Input { Value = 1, },
            ["Garbage.MaskInverted"] = Input { Value = 1, },
            Background = Input {
               SourceOp = "FastNoise1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 148.5 } },
      },
      Polygon1 = 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 = "Polygon1Polyline",
               Source = "Value",
            },
            Polyline2 = Input {
               Value = Polyline {
               },
               Disabled = true,
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 82.5 } },
      },
      Polygon1Polyline = 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.0255474448204041, Y = 0.269480526447296, LX = 0.0541362514098485, LY = -0.113636367022991, RX = 0.102978150534953, RY = 0 },
                     { Linear = true, X = 0.33448189496994, Y = 0.269480526447296, LX = -0.102978150534953, LY = -0, RX = -0.0488418968634594, RY = -0.113636365958623 },
                     { Linear = true, X = 0.18795619904995, Y = -0.0714285746216774, LX = 0.0488418968634594, LY = 0.113636365958623, RX = -0.0541362514098485, RY = 0.113636367022991 }
                  }
               } }
         }
      },
      Transform1 = Transform {
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Value = { 0.226277372262774, 0.301948051948052 }, },
            Input = Input {
               SourceOp = "MatteControl1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 214.5 } },
      },
      Note1 = Note {
         Inputs = {
            Comments = Input { Value = "Draw the Polygon around the feature you wish to clone.\n\nInvert the Garbage Matte to cut out the patch.\n\nTransform to move it to the desired location. \n\nTrackers can be used to move the Polygon and/or the patch itself. \n\nA TimeStretcher with no animation can be used to freeze the patch. Put it between the MatteControl and the Transform.", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 715, 82.5 },
            Flags = {
               Expanded = true
            },
            Size = { 196, 269.3 }
         },
      },
      FastNoise1 = FastNoise {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 275, 280.5 } },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "FastNoise1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Transform1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 280.5 } },
      }
   }
}



Now, to answer the questions:

1) The Paint tool has a Polyline Stroke mode. You can use this to substitute a Bezier shape for an actual paint stroke. You get some additional benefits by doing so, such as write-on/write-off and the ability to modify the size and softness of the stroke after the fact. Unfortunately, in this mode you can't set the Offset by clicking in the Viewer, so you need to use the Offset point control in the Panel. This is one of the only places where I like the ability to scrub a number in the control panel with v16. In v9 you have to type numbers in here by hand, or customize the control to have a Viewport widget.

2) To move an image underneath the Clone stroke, regardless of the mode it's in, you can use the Source Tool field to feed it an image other than the one that goes into the main Input. Pull a branch from your source image to a Transform, and drop that Xf into the Source Tool field. Now the cloned pixels will come from the output of the Transform, which you can animate.

3) The Paint tool doesn't create solid shapes, as far as I know—it only does strokes. However, the technique illustrated in the nodes I shared should do what you need.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

Todd Groves

  • Posts: 453
  • Joined: Fri Sep 15, 2017 1:24 am

Re: Paint and Clone questions

PostWed Aug 14, 2019 4:38 pm

Thanks, Bryan!

Just to make sure I understand:

1. The "Offset point control" in the Paint tool will allow me to move the image around the inside of the stroke?

2. So, both #1 and #2 give me control over the image inside the clone area?
Offline

Todd Groves

  • Posts: 453
  • Joined: Fri Sep 15, 2017 1:24 am

Re: Paint and Clone questions

PostWed Aug 14, 2019 4:42 pm

I'm not able to copy/paste your code into Fusion.
Offline
User avatar

Bryan Ray

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

Re: Paint and Clone questions

PostThu Aug 15, 2019 12:55 am

That's odd. It works perfectly for me. It's just a FastNoise, Polygon, MatteControl, Transform, Merge and a Note. Make sure you didn't miss either of the curly braces at beginning and end.

But here's a screen-cap:

Untitled.jpg
Untitled.jpg (70.22 KiB) Viewed 135 times


The Offset Point control is what you're setting when you alt-click in normal Clone mode. I've never tried to use it that way, but yes, that should be how it would work if you were to animate it. I think using a Transform (procedure 2) would be easier since you get a widget in the Viewer.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

Hendrik Proosa

  • Posts: 648
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Paint and Clone questions

PostThu Aug 15, 2019 5:28 am

I haven't tried cloning in Fu much, do I understand correctly that if I want to have, lets say 20 clone strokes that are all offset by different value and possibly that offset is animated too, I'd have to construct a graph where this structure is multiplied 20 times?
I do stuff.
Offline
User avatar

Bryan Ray

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

Re: Paint and Clone questions

PostThu Aug 15, 2019 3:04 pm

Normally when doing a clone paint, you'd be in the Multistroke Clone mode, in which each paint stroke keeps track of its own offset, so you can reset frequently without disrupting previously-made strokes. By default, these strokes only live for one frame. The duration can be increased (prior to making your first stroke), but in multistroke mode you can't animate the offset—it's a permanent quality of each paint stroke. You can still use the Source Tool and Transform method to slide the clone source around underneath the strokes, but I can't imagine it would be easy to manage.

In Stroke mode, each individual paint stroke gets its own control panel, so you can animate the offset, or even the width and softness of the stroke. These individual strokes appear in the Modifiers tab of the Paint tool (as do the multistroke and polyline stroke controls)—they don't live as separate nodes in the Flow view.

What's described in the screenshot is a different type of workflow than what you'd typically apply the Paint tool to. It's usually best for something like a window replacement, for example, where you'd cut out a window from one part of a building and move it over the one you want to conceal.

I've certainly had complex clean plate jobs where I used a structure like that twenty or thirty times, or more. Although usually there would also be a Grid Warp, a little regrain, and some sharpening to go with it.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

Hendrik Proosa

  • Posts: 648
  • Joined: Wed Aug 22, 2012 6:53 am
  • Location: Estonia

Re: Paint and Clone questions

PostFri Aug 16, 2019 9:47 am

For elaborate stroke based paint jobs, Stroke mode would be the only way to go I understand?

My usual workflow in not-Fusion is to simplify each stroke after placement, set opacity, width, softness etc and also manually animate them, both stroke position and clone offset if necessary, and I don't think fixing either lifetime, position or offset beforehand would allow the detailed work sometimes needed. For example in makeup repair where all the surfaces are moving, lighting conditions change etc.
I do stuff.
Offline
User avatar

Bryan Ray

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

Re: Paint and Clone questions

PostFri Aug 16, 2019 4:57 pm

If that's what works for you generally, then yeah, it should absolutely be what you do. Just don't get too strongly attached to any particular technique—more arrows in the quiver is usually a good thing. Eventually you're going to run into that situation where the approach that's never worked previously is exactly what you need.
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 8 guests