Jump to: Board index » General » Fusion

Countdown with a smooth slowdown with a complete stop

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

Jonas Millgård

  • Posts: 2
  • Joined: Sun Dec 10, 2017 10:26 pm
  • Location: Sweden

Countdown with a smooth slowdown with a complete stop

PostSun Dec 10, 2017 11:10 pm

Hi,

I'm pretty much new to Fusion and its capabilities. I looked through the forum for a question similar to the one I have, but I couldn't find one.

What I would like to create is a counter that counts from 2017 to 1897, where the countdown is a smooth slow down as it get closer to 1897 and also comes to a complete stop at 1897.

I have tried a customTool node with expressions using current time and a Text+ node to display the result. I’m not getting it to work and I’m lacking knowledge of expressions and figuring out how to get the slowing down of the counter to work properly.

I would very much appreciate you help, tips and tricks to get ideas of how to solve the countdown. Maybe I’m doing it all wrong trying to use expressions and some other alternative e.g. scripts would work better?

Thanks
Jonas
Offline

Paul Ingvarsson

  • Posts: 231
  • Joined: Tue Sep 10, 2013 3:57 pm
  • Location: London, UK

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 5:41 pm

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "2050",
               Expression = "floor(CustomTool1.NumberIn2)",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 181.5 } },
      },
      CustomTool1 = Custom {
         CtrlWZoom = false,
         Inputs = {
            NumberIn2 = Input {
               SourceOp = "Publish1",
               Source = "Value",
            },
            LUTControlsNest = Input { Value = 1, },
            LUTIn1 = Input {
               SourceOp = "CustomTool1LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool1LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool1LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool1LUTIn4",
               Source = "Value",
            },
            NumberControls = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 660, 82.5 } },
      },
      Publish1 = PublishNumber {
         CtrlWZoom = false,
         Inputs = {
            Value = Input {
               SourceOp = "CustomTool1Value",
               Source = "Value",
            },
         },
      },
      CustomTool1Value = BezierSpline {
         SplineColor = { Red = 246, Green = 136, Blue = 49 },
         NameSet = true,
         KeyFrames = {
            [0] = { 1850, RH = { 23.2, 1897.6 }, Flags = { Linear = true } },
            [250] = { 2050, LH = { 82.8, 2048.8 } }
         }
      },
      CustomTool1LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool1LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool1LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      Merge2 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Merge1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 280.5 } },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 280.5 } },
      },
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 495, 280.5 } },
      }
   }
}
Paul Ingvarsson
StormHD
Strongbox DX-G (Dual e5-2690 v3 64GB)
K6000 | Titan-X | Decklink 4K Pro
Resolve 15.0.1
Windows 10.0.17134
Offline

Paul Ingvarsson

  • Posts: 231
  • Joined: Tue Sep 10, 2013 3:57 pm
  • Location: London, UK

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 5:43 pm

I'm far from expert on this but this method uses the custom tool to animate a generic number which is then linked into the text tool as an expression, but uses the floor() function to remove all decimal places.

Hope it's of some use!
Paul Ingvarsson
StormHD
Strongbox DX-G (Dual e5-2690 v3 64GB)
K6000 | Titan-X | Decklink 4K Pro
Resolve 15.0.1
Windows 10.0.17134
Offline

Frank Feijen

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

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 5:44 pm

Even without custom tool
Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         Inputs = {
            GlobalOut = Input { Value = 150, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "1998",
               Expression = "math.ceil(year)",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            year = Input {
               SourceOp = "Text1year",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 181.5 } },
         UserControls = ordered() {
            year = {
               LINKS_Name = "year",
               LINKID_DataType = "Number",
               INPID_InputControl = "SliderControl",
               INP_Integer = false,
               ICS_ControlPage = "Text"
            }
         }
      },
      Text1year = BezierSpline {
         SplineColor = { Red = 252, Green = 0, Blue = 183 },
         NameSet = true,
         KeyFrames = {
            [0] = { 2017, RH = { 18.3838383838384, 2017 }, Flags = { Linear = true } },
            [140] = { 1897, LH = { 25.4545454545455, 1897 } }
         }
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 935, 214.5 } },
      },
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 150, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 214.5 } },
      }
   }
}
Offline

Paul Ingvarsson

  • Posts: 231
  • Joined: Tue Sep 10, 2013 3:57 pm
  • Location: London, UK

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 5:47 pm

Too clever - how do you get the year slider up?
Paul Ingvarsson
StormHD
Strongbox DX-G (Dual e5-2690 v3 64GB)
K6000 | Titan-X | Decklink 4K Pro
Resolve 15.0.1
Windows 10.0.17134
Offline

Frank Feijen

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

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 6:03 pm

Too clever - how do you get the year slider up?

Right-click on the text+-title in the tools tab, select edit controls.
Next create a new number-control on the Text-page
Offline

Jonas Millgård

  • Posts: 2
  • Joined: Sun Dec 10, 2017 10:26 pm
  • Location: Sweden

Re: Countdown with a smooth slowdown with a complete stop

PostMon Dec 11, 2017 8:01 pm

Thanks Frank and Paul!

Must say the solution with adding number-control on the Text-page was sweet.
Offline

Paul Ingvarsson

  • Posts: 231
  • Joined: Tue Sep 10, 2013 3:57 pm
  • Location: London, UK

Re: Countdown with a smooth slowdown with a complete stop

PostTue Dec 12, 2017 12:03 pm

Jonas Millgård wrote:Thanks Frank and Paul!

Must say the solution with adding number-control on the Text-page was sweet.


Yes it was! Nice little addition to the toolbox of knowledge!
Paul Ingvarsson
StormHD
Strongbox DX-G (Dual e5-2690 v3 64GB)
K6000 | Titan-X | Decklink 4K Pro
Resolve 15.0.1
Windows 10.0.17134

Return to Fusion

Who is online

Users browsing this forum: No registered users and 4 guests