Jump to: Board index » General » Fusion

TimeStretcher/ Timespeed node - useful modification.

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

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

TimeStretcher/ Timespeed node - useful modification.

PostFri Nov 11, 2022 8:15 am

I wonder could someone give some advice on how to add a switchable extra input to a TimeStretcher/ Timespeed node. The idea would be to switch inputs between an OpticalFlow node and no OpticalFlow node input. That way the OpticalFlow node would only process the frames of a clip that required optical flow. For example if you had a 2000 frame clip and were using full speed on most of a clip but needed half speed for just say 100 frames you wouldn't want to waste time letting the OpticalFlow node process all 2000 frames. This would save hours of time on longer clips. Can an extra input be added to a node?
Offline
User avatar

Bryan Ray

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

Re: TimeStretcher/ Timespeed node - useful modification.

PostFri Nov 11, 2022 5:11 pm

You can add another ImageControl to a node, but you can't do it directly with the Edit Controls dialog, unfortunately. What I usually do is add any arbitrary control, just to create the table on the tool, then copy it into my editor and modify it, like so:

Code: Select all
{
   Tools = ordered() {
      TimeStretcher2_2 = TimeStretcher {
         CtrlWZoom = false,
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher2_2SourceTime",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 4785, -214.5 } },
         UserControls = ordered() {
            AltImage = {
               INP_Integer = false,
               LINK_Main = 2,
               LINKID_DataType = "Image",
               ICS_ControlPage = "Controls",
               INPID_InputControl = "ImageControl",
               LINKS_Name = "AltImage",
            }
         }
      },
      TimeStretcher2_2SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [1001] = { 0, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "TimeStretcher2_2"
}


The LINK_Main tag determines the priority and color of the additional input. 1 will be the yellow main input, and 2 is green. I forget the order that colors appear after that. The blue mask input will only appear if you name the control MaskInput.

If you omit the INPID_InputControl tag, you'll get only the flow input arrow and not the text field image input.

All of that said, I don't think there's a way to switch to the other input. I'd say what you really want in this case is a macro that has a Dissolve tool inside with an expression linked to the Interpolation mode of the TimeStretcher/TimeSpeed.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

Re: TimeStretcher/ Timespeed node - useful modification.

PostSat Nov 12, 2022 9:47 am

It's maybe an oversight that the TimeStretcher doesn't have duel switchable inputs, the time that could be saved is immense. The speed in the TimeSpeed can also be changed by keyframing different delays over time, so it would also benefit and maybe other nodes that use Optical Flow could also benefit.
Yes, modified node really needs to have keyable switchable inputs linked to the Mode controls. It's not a big deal I suppose, as it's only two extra nodes to do it the other way.
I should really have posted the other flow or this thread doesn't make much sense.
Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 114.001, 23.1212 } },
      },
      Background2 = Background {
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 110.667, 57.0606 } },
      },
      Merge1 = Merge {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            },
            Background = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 227.334, 57.0605 } },
      },
      Rectangle1 = RectangleMask {
         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" }, },
            Width = Input { Value = 0.304812834224599, },
            Height = Input { Value = 0.0439429928741093, },
            Angle = Input {
               SourceOp = "Rectangle1Angle",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 227.334, 88.576 } },
      },
      Rectangle1Angle = BezierSpline {
         SplineColor = { Red = 14, Green = 221, Blue = 144 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 50, 240 }, Flags = { Linear = true } },
            [150] = { 720, LH = { 100, 480 }, Flags = { Linear = true } }
         }
      },
      OpticalFlow1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 348.667, 27.3636 } },
      },
      TimeStretcher1 = TimeStretcher {
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input { Value = 2, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "OpticalFlow1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 464.667, 27.3636 } },
      },
      TimeStretcher1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 25, 25 }, Flags = { Linear = true } },
            [75] = { 75, LH = { 50, 50 }, RH = { 90, 80 }, Flags = { Linear = true } },
            [120] = { 90, LH = { 105, 85 }, RH = { 130, 100 }, Flags = { Linear = true } },
            [150] = { 120, LH = { 140, 110 }, Flags = { Linear = true } }
         }
      },
      Instance_TimeStretcher1 = TimeStretcher {
         SourceOp = "TimeStretcher1",
         Inputs = {
            SettingsNest = Input { },
            InterpolateBetweenFrames = Input { Value = 0, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            ["EnableWarp.Nest"] = Input { },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
         },
         ViewInfo = OperatorInfo { Pos = { 466, 56.4545 } },
      },
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Mix = Input {
               SourceOp = "Dissolve1BackgroundForeground",
               Source = "Value",
            },
            Background = Input {
               SourceOp = "Instance_TimeStretcher1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "TimeStretcher1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 574, 57.0606 } },
      },
      Dissolve1BackgroundForeground = BezierSpline {
         SplineColor = { Red = 16, Green = 164, Blue = 235 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 24.6666666666667, 0 }, Flags = { Linear = true } },
            [74] = { 0, LH = { 49.3333333333333, 0 }, RH = { 74.3333333333333, 0.333333333333333 }, Flags = { Linear = true } },
            [75] = { 1, LH = { 74.6666666666667, 0.666666666666667 }, RH = { 89.6666666666667, 1 }, Flags = { Linear = true } },
            [119] = { 1, LH = { 104.333333333333, 1 }, RH = { 119.333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [120] = { 0, LH = { 119.666666666667, 0.333333333333333 }, RH = { 130, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 140, 0 }, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "Dissolve1"
}
Offline

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

Re: TimeStretcher/ Timespeed node - useful modification.

PostMon Nov 14, 2022 9:32 am

Macros are something I haven't paid much attention to, as my inclination is to keep things as close to standard as possible while I feel my way around. How would I interogate, if that's the correct way of thinking, the mode setting of the TimeStretcher in this case. One example might get me into exploring this sort of thing for a while today.
Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 127.334, 10.9999 } },
      },
      Background2 = Background {
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 128.667, 55.2424 } },
      },
      Merge1 = Merge {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            },
            Background = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 245.334, 55.2423 } },
      },
      Rectangle1 = RectangleMask {
         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" }, },
            Width = Input { Value = 0.304812834224599, },
            Height = Input { Value = 0.0439429928741093, },
            Angle = Input {
               SourceOp = "Rectangle1Angle",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 245.334, 86.7578 } },
      },
      Rectangle1Angle = BezierSpline {
         SplineColor = { Red = 14, Green = 221, Blue = 144 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 50, 240 }, Flags = { Linear = true } },
            [150] = { 720, LH = { 100, 480 }, Flags = { Linear = true } }
         }
      },
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Mix = Input { Expression = "TimeStretcher1.InterpolateBetweenFrames", },
            Background = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "OpticalFlow1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 364, 54.6364 } },
      },
      OpticalFlow1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 385.334, 17.6666 } },
      },
      TimeStretcher1 = TimeStretcher {
         CtrlWZoom = false,
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input {
               SourceOp = "TimeStretcher1InterpolationMode",
               Source = "Value",
            },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Dissolve1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 472, 54.6364 } },
      },
      TimeStretcher1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1InterpolationMode = BezierSpline {
         SplineColor = { Red = 137, Green = 74, Blue = 235 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16, 0 }, Flags = { Linear = true } },
            [48] = { 0, LH = { 32, 0 }, RH = { 48.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [49] = { 2, LH = { 48.6666666666667, 1.33333333333333 }, RH = { 66.3333333333333, 2 }, Flags = { Linear = true } },
            [101] = { 2, LH = { 83.6666666666667, 2 }, RH = { 101.333333333333, 1.33333333333333 }, Flags = { Linear = true } },
            [102] = { 0, LH = { 101.666666666667, 0.666666666666667 }, RH = { 118, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 134, 0 }, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "TimeStretcher1"
}


Edit
Actually having checked this, I think I may have stumbled and fell backwards onto my backside, into getting it done.
Edit
No wait, the optical flow continues being used when it should have switched off. I thought it might be due to the timing of the mode change, so I changed that in TimeStretcher1_1 but that didn't do it. Just one more try, how would I invert the switching, to switch to background input for the flow, it would also fix the minor problem of Blend switching to optical flow? Clutching at straws occastionally can work although I suspect the problem comes from mode switching in a TimeStretcher.
Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 127.334, 10.9999 } },
      },
      Merge1 = Merge {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            },
            Background = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 245.334, 55.2423 } },
      },
      Background2 = Background {
         Inputs = {
            GlobalOut = Input { Value = 500, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 128.667, 55.2424 } },
      },
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         Inputs = {
            Mix = Input { Expression = "TimeStretcher1.InterpolateBetweenFrames", },
            Background = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "OpticalFlow1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 384.667, 31 } },
      },
      OpticalFlow1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 406.001, -1.72736 } },
      },
      Rectangle1 = RectangleMask {
         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" }, },
            Width = Input { Value = 0.304812834224599, },
            Height = Input { Value = 0.0439429928741093, },
            Angle = Input {
               SourceOp = "Rectangle1Angle",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 245.334, 86.7578 } },
      },
      Rectangle1Angle = BezierSpline {
         SplineColor = { Red = 14, Green = 221, Blue = 144 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 50, 240 }, Flags = { Linear = true } },
            [150] = { 720, LH = { 100, 480 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1 = TimeStretcher {
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input {
               SourceOp = "TimeStretcher1InterpolationMode",
               Source = "Value",
            },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Dissolve1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 492.667, 31 } },
      },
      TimeStretcher1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1InterpolationMode = BezierSpline {
         SplineColor = { Red = 137, Green = 74, Blue = 235 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16, 0 }, Flags = { Linear = true } },
            [48] = { 0, LH = { 32, 0 }, RH = { 48.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [49] = { 2, LH = { 48.6666666666667, 1.33333333333333 }, RH = { 66.3333333333333, 2 }, Flags = { Linear = true } },
            [101] = { 2, LH = { 83.6666666666667, 2 }, RH = { 101.333333333333, 1.33333333333333 }, Flags = { Linear = true } },
            [102] = { 0, LH = { 101.666666666667, 0.666666666666667 }, RH = { 118, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 134, 0 }, Flags = { Linear = true } }
         }
      },
      OpticalFlow1_1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 494.667, 109.182 } },
      },
      TimeStretcher1_1 = TimeStretcher {
         CtrlWZoom = false,
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1_1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input {
               SourceOp = "TimeStretcher1_1InterpolationMode",
               Source = "Value",
            },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Dissolve1_1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 581.333, 144.333 } },
      },
      TimeStretcher1_1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1_1InterpolationMode = BezierSpline {
         SplineColor = { Red = 137, Green = 74, Blue = 235 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16, 0 }, Flags = { Linear = true } },
            [48] = { 0, LH = { 32, 0 }, RH = { 48.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [49] = { 2, LH = { 48.6666666666667, 1.33333333333333 }, RH = { 65.6666666666667, 2 }, Flags = { Linear = true } },
            [99] = { 2, LH = { 82.3333333333333, 2 }, RH = { 99.3333333333333, 1.33333333333333 }, Flags = { Linear = true } },
            [100] = { 0, LH = { 99.6666666666667, 0.666666666666667 }, RH = { 100.333333333333, 0 }, Flags = { Linear = true } },
            [101] = { 0, LH = { 100.666666666667, 0 }, RH = { 117.333333333333, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 133.666666666667, 0 }, Flags = { Linear = true } }
         }
      },
      Dissolve1_1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         Inputs = {
            Mix = Input { Expression = "TimeStretcher1_1.InterpolateBetweenFrames", },
            Background = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "OpticalFlow1_1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 473.333, 144.333 } },
      },
      Dissolve1_1_1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Mix = Input { Expression = "TimeStretcher1_1_1.InterpolateBetweenFrames", },
            Background = Input {
               SourceOp = "OpticalFlow1_1_1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 689.333, 91 } },
      },
      OpticalFlow1_1_1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 710.667, 55.848 } },
      },
      TimeStretcher1_1_1 = TimeStretcher {
         CtrlWZoom = false,
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1_1_1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input {
               SourceOp = "TimeStretcher1_1_1InterpolationMode",
               Source = "Value",
            },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Dissolve1_1_1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 797.333, 91 } },
      },
      TimeStretcher1_1_1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1_1_1InterpolationMode = BezierSpline {
         SplineColor = { Red = 137, Green = 74, Blue = 235 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 0, RH = { 16, 0 }, Flags = { Linear = true } },
            [48] = { 0, LH = { 32, 0 }, RH = { 48.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [49] = { 2, LH = { 48.6666666666667, 1.33333333333333 }, RH = { 65.6666666666667, 2 }, Flags = { Linear = true } },
            [99] = { 2, LH = { 82.3333333333333, 2 }, RH = { 99.3333333333333, 1.33333333333333 }, Flags = { Linear = true } },
            [100] = { 0, LH = { 99.6666666666667, 0.666666666666667 }, RH = { 100.333333333333, 0 }, Flags = { Linear = true } },
            [101] = { 0, LH = { 100.666666666667, 0 }, RH = { 117.333333333333, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 133.666666666667, 0 }, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "Dissolve1_1_1"
}
Offline
User avatar

Chad Capeland

  • Posts: 3017
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: TimeStretcher/ Timespeed node - useful modification.

PostMon Nov 14, 2022 11:12 pm

Would make more sense if TimeStretcher just did the optical flow if the channels were missing. Then you wouldn't need the OpticalFlow tool and the memory overhead.

But as-is, why aren't you switching after the TimeStretcher?

Code: Select all
{
   Tools = ordered() {
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Mix = Input {
               SourceOp = "Dissolve1BackgroundForeground",
               Source = "Value",
            },
            Background = Input {
               SourceOp = "TimeStretcher1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Instance_TimeStretcher1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 540, -61.7273 } },
      },
      Dissolve1BackgroundForeground = BezierSpline {
         SplineColor = { Red = 16, Green = 164, Blue = 235 },
         CtrlWZoom = false,
         NameSet = true,
         KeyFrames = {
            [0] = { 1, RH = { 16.6666666666667, 1 }, Flags = { Linear = true } },
            [50] = { 0, LH = { 50, 0.333333333333333 }, RH = { 66.6666666666667, 0 }, Flags = { StepIn = true } },
            [100] = { 0, LH = { 100, 0 }, RH = { 100, 0.333333333333333 }, Flags = { StepIn = true } },
            [150] = { 1, LH = { 133.333333333333, 1 }, Flags = { StepOut = true } }
         }
      },
      TimeStretcher1 = TimeStretcher {
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input { Value = 2, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "OpticalFlow1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
            ClampSoftness = Input { Value = 0, },
            ["EnableWarp.PrevBackward"] = Input { Value = 1, },
            ["EnableWarp.NextBackward"] = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 382.667, -82.3333 } },
      },
      TimeStretcher1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      Instance_TimeStretcher1 = TimeStretcher {
         SourceOp = "TimeStretcher1",
         Inputs = {
            SettingsNest = Input { },
            InterpolateBetweenFrames = Input { Value = 0, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            ["EnableWarp.Nest"] = Input { },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
         },
         ViewInfo = OperatorInfo { Pos = { 384, -26.5758 } },
      },
      OpticalFlow1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            Method = Input { Value = FuID { "Advanced" }, },
            ["Advanced.Advanced"] = Input { Value = 1, },
            ["Advanced.NumWarps"] = Input { Value = 10, },
            ["Advanced.NumIters"] = Input { Value = 20, },
            ["Advanced.Smoothness"] = Input { Value = 100, },
         },
         ViewInfo = OperatorInfo { Pos = { 230.001, -82.3334 } },
      },
      Merge1 = Merge {
         Inputs = {
            EffectMask = Input {
               SourceOp = "Rectangle1",
               Source = "Mask",
            },
            Background = Input {
               SourceOp = "Background2",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 69.3343, -25.3638 } },
      },
      Rectangle1 = RectangleMask {
         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" }, },
            Width = Input { Value = 0.304812834224599, },
            Height = Input { Value = 0.0439429928741093, },
            Angle = Input {
               SourceOp = "Rectangle1Angle",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 69.3343, 6.15173 } },
      },
      Rectangle1Angle = BezierSpline {
         SplineColor = { Red = 14, Green = 221, Blue = 144 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 50, 240 }, Flags = { Linear = true } },
            [150] = { 720, LH = { 100, 480 }, Flags = { Linear = true } }
         }
      },
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { -48.6657, -69.6062 } },
      },
      Background2 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { -47.3327, -25.3637 } },
      }
   }
}
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline
User avatar

Bryan Ray

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

Re: TimeStretcher/ Timespeed node - useful modification.

PostTue Nov 15, 2022 12:27 am

Hmmm... seems the Dissolve doesn't pass auxiliary channels.

You could Boolean the vectors into RGBA, use the Dissolve to switch between the OFlow and an empty Background, then Boolean the result back in.

Code: Select all
{
   Tools = ordered() {
      ChannelBooleans1 = ChannelBoolean {
         Inputs = {
            ToRed = Input { Value = 31, },
            ToGreen = Input { Value = 32, },
            ToBlue = Input { Value = 33, },
            ToAlpha = Input { Value = 34, },
            Background = Input {
               SourceOp = "OpticalFlow1_1_1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, -49.5 } },
      },
      OpticalFlow1_1_1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "PipeRouter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, -82.5 } },
      },
      Dissolve1_1_1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         Inputs = {
            Mix = Input { Expression = "TimeStretcher1_1_1.InterpolateBetweenFrames", },
            Background = Input {
               SourceOp = "Background3",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "ChannelBooleans1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, -16.5 } },
      },
      Background3 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftAlpha = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, -16.5 } },
      },
      ChannelBooleans2 = ChannelBoolean {
         Inputs = {
            ToRed = Input { Value = 4, },
            ToGreen = Input { Value = 4, },
            ToBlue = Input { Value = 4, },
            ToAlpha = Input { Value = 4, },
            EnableExtraChannels = Input { Value = 1, },
            ToXVector = Input { Value = 0, },
            ToYVector = Input { Value = 1, },
            ToXBackVector = Input { Value = 2, },
            ToYBackVector = Input { Value = 3, },
            Background = Input {
               SourceOp = "PipeRouter1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Dissolve1_1_1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 16.5 } },
      },
      PipeRouter1 = PipeRouter {
         ViewInfo = PipeRouterInfo { Pos = { 440, 16.5 } },
      },
      TimeStretcher1_1_1 = TimeStretcher {
         CtrlWZoom = false,
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1_1_1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input {
               SourceOp = "TimeStretcher1_1_1InterpolationMode",
               Source = "Value",
            },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "ChannelBooleans2",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 16.5 } },
      },
      TimeStretcher1_1_1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         KeyFrames = {
            [0] = { 0, RH = { 16.6666666666667, 16.6666666666667 }, Flags = { Linear = true } },
            [50] = { 50, LH = { 33.3333333333333, 33.3333333333333 }, RH = { 66.6666666666667, 58.3333333333333 }, Flags = { Linear = true } },
            [100] = { 75, LH = { 83.3333333333333, 66.6666666666667 }, RH = { 116.666666666667, 91.6666666666667 }, Flags = { Linear = true } },
            [150] = { 125, LH = { 133.333333333333, 108.333333333333 }, Flags = { Linear = true } }
         }
      },
      TimeStretcher1_1_1InterpolationMode = BezierSpline {
         SplineColor = { Red = 137, Green = 74, Blue = 235 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, RH = { 16, 0 }, Flags = { Linear = true } },
            [48] = { 0, LH = { 32, 0 }, RH = { 48.3333333333333, 0.666666666666667 }, Flags = { Linear = true } },
            [49] = { 2, LH = { 48.6666666666667, 1.33333333333333 }, RH = { 65.6666666666667, 2 }, Flags = { Linear = true } },
            [99] = { 2, LH = { 82.3333333333333, 2 }, RH = { 99.3333333333333, 1.33333333333333 }, Flags = { Linear = true } },
            [100] = { 0, LH = { 99.6666666666667, 0.666666666666667 }, RH = { 100.333333333333, 0 }, Flags = { Linear = true } },
            [101] = { 0, LH = { 100.666666666667, 0 }, RH = { 117.333333333333, 0 }, Flags = { Linear = true } },
            [150] = { 0, LH = { 133.666666666667, 0 }, Flags = { Linear = true } }
         }
      }
   }
}



Or, you could instead use the Switch Fuse in place of the Dissolve, but I don't recall if the Switch Fuse is distributed with Fusion or not. It might be a Reactor tool.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

Re: TimeStretcher/ Timespeed node - useful modification.

PostTue Nov 15, 2022 7:35 am

I already tried the SwitchFuse in the hope that it achieved the same thing as the Dissolve in a different way. Do you know why the SwitchFuse even exists, it appears to do what the Dissolve node does only less.
It looks like the double instanced TimeStretchers followed by the Dissolve may be the easiest and maybe the only way to do this. If I was to guess, I think the problem lies with the on the fly mode switching of the TimeStrecher, once it gets fed on the optical flow data, nothing less will do. I hoped the auxiliary channels wouldn't continue to pass through the Dissolve after the input was switched, although I suppose that is the Dissolve nodes claim to fame and the SwitchFuse appears to do the same. As for the Boolean set up, that's 3 more nodes than what worked at the start. I think I learned something from this, if it works leave it alone.
Offline
User avatar

Chad Capeland

  • Posts: 3017
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: TimeStretcher/ Timespeed node - useful modification.

PostTue Nov 15, 2022 5:52 pm

Dissolve doesn't pass DoD. There may be some other issues, but that's the main one. Why? Dunno.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

Re: TimeStretcher/ Timespeed node - useful modification.

PostWed Nov 16, 2022 8:40 am

Ah, ok I was hoping SwitchFuse would shut down all the channels on one input or the other. Even then the TimeStretcher might fail if motion vectors are present and then removed.
Offline

Frank Feijen

  • Posts: 167
  • Joined: Tue Dec 13, 2016 10:04 am
  • Location: Vilvoorde, Belgium

Re: TimeStretcher/ Timespeed node - useful modification.

PostWed Nov 16, 2022 9:11 am

I'm probably misreading your intention, but since the interpolation method is keyable - wouldn't it be sufficient to put the Tst in nearest-mode when 100% and OF when not?
Offline
User avatar

Chad Capeland

  • Posts: 3017
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: TimeStretcher/ Timespeed node - useful modification.

PostThu Nov 17, 2022 2:04 am

Frank Feijen wrote:I'm probably misreading your intention, but since the interpolation method is keyable - wouldn't it be sufficient to put the Tst in nearest-mode when 100% and OF when not?


No, as the OpticalFlow doesn't know (or care) whether the downstream tools are using it's output.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

maxen13126

  • Posts: 46
  • Joined: Fri Sep 11, 2020 10:51 am
  • Real Name: Alexander Boehm

Re: TimeStretcher/ Timespeed node - useful modification.

PostTue Nov 22, 2022 9:27 am

Workaround:
Turn on your OpticalFlowNode an render only the frame range you need to a saver node. Then turn it off and render the full sequence to another saver node. That done simply overlay the two sequences in Resolve.
Offline

birdseye

  • Posts: 349
  • Joined: Fri Jun 12, 2020 2:36 pm
  • Real Name: Iain Fisher

Re: TimeStretcher/ Timespeed node - useful modification.

PostTue Nov 22, 2022 10:05 am

The second node setup in this thread does the same job, simply switch the Dissolve node to Foreground when you need optical flow and to Background when you don't. This one.

Code: Select all
{
   Tools = ordered() {
      PipeRouter1 = PipeRouter {
         ViewInfo = PipeRouterInfo { Pos = { 199.333, 61.9091 } },
      },
      OpticalFlow1 = Dimension.OpticalFlow {
         Inputs = {
            Input = Input {
               SourceOp = "PipeRouter1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 299.333, 19.4849 } },
      },
      TimeStretcher1 = TimeStretcher {
         Inputs = {
            SourceTime = Input {
               SourceOp = "TimeStretcher1SourceTime",
               Source = "Value",
            },
            InterpolateBetweenFrames = Input { Value = 0, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "PipeRouter1",
               Source = "Output",
            },
            ClampEdges = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 407.333, 60.0909 } },
      },
      TimeStretcher1SourceTime = BezierSpline {
         SplineColor = { Red = 233, Green = 217, Blue = 243 },
         CtrlWZoom = false,
         KeyFrames = {
            [0] = { 0, Flags = { Linear = true } }
         }
      },
      Instance_TimeStretcher1 = TimeStretcher {
         SourceOp = "TimeStretcher1",
         Inputs = {
            SettingsNest = Input { },
            InterpolateBetweenFrames = Input { Value = 2, },
            SampleSpread = Input { Disabled = true, },
            Input = Input {
               SourceOp = "OpticalFlow1",
               Source = "Output",
            },
            ["EnableWarp.Nest"] = Input { },
            CommentsNest = Input { },
            FrameRenderScriptNest = Input { },
            StartRenderScripts = Input { },
            EndRenderScripts = Input { },
         },
         ViewInfo = OperatorInfo { Pos = { 408.667, 19.4849 } },
      },
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Mix = Input { Value = 0, },
            Background = Input {
               SourceOp = "TimeStretcher1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Instance_TimeStretcher1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 527.333, 59.4848 } },
      }
   },
   ActiveTool = "Dissolve1"
}

Return to Fusion

Who is online

Users browsing this forum: No registered users and 43 guests