Convert a polyline mask into a motion path or a polylinestroke

Moderator: SecondMan

gregausina
Posts: 4
Joined: Thu Jul 28, 2016 2:37 am

Convert a polyline mask into a motion path or a polylinestroke

#1

Post by gregausina » Fri Oct 11, 2019 10:05 am

Hi everyone,
I'm trying to use a polyline within a polygon node to animate a center parameter in a another transform node. My problem is that I can't find the way to convert or publish that polyline as a path that I could connect to.
I've searched the forum and there is a topic about the paint strokes that put me in the right direction. My workaround is to start a manual animation of the transform node as usual. That makes a path in the modifiers tab. Then I right clic the path polyline and import a shape previously exported as dfsh. And that works exactly as I wished.
The only control I'm missing is the point number order of the path polyline. Is it possible to alter the point numbers of the polyline within fusion? Or shall I do it in an external vector program?
Of course if someone has a faster solution than exporting and importing the shape it would be great!
Regards.

PS: Here the comp I ended up with
convert_polyline.comp
You do not have the required permissions to view the files attached to this post.

Tags:

User avatar
SirEdric
Fusionator
Posts: 1959
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 135 times
Contact:

Re: Convert a polyline mask into a motion path or a polylinestroke

#2

Post by SirEdric » Fri Oct 11, 2019 1:30 pm

So if I got you right you're using a PolylineMask and want to connect another tool's Center to that?
- RMB on the tool's Center and choose 'Path'
- Open the ModifierTab
- On the Path RMB where it says 'Right Click here for Shape Animation', select 'Connect To' [Your Polyline Mask]
- Animate the Displacement of the Path to match your desired animation length.

Cheers.

Eric.

User avatar
ShadowMaker SdR
Fusionista
Posts: 653
Joined: Sun Sep 21, 2014 6:17 am
Answers: 4
Been thanked: 17 times

Re: Convert a polyline mask into a motion path or a polylinestroke

#3

Post by ShadowMaker SdR » Fri Oct 11, 2019 2:50 pm

Hi Eric,

The method you describe doesn't appear to work in Fusion 16. I think I did what you suggested in this comp. Does it work for you?

EDIT: it's even weirder. When I created this in Fu 16 it didn't work, but cutting/pasting it back in the flow made it work. Very odd.

Code: Select all

{
	Tools = ordered() {
		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 },
			NameSet = true,
			KeyFrames = {
				[0] = { 0, Flags = { Linear = true, LockedY = true }, Value = Polyline {
						Closed = true,
						Points = {
							{ X = -0.280729162693024, Y = -0.15648148810422, LX = 0.0317456886124153, LY = -0.0395519402078841, RX = -0.0387965823957014, RY = 0.0483366458330634 },
							{ X = -0.347395837306976, Y = 0.0666666701436043, LX = -0.0317898928721114, LY = -0.0496945349835363, RX = 0.0841196149320675, RY = 0.131497302109833 },
							{ X = -0.0203124992549419, Y = 0.203703701496124, LX = -0.0739583325882752, LY = 0.0175925903850134, RX = 0.0706945700655036, RY = -0.0168162338181781 },
							{ X = 0.130729168653488, Y = -0.065740741789341, LX = 0.00416666865348813, LY = 0.0138888878402886, RX = -0.018935231428742, RY = -0.0631174032337666 },
							{ X = 0.0369791649281979, Y = -0.200925931334496, LX = 0.0359374982615311, LY = 0.0111111057025417, RX = -0.0679820750639599, RY = -0.0210186033656753 },
							{ X = -0.169791668653488, Y = -0.218518525362015, LX = 0.069394379258863, LY = -0.00171300466907803, RX = -0.0369791646798452, RY = 0.020679012419265 }
						}
					} }
			}
		},
		FastNoise1 = FastNoise {
			Inputs = {
				GlobalOut = Input { Value = 500, },
				Width = Input { Value = 1920, },
				Height = Input { Value = 1080, },
				["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
			},
			ViewInfo = OperatorInfo { Pos = { 220, 16.5 } },
		},
		BrightnessContrast1 = BrightnessContrast {
			Inputs = {
				Input = Input {
					SourceOp = "FastNoise1",
					Source = "Output",
				},
				EffectMask = Input {
					SourceOp = "Polygon1",
					Source = "Mask",
				}
			},
			ViewInfo = OperatorInfo { Pos = { 440, 16.5 } },
		},
		Transform1 = Transform {
			CtrlWZoom = false,
			Inputs = {
				Center = Input {
					SourceOp = "Path1",
					Source = "Position",
				},
				Input = Input {
					SourceOp = "BrightnessContrast1",
					Source = "Output",
				},
			},
			ViewInfo = OperatorInfo { Pos = { 550, 16.5 } },
		},
		Path1 = PolyPath {
			DrawMode = "InsertAndModify",
			CtrlWZoom = false,
			Inputs = {
				Displacement = Input {
					SourceOp = "Path1Displacement",
					Source = "Value",
				},
				PolyLine = Input {
					SourceOp = "Polygon1Polyline",
					Source = "Value",
				},
			},
		},
		Path1Displacement = BezierSpline {
			SplineColor = { Red = 255, Green = 0, Blue = 255 },
			NameSet = true,
			KeyFrames = {
				[0] = { 0, RH = { 166.666666666667, 0.333333333333333 }, Flags = { Linear = true, LockedY = true } },
				[500] = { 1, LH = { 333.333333333333, 0.666666666666667 }, Flags = { Linear = true } }
			}
		}
	}
}

User avatar
Movalex
Fusioneer
Posts: 125
Joined: Fri Nov 03, 2017 5:36 am
Answers: 2
Been thanked: 32 times
Contact:

Re: Convert a polyline mask into a motion path or a polylinestroke

#4

Post by Movalex » Fri Oct 11, 2019 3:36 pm

Hi, @ShadowMaker SdR!
Looks like your Center displacement animation had a key instead of DIsplacement key (with a lock icon on it) at the end. I believe Fusion have a hard time handling Center animation without displacement key at the end.
This version works in Fu16.1:
  1. {
  2.     Tools = ordered() {
  3.         Transform1 = Transform {
  4.             Inputs = {
  5.                 Center = Input {
  6.                     SourceOp = "Path1",
  7.                     Source = "Position",
  8.                 },
  9.                 Input = Input {
  10.                     SourceOp = "BrightnessContrast1",
  11.                     Source = "Output",
  12.                 },
  13.             },
  14.             ViewInfo = OperatorInfo { Pos = { 588, 135.515 } },
  15.         },
  16.         Path1 = PolyPath {
  17.             DrawMode = "InsertAndModify",
  18.             CtrlWZoom = false,
  19.             Inputs = {
  20.                 Displacement = Input {
  21.                     SourceOp = "Path1Displacement",
  22.                     Source = "Value",
  23.                 },
  24.                 PolyLine = Input {
  25.                     SourceOp = "Polygon1Polyline",
  26.                     Source = "Value",
  27.                 },
  28.             },
  29.         },
  30.         Path1Displacement = BezierSpline {
  31.             SplineColor = { Red = 255, Green = 0, Blue = 255 },
  32.             NameSet = true,
  33.             KeyFrames = {
  34.                 [0] = { 0, RH = { 166.666666666667, 0.322743802603592 }, Flags = { Linear = true, LockedY = true } },
  35.                 [500] = { 0.892367357268848, LH = { 333.333333333333, 0.726944487061341 }, RH = { 548.333333333333, 0.951626628586799 }, Flags = { LockedY = true } },
  36.                 [645] = { 0.986080129179901, LH = { 596.666666666667, 0.986080129179903 }, Flags = { LockedY = true } }
  37.             }
  38.         },
  39.         Polygon1Polyline = BezierSpline {
  40.             SplineColor = { Red = 173, Green = 255, Blue = 47 },
  41.             NameSet = true,
  42.             KeyFrames = {
  43.                 [0] = { 0, RH = { 166.666666666667, 0.333333333333333 }, Flags = { Linear = true, LockedY = true }, Value = Polyline {
  44.                         Closed = true,
  45.                         Points = {
  46.                             { LockY = true, X = -0.280729162693024, Y = -0.15648148810422, LX = 0.0317456886124153, LY = -0.0395519402078841, RX = -0.0387965823957014, RY = 0.0483366458330634 },
  47.                             { X = -0.347395837306976, Y = 0.0666666701436043, LX = -0.0317898928721114, LY = -0.0496945349835363, RX = 0.0841196149320675, RY = 0.131497302109833 },
  48.                             { X = -0.0203124992549419, Y = 0.203703701496124, LX = -0.0739583325882752, LY = 0.0175925903850134, RX = 0.0706945700655036, RY = -0.0168162338181781 },
  49.                             { X = 0.130729168653488, Y = -0.065740741789341, LX = 0.00416666865348813, LY = 0.0138888878402886, RX = -0.018935231428742, RY = -0.0631174032337666 },
  50.                             { X = 0.0369791649281979, Y = -0.200925931334496, LX = 0.0359374982615311, LY = 0.0111111057025417, RX = -0.0223744334462387, RY = -0.00691769619705983 },
  51.                             { LockY = true, X = -0.0305527336895466, Y = -0.215102449059486, LX = 0.0226300486066475, LY = 0.00280345058696196, RX = -0.0461286856358711, RY = -0.00571450873382154 },
  52.                             { LockY = true, X = -0.169791668653488, Y = -0.218518525362015, LX = 0.0465551246640351, LY = -0.00114921621564641, RX = -0.0369791646798452, RY = 0.020679012419265 }
  53.                         }
  54.                     } },
  55.                 [500] = { 1, LH = { 333.333333333333, 0.666666666666667 }, RH = { 548.333333333333, 1.33333333333333 }, Flags = { Linear = true, LockedY = true }, Value = Polyline {
  56.                         Closed = true,
  57.                         Points = {
  58.                             { LockY = true, X = -0.163150378035796, Y = -0.302972846891801, LX = 0.00713662767255848, LY = -0.00889152144208247, RX = -0.0761217909973883, RY = 0.0948401076695589 },
  59.                             { X = -0.347395837306976, Y = 0.0666666701436043, LX = -0.062374143071642, LY = -0.097504387555237, RX = 0.0841196149320675, RY = 0.131497302109833 },
  60.                             { X = -0.0203124992549419, Y = 0.203703701496124, LX = -0.0739583325882752, LY = 0.0175925903850134, RX = 0.0706945700655036, RY = -0.0168162338181781 },
  61.                             { X = 0.130729168653488, Y = -0.065740741789341, LX = 0.00416666865348813, LY = 0.0138888878402886, RX = -0.018935231428742, RY = -0.0631174032337666 },
  62.                             { X = 0.0369791649281979, Y = -0.200925931334496, LX = 0.0359374982615311, LY = 0.0111111057025417, RX = -0.0204942827201744, RY = -0.00633639381195829 },
  63.                             { LockY = true, X = -0.0217799059952705, Y = -0.239705964609056, LX = 0.0184515691474488, LY = 0.0178109879448085, RX = -0.0378512297569232, RY = -0.0365371514824022 },
  64.                             { LockY = true, X = -0.138210941391249, Y = -0.316919157593166, LX = 0.0429150207766939, LY = -0.00105936001948849, RX = -0.00831314554818225, RY = 0.00464877023378826 }
  65.                         }
  66.                     } },
  67.                 [645] = { 2, LH = { 596.666666666667, 1.66666666666667 }, Flags = { Linear = true, LockedY = true }, Value = Polyline {
  68.                         Closed = true,
  69.                         Points = {
  70.                             { LockY = true, X = -0.1290525304852, Y = -0.3454553409402, LX = 0, LY = -0, RX = -0.0869461014918775, RY = 0.108326111602143 },
  71.                             { X = -0.347395837306976, Y = 0.0666666701436043, LX = -0.0712435756295059, LY = -0.11136924480103, RX = 0.0841196149320675, RY = 0.131497302109833 },
  72.                             { X = -0.0203124992549419, Y = 0.203703701496124, LX = -0.0739583325882752, LY = 0.0175925903850134, RX = 0.0706945700655036, RY = -0.0168162338181781 },
  73.                             { X = 0.130729168653488, Y = -0.065740741789341, LX = 0.00416666865348813, LY = 0.0138888878402886, RX = -0.018935231428742, RY = -0.0631174032337666 },
  74.                             { X = 0.0369791649281979, Y = -0.200925931334496, LX = 0.0359374982615311, LY = 0.0111111057025417, RX = -0.0204942352493773, RY = -0.0063363791350033 },
  75.                             { LockY = true, X = -0.0199581738561392, Y = -0.247911766171455, LX = 0.0179249408647883, LY = 0.0219428497674527, RX = -0.0351672296335942, RY = -0.0430500284766191 },
  76.                             { LockY = true, X = -0.1290525304852, Y = -0.3454553409402, LX = 0.041043273468756, LY = -0.00101315581805208, RX = -0, RY = 0 }
  77.                         }
  78.                     } }
  79.             }
  80.         },
  81.         BrightnessContrast1 = BrightnessContrast {
  82.             Inputs = {
  83.                 EffectMask = Input {
  84.                     SourceOp = "Polygon1",
  85.                     Source = "Mask",
  86.                 },
  87.                 Input = Input {
  88.                     SourceOp = "FastNoise1",
  89.                     Source = "Output",
  90.                 },
  91.             },
  92.             ViewInfo = OperatorInfo { Pos = { 350.667, 135.515 } },
  93.         },
  94.         Polygon1 = PolylineMask {
  95.             DrawMode = "InsertAndModify",
  96.             DrawMode2 = "InsertAndModify",
  97.             Inputs = {
  98.                 Filter = Input { Value = FuID { "Fast Gaussian" }, },
  99.                 MaskWidth = Input { Value = 1920, },
  100.                 MaskHeight = Input { Value = 1080, },
  101.                 PixelAspect = Input { Value = { 1, 1 }, },
  102.                 ClippingMode = Input { Value = FuID { "None" }, },
  103.                 Polyline = Input {
  104.                     SourceOp = "Polygon1Polyline",
  105.                     Source = "Value",
  106.                 },
  107.                 Polyline2 = Input {
  108.                     Value = Polyline {
  109.                     },
  110.                     Disabled = true,
  111.                 },
  112.             },
  113.             ViewInfo = OperatorInfo { Pos = { 350.667, 74.0303 } },
  114.         },
  115.         FastNoise1 = FastNoise {
  116.             Inputs = {
  117.                 Width = Input { Value = 1920, },
  118.                 Height = Input { Value = 1080, },
  119.                 ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  120.             },
  121.             ViewInfo = OperatorInfo { Pos = { 130.667, 135.515 } },
  122.         }
  123.     }
  124. }

gregausina
Posts: 4
Joined: Thu Jul 28, 2016 2:37 am

Re: Convert a polyline mask into a motion path or a polylinestroke

#5

Post by gregausina » Tue Oct 15, 2019 2:01 am

Thanks @SirEdric,
I have two problems with your method:
-first: the polygon I wanted to use was imported from a dfsh file and Fu16.1 doesn't seem to recognise it as a polyline. I'm not allowed to connect the path to the polyline. It works in Fu9 though. And if I copy/paste the polygon node with the imported dfsh from Fu9 to Fu16.1 it works in Fu16.1 too.
-second: when I manage to connect the path to a polyline, the displacement map animation is kind of corrupted. It is as if only the first displacement keyframe was really associated with the path. As @Movalex pointed out the other keys are "standard" keys. And that is true in both Fu16.1 and Fu9. Maybe I'm missing something fundamental here. I've played around with the spline editor and when I delete all the displacement keys (including the locked one) I am then able to animate like I want.
Have a great day!