Jump to: Board index » General » Fusion

Animated dash outline for a ellipse or rectangle mask

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

KrunoSmithy

  • Posts: 4601
  • Joined: Fri Oct 20, 2023 11:01 pm
  • Real Name: Kruno Stifter

Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 7:44 pm

I was looking for a way to make dash animated outline for a ellipse or rectangle mask in Fusion. I came up with a way to easily create one dash in a line and animate it by unchecking "solid" option, increasing border with, reducing length and animating position to be one whole circle and than setting that animation to loop in the spline editor. Of course mask is connected to background node for color.

sshot-12.jpg
sshot-12.jpg (209.46 KiB) Viewed 1148 times


But making the dash line was more tricky. I tried duplicate node and works well, but problem was angle or heading for duplicated dashes. They don't follow the path with correct angle. I finally figure out that I can add a path modifier and get the heading information for the duplicate node. That worked.

I was wondering, I was looking for a way to make dash animated outline for a ellipse or rectangle mask in Fusion. Perhaps something more efficient. How do you do it, or how would you do it? Any expression that can do this with less clicks that you know of?

Here is the code for the set up if you are interested.

Code: Select all
{
   Tools = ordered() {
      Ellipse1 = EllipseMask {
         Inputs = {
            Quality = Input { Value = 10, },
            Filter = Input { Value = FuID { "Fast Gaussian" }, },
            BorderWidth = Input { Value = 0.0106, },
            Solid = Input { Value = 0, },
            CapStyle = Input { Value = 0, },
            WritePosition = Input {
               SourceOp = "Ellipse1Position",
               Source = "Value",
            },
            WriteLength = Input { Value = 0.036, },
            MaskWidth = Input { Value = 1920, },
            MaskHeight = Input { Value = 1080, },
            PixelAspect = Input { Value = { 1, 1 }, },
            UseFrameFormatSettings = Input { Value = 1, },
            Angle = Input {
               SourceOp = "Path1",
               Source = "Heading",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -387.85, 55.8841 } },
      },
      Ellipse1Position = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 6 },
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 0.333333333333333 }, Flags = { Loop = true } },
            [50] = { 1, LH = { 33.3333333333333, 0.666666666666667 }, Flags = { Linear = true, Loop = true } }
         }
      },
      Path1 = PolyPath {
         DrawMode = "InsertAndModify",
         CtrlWZoom = false,
         Inputs = {
            Displacement = Input {
               SourceOp = "Path1Displacement",
               Source = "Value",
            },
            PolyLine = Input {
               Value = Polyline {
                  Points = {
                     { Linear = true, X = 0, Y = 0 }
                  }
               },
            },
         },
      },
      Path1Displacement = BezierSpline {
         SplineColor = { Red = 255, Green = 0, Blue = 255 },
         KeyFrames = {
            [402] = { 0 }
         }
      },
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            EffectMask = Input {
               SourceOp = "Duplicate1",
               Source = "Output",
            },
            GlobalOut = Input { Value = 479, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            UseFrameFormatSettings = Input { Value = 1, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { -258.328, 91.5682 } },
      },
      Duplicate1 = Fuse.Duplicate {
         Inputs = {
            Copies = Input { Value = 10, },
            TimeOffset = Input { Value = 5, },
            Angle = Input {
               SourceOp = "Path1",
               Source = "Heading",
            },
            Background = Input {
               SourceOp = "Ellipse1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { -387.85, 91.5682 } },
      }
   }
}
Offline

Sander de Regt

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

Re: Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 8:05 pm

The good old Text+ tool comes to mind :-)

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutType = Input { Value = 3, },
            Center = Input { Value = { 0.619791666666667, 0.451851851851852 }, },
            PositionOnPath = Input {
               SourceOp = "Text1Positiononpath",
               Source = "Value",
            },
            LayoutRotation = Input { Value = 1, },
            CharacterSpacing = Input { Value = 1.291, },
            TransformRotation = Input { Value = 1, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "------------------------", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            Size = Input { Value = 0.1364, },
            VerticalTopCenterBottom = Input { Value = 0.207, },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
            Path = Input {
               SourceOp = "Text1Path",
               Source = "Value",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 165, 16.5 } },
      },
      Text1Positiononpath = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 220 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0.166666666666667 }, Flags = { Linear = true } },
            [100] = { 0.5, LH = { 66.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      Text1Path = BezierSpline {
         SplineColor = { Red = 186, Green = 244, Blue = 89 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { X = -0.3515625, Y = 0.0537037037037038, LX = 1.69088437774545e-17, LY = 0.245459888813686, RX = -1.69088437774545e-17, RY = -0.245459888813686 },
                     { X = -0.1015625, Y = -0.390740740740741, LX = -0.138071187457698, LY = 4.50902500732119e-17, RX = 0.138071187457698, RY = -4.50902500732119e-17 },
                     { X = 0.1484375, Y = 0.0537037037037036, LX = -3.38176875549089e-17, LY = -0.245459888813686, RX = 3.38176875549089e-17, RY = 0.245459888813686 },
                     { X = -0.1015625, Y = 0.498148148148148, LX = 0.138071187457698, LY = -7.51504167886864e-17, RX = -0.138071187457698, RY = 7.51504167886864e-17 }
                  }
               } }
         }
      }
   }
}
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Sander de Regt

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

Re: Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 8:07 pm

With a couple of shading tricks:

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutType = Input { Value = 3, },
            Center = Input { Value = { 0.619791666666667, 0.451851851851852 }, },
            PositionOnPath = Input {
               SourceOp = "Text1Positiononpath",
               Source = "Value",
            },
            LayoutRotation = Input { Value = 1, },
            CharacterSpacing = Input { Value = 1.291, },
            TransformRotation = Input { Value = 1, },
            Thickness1 = Input { Value = 0.1, },
            Type1 = Input { Value = 2, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 0, 0, 1 },
                     [0.318407960199005] = { 1, 1, 1, 1 },
                     [0.45273631840796] = { 0, 0.567, 0.945, 1 }
                  }
               },
            },
            ShadingMappingSize1 = Input { Value = 0.176, },
            ShadingMappingAspect1 = Input { Value = 2.693, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "------------------------", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            Size = Input { Value = 0.1364, },
            VerticalTopCenterBottom = Input { Value = 0.207, },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
            Path = Input {
               SourceOp = "Text1Path",
               Source = "Value",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 165, 16.5 } },
      },
      Text1Positiononpath = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 220 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0.166666666666667 }, Flags = { Linear = true } },
            [100] = { 0.5, LH = { 66.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      Text1Path = BezierSpline {
         SplineColor = { Red = 186, Green = 244, Blue = 89 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { X = -0.3515625, Y = 0.0537037037037038, LX = 1.69088437774545e-17, LY = 0.245459888813686, RX = -1.69088437774545e-17, RY = -0.245459888813686 },
                     { X = -0.1015625, Y = -0.390740740740741, LX = -0.138071187457698, LY = 4.50902500732119e-17, RX = 0.138071187457698, RY = -4.50902500732119e-17 },
                     { X = 0.1484375, Y = 0.0537037037037036, LX = -3.38176875549089e-17, LY = -0.245459888813686, RX = 3.38176875549089e-17, RY = 0.245459888813686 },
                     { X = -0.1015625, Y = 0.498148148148148, LX = 0.138071187457698, LY = -7.51504167886864e-17, RX = -0.138071187457698, RY = 7.51504167886864e-17 }
                  }
               } }
         }
      },
      Text1_1 = TextPlus {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutType = Input { Value = 3, },
            Center = Input { Value = { 0.619791666666667, 0.451851851851852 }, },
            PositionOnPath = Input {
               SourceOp = "Text1_1Positiononpath",
               Source = "Value",
            },
            LayoutRotation = Input { Value = 1, },
            Path = Input {
               SourceOp = "Text1_1Path",
               Source = "Value",
            },
            CharacterSpacing = Input { Value = 1.291, },
            TransformRotation = Input { Value = 1, },
            ElementShape1 = Input { Value = 1, },
            Thickness1 = Input { Value = 0.1, },
            Type1 = Input { Value = 2, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 0, 0, 1 },
                     [0.318407960199005] = { 1, 1, 1, 1 },
                     [0.45273631840796] = { 0, 0.567, 0.945, 1 }
                  }
               },
            },
            ShadingMappingSize1 = Input { Value = 0.176, },
            ShadingMappingAspect1 = Input { Value = 2.693, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "------------------------", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            Size = Input { Value = 0.1364, },
            VerticalTopCenterBottom = Input { Value = 0.207, },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, }
         },
         ViewInfo = OperatorInfo { Pos = { 165, 49.5 } },
      },
      Text1_1Positiononpath = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 220 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0.166666666666667 }, Flags = { Linear = true } },
            [100] = { 0.5, LH = { 66.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      Text1_1Path = BezierSpline {
         SplineColor = { Red = 186, Green = 244, Blue = 89 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { X = -0.3515625, Y = 0.0537037037037038, LX = 1.69088437774545e-17, LY = 0.245459888813686, RX = -1.69088437774545e-17, RY = -0.245459888813686 },
                     { X = -0.1015625, Y = -0.390740740740741, LX = -0.138071187457698, LY = 4.50902500732119e-17, RX = 0.138071187457698, RY = -4.50902500732119e-17 },
                     { X = 0.1484375, Y = 0.0537037037037036, LX = -3.38176875549089e-17, LY = -0.245459888813686, RX = 3.38176875549089e-17, RY = 0.245459888813686 },
                     { X = -0.1015625, Y = 0.498148148148148, LX = 0.138071187457698, LY = -7.51504167886864e-17, RX = -0.138071187457698, RY = 7.51504167886864e-17 }
                  }
               } }
         }
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1_1",
               Source = "Output",
            },
            Center = Input { Value = { 0.215625, 0.5 }, },
            PerformDepthMerge = Input { Value = 0, }
         },
         ViewInfo = OperatorInfo { Pos = { 275, 49.5 } },
      },
      Merge2 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1_2",
               Source = "Output",
            },
            Center = Input { Value = { 0.811458333333333, 0.5 }, },
            PerformDepthMerge = Input { Value = 0, }
         },
         ViewInfo = OperatorInfo { Pos = { 330, 82.5 } },
      },
      Text1_2 = TextPlus {
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutType = Input { Value = 3, },
            Center = Input { Value = { 0.619791666666667, 0.451851851851852 }, },
            PositionOnPath = Input {
               SourceOp = "Text1_2Positiononpath",
               Source = "Value",
            },
            LayoutRotation = Input { Value = 1, },
            Path = Input {
               SourceOp = "Text1_2Path",
               Source = "Value",
            },
            CharacterSpacing = Input { Value = 1.291, },
            TransformRotation = Input { Value = 1, },
            ElementShape1 = Input { Value = 2, },
            Thickness1 = Input { Value = 0.1, },
            Type1 = Input { Value = 2, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 0, 0, 1 },
                     [0.318407960199005] = { 1, 1, 1, 1 },
                     [0.45273631840796] = { 0, 0.567, 0.945, 1 }
                  }
               },
            },
            ShadingMappingSize1 = Input { Value = 0.176, },
            ShadingMappingAspect1 = Input { Value = 2.693, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "------------------------", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            Size = Input { Value = 0.1364, },
            VerticalTopCenterBottom = Input { Value = 0.207, },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, }
         },
         ViewInfo = OperatorInfo { Pos = { 165, 82.5 } },
      },
      Text1_2Positiononpath = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 220 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0.166666666666667 }, Flags = { Linear = true } },
            [100] = { 0.5, LH = { 66.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      Text1_2Path = BezierSpline {
         SplineColor = { Red = 186, Green = 244, Blue = 89 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { X = -0.3515625, Y = 0.0537037037037038, LX = 1.69088437774545e-17, LY = 0.245459888813686, RX = -1.69088437774545e-17, RY = -0.245459888813686 },
                     { X = -0.1015625, Y = -0.390740740740741, LX = -0.138071187457698, LY = 4.50902500732119e-17, RX = 0.138071187457698, RY = -4.50902500732119e-17 },
                     { X = 0.1484375, Y = 0.0537037037037036, LX = -3.38176875549089e-17, LY = -0.245459888813686, RX = 3.38176875549089e-17, RY = 0.245459888813686 },
                     { X = -0.1015625, Y = 0.498148148148148, LX = 0.138071187457698, LY = -7.51504167886864e-17, RX = -0.138071187457698, RY = 7.51504167886864e-17 }
                  }
               } }
         }
      },
      Text1_3 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 100, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutType = Input { Value = 3, },
            Center = Input { Value = { 0.619791666666667, 0.451851851851852 }, },
            PositionOnPath = Input {
               SourceOp = "Text1_3Positiononpath",
               Source = "Value",
            },
            LayoutRotation = Input { Value = 1, },
            Path = Input {
               SourceOp = "Text1_3Path",
               Source = "Value",
            },
            CharacterSpacing = Input { Value = 1.291, },
            TransformRotation = Input { Value = 1, },
            ElementShape1 = Input { Value = 3, },
            Thickness1 = Input { Value = 0.1, },
            Type1 = Input { Value = 2, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 1, 0, 0, 1 },
                     [0.318407960199005] = { 1, 1, 1, 1 },
                     [0.45273631840796] = { 0, 0.567, 0.945, 1 }
                  }
               },
            },
            ShadingMappingSize1 = Input { Value = 0.176, },
            ShadingMappingAspect1 = Input { Value = 2.693, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "------------------------", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            Size = Input { Value = 0.1364, },
            VerticalTopCenterBottom = Input { Value = 0.207, },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, }
         },
         ViewInfo = OperatorInfo { Pos = { 165, 115.5 } },
      },
      Text1_3Positiononpath = BezierSpline {
         SplineColor = { Red = 237, Green = 132, Blue = 220 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 33.3333333333333, 0.166666666666667 }, Flags = { Linear = true } },
            [100] = { 0.5, LH = { 66.6666666666667, 0.333333333333333 }, Flags = { Linear = true } }
         }
      },
      Text1_3Path = BezierSpline {
         SplineColor = { Red = 186, Green = 244, Blue = 89 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
                  Closed = true,
                  Points = {
                     { X = -0.3515625, Y = 0.0537037037037038, LX = 1.69088437774545e-17, LY = 0.245459888813686, RX = -1.69088437774545e-17, RY = -0.245459888813686 },
                     { X = -0.1015625, Y = -0.390740740740741, LX = -0.138071187457698, LY = 4.50902500732119e-17, RX = 0.138071187457698, RY = -4.50902500732119e-17 },
                     { X = 0.1484375, Y = 0.0537037037037036, LX = -3.38176875549089e-17, LY = -0.245459888813686, RX = 3.38176875549089e-17, RY = 0.245459888813686 },
                     { X = -0.1015625, Y = 0.498148148148148, LX = 0.138071187457698, LY = -7.51504167886864e-17, RX = -0.138071187457698, RY = 7.51504167886864e-17 }
                  }
               } }
         }
      },
      Merge3 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Merge2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1_3",
               Source = "Output",
            },
            Center = Input { Value = { 0.619791666666667, 0.5 }, },
            PerformDepthMerge = Input { Value = 0, }
         },
         ViewInfo = OperatorInfo { Pos = { 440, 115.5 } },
      }
   }
}
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline
User avatar

KrunoSmithy

  • Posts: 4601
  • Joined: Fri Oct 20, 2023 11:01 pm
  • Real Name: Kruno Stifter

Re: Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 8:08 pm

Sander de Regt wrote:The good old Text+ tool comes to mind :-)


Oh, that is awesome trick. Didn't think of that. Very cool. This one goes to my toolbox. Very nice. Thank you.
Offline

Sander de Regt

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

Re: Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 8:14 pm

And the cool thing is that if you switch to path in Text+ there is a right click option in the view that lets you create circles and rectangles with a requester, so they get really nice and tight.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline
User avatar

KrunoSmithy

  • Posts: 4601
  • Joined: Fri Oct 20, 2023 11:01 pm
  • Real Name: Kruno Stifter

Re: Animated dash outline for a ellipse or rectangle mask

PostWed Jul 03, 2024 8:16 pm

Sander de Regt wrote:And the cool thing is that if you switch to path in Text+ there is a right click option in the view that lets you create circles and rectangles with a requester, so they get really nice and tight.


For sure. once I realize how you done it, I could than do all kinds of things with the path, as well as you what you said, and also change from dashes to dots and everything. Really cool method. Thank you for sharing. Much better than my initial appraoch.
Offline

Christoph Schmid

  • Posts: 939
  • Joined: Thu Sep 26, 2019 10:15 am
  • Real Name: Christoph Schmid

Re: Animated dash outline for a ellipse or rectangle mask

PostFri Jul 04, 2025 5:13 pm

Thank you guys for this very interesting post.

Davinci Resolve Studio 20.0.1 Build 6
Windows 10 Pro 22H2
Davinci Resolve Studio 19.1.4 Build 11
Linux Ubuntu Studio 24.04 (Rocky 8.6 Container)

Return to Fusion

Who is online

Users browsing this forum: No registered users and 92 guests