Paint PolylineStroke Banking


#1

Hi Guys and Girls,

I want to make some arrows follow a polylinestroke in fusion.

In fact, i use an arrow shape as an “image source” for the “brush shape” but i need the arrows to follow the line direction.

There is a way do to this. I think with an expression or a script. Maybe there is a parameter i didn’t see in the paint tool to do this.
I use some expressions in fusion but i don’t know how to access the rotation of the brush elements.

Thank you very much for your help.

Here is the comp :


{
   Tools = ordered() {
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background3",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Paint1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 247.5, }, },
      },
      Background3 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            TopLeftRed = Input { Value = 0.96, },
            TopLeftGreen = Input { Value = 0.96, },
            TopLeftBlue = Input { Value = 0.96, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 247.5, }, },
      },
      Paint1 = Paint {
         CtrlWZoom = false,
         Inputs = {
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Paint = Input {
               SourceOp = "PolylineStroke1",
               Source = "Out",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 181.5, }, },
      },
      PolylineStroke1 = PolylineStroke {
         Points = {
         },
         IsThreaded = false,
         Brushes = {
            "SoftBrush",
            "CircleBrush",
            "ImageBrush",
         },
         ApplyModes = { "PaintApplyColor", },
         CtrlWZoom = false,
         Inputs = {
            BrushControls = Input { Value = 1, },
            BrushShape = Input { Value = FuID { "ImageBrush", }, },
            ["PaintApplyColor.Red"] = Input { Value = 0, },
            ["PaintApplyColor.Green"] = Input { Value = 0, },
            ["PaintApplyColor.Blue"] = Input { Value = 0, },
            StrokeControls = Input { Value = 1, },
            Spacing = Input { Value = 1, },
            Polyline = Input {
               Value = Polyline {
                  Points = {
                     { Linear = true, X = -0.363519310951233, Y = -0.356488555669785, RX = 0.0390150604196598, RY = 0.164741403886695, },
                     { X = -0.15150215976228, Y = -0.138167940000541, LX = -0.114097704843819, LY = 0.000733632606461102, RX = 0.11474352093769, RY = -0.000737785115444501, },
                     { X = 0.192703874300478, Y = -0.130534348449179, LX = -0.0379745266781271, LY = -0.011289853957621, RX = 0.122707689649409, RY = 0.0364810839477024, },
                     { X = 0.30257511138916, Y = 0.303053438663483, LX = 0.00420041006879574, LY = -0.17442555803343, },
                  },
               },
            },
            ["ImageBrush.Size"] = Input { Value = 0.03, },
            ["ImageBrush.ImageSource"] = Input { Value = 0, },
            ["ImageBrush.SourceTool"] = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            ["ImageBrush.Brush"] = Input { UserString1 = "ball_metal", },
         },
      },
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            TopLeftAlpha = Input { Value = 0, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 115.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 = { 440, 49.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.417313437461853, Y = 0.115970151722431, LX = 0.151940298477809, LY = -0.000995025038719177, RX = -0.00169153650601706, RY = -0.089751245478789, },
                     { Linear = true, X = -0.422388046979904, Y = -0.153283584713936, LX = 0.00169153650601706, LY = 0.089751245478789, RX = 0.151641784906387, RY = 0.000995025038719177, },
                     { Linear = true, X = 0.0325373077392578, Y = -0.150298509597778, LX = -0.151641784906387, LY = -0.000995025038719177, RX = 0.00199005007743835, RY = -0.0590049759546916, },
                     { Linear = true, X = 0.0385074579715729, Y = -0.327313437461853, LX = -0.00199005007743835, LY = 0.0590049759546916, RX = 0.133184080521266, RY = 0.105373136252165, },
                     { Linear = true, X = 0.43805969953537, Y = -0.0111940287053585, LX = -0.133184080521266, LY = -0.105373136252165, RX = -0.134179105559985, RY = 0.101393033613761, },
                     { Linear = true, X = 0.0355223828554153, Y = 0.292985072135925, LX = 0.134179105559985, LY = -0.101393033613761, RX = 0.000995025038719177, RY = -0.0599999985098839, },
                     { Linear = true, X = 0.0385074579715729, Y = 0.112985076606274, LX = -0.000995025038719177, LY = 0.0599999985098839, RX = -0.151940298477809, RY = 0.000995025038719177, },
                  },
               }, },
         },
      },
      Background2 = Background {
         Inputs = {
            Width = Input { Value = 100, },
            Height = Input { Value = 100, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
            EffectMask = Input {
               SourceOp = "Polygon1",
               Source = "Mask",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 49.5, }, },
      },
   },
}