Jump to: Board index » General » Fusion

Number countdown

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

alvanh

  • Posts: 7
  • Joined: Fri Apr 06, 2018 5:25 pm
  • Real Name: alexandre hotton

Number countdown

PostMon May 07, 2018 3:04 pm

Hello
I try to make a countdown from 15000 to 0. I'm not finding how to do this simple thing :shock: . I try to input 0 in the input text and later on the timeline 15000, but it's not working.
If you have a solution make a fix space font like monospace too it will be great.
Thank you
Alex
Offline

Jun Yokoishi

  • Posts: 6
  • Joined: Wed Nov 19, 2014 2:49 pm
  • Location: Japan

Re: Number countdown

PostMon May 07, 2018 4:04 pm

Hi alvanh
You can use Txt+ with Formula modifier(from Krokodove plugin).
Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               SourceOp = "Formula1",
               Source = "Output",
            },
            Style = Input { Value = "Bold", },
            AdvancedFontControls = Input { Value = 1, },
            ForceMonospaced = Input { Value = 1, },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Alignment = Input { Value = 1, },
            HorizontalJustification = Input { Value = 2, },
            CharacterSpacing = Input { Value = 1.385, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 55, 16.5 } },
      },
      Formula1 = KomkomDoorn.KD_TextFormula {
         CtrlWZoom = false,
         Inputs = {
            n1 = Input {
               SourceOp = "Formula1n1",
               Source = "Value",
            },
            Text = Input { Value = "n1", },
            Precisionnumbervalues = Input { Value = 0, },
         },
      },
      Formula1n1 = BezierSpline {
         SplineColor = { Red = 233, Green = 0, Blue = 0 },
         NameSet = true,
         KeyFrames = {
            [1] = { 15000, RH = { 67.3333333333333, 10000 }, Flags = { Linear = true } },
            [200] = { 0, LH = { 133.666666666667, 5000 }, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "Text1"
}


or expression with other tools in case you using Fusion free version.
Code: Select all
{
   Tools = ordered() {
      Crop1 = Crop {
         Inputs = {
            XOffset = Input {
               SourceOp = "Crop1XOffset",
               Source = "Value",
            },
            XSize = Input { Value = 1920, },
            YSize = Input { Value = 1080, },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
      },
      Crop1XOffset = BezierSpline {
         SplineColor = { Red = 250, Green = 59, Blue = 49 },
         NameSet = true,
         KeyFrames = {
            [1] = { 15000, RH = { 67.3333333333333, 10000 }, Flags = { Linear = true } },
            [200] = { 0, LH = { 133.666666666667, 5000 }, Flags = { Linear = true } }
         }
      },
      Text1_1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "0",
               Expression = "Crop1.XOffset",
            },
            Style = Input { Value = "Bold", },
            AdvancedFontControls = Input { Value = 1, },
            ForceMonospaced = Input { Value = 1, },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Alignment = Input { Value = 1, },
            HorizontalJustification = Input { Value = 2, },
            CharacterSpacing = Input { Value = 1.385, },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 550, 82.5 } },
      }
   }
}
Offline

Sander de Regt

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

Re: Number countdown

PostMon May 07, 2018 5:13 pm

How fast does it have to count down? How long is the intended animation?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

alvanh

  • Posts: 7
  • Joined: Fri Apr 06, 2018 5:25 pm
  • Real Name: alexandre hotton

Re: Number countdown

PostMon May 07, 2018 6:22 pm

Hello
The countdown or up should be driven by a duration dictate by the natation of the speaker. I don’t know yet the exact timing.
Thanks
Offline

George Deierling

  • Posts: 338
  • Joined: Thu Feb 25, 2016 11:26 pm

Re: Number countdown

PostMon May 07, 2018 10:39 pm

Another approach might be to just render out a media clip with a frame counter in Resolve, using burn in window. Then just vari speed it in Fusion.
Offline

alvanh

  • Posts: 7
  • Joined: Fri Apr 06, 2018 5:25 pm
  • Real Name: alexandre hotton

Re: Number countdown

PostTue May 08, 2018 8:57 am

good idea
I gone test it
Thanks
Offline
User avatar

Bryan Ray

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

Re: Number countdown

PostTue May 08, 2018 4:19 pm

Wow, you guys make things too complicated! Just use an expression:

Code: Select all
{
   Tools = ordered() {
      CustomTool1 = Custom {
         CtrlWZoom = false,
         Inputs = {
            NumberIn1 = Input { Value = 5.2918455, },
            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, },
            NameforNumber1 = Input { Value = "Animate Me", },
            ShowNumber2 = Input { Value = 0, },
            ShowNumber3 = Input { Value = 0, },
            ShowNumber4 = Input { Value = 0, },
            ShowNumber5 = Input { Value = 0, },
            ShowNumber6 = Input { Value = 0, },
            ShowNumber7 = Input { Value = 0, },
            ShowNumber8 = Input { Value = 0, },
            PointControls = Input { Value = 1, },
            ShowPoint1 = Input { Value = 0, },
            ShowPoint2 = Input { Value = 0, },
            ShowPoint3 = Input { Value = 0, },
            ShowPoint4 = Input { Value = 0, },
            LUTControls = Input { Value = 1, },
            ShowLUT1 = Input { Value = 0, },
            ShowLUT2 = Input { Value = 0, },
            ShowLUT3 = Input { Value = 0, },
            ShowLUT4 = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 323, 110 } },
      },
      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,
      },
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Size = Input { Value = 0.0468085106382979, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input {
               Value = "5",
               Expression = "Text(floor(CustomTool1.NumberIn1))",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1 },
                     [1] = { 1, 1, 1, 1 }
                  }
               },
            },
            Number = Input { Value = 6, },
         },
         ViewInfo = OperatorInfo { Pos = { 318, 172 } },
         UserControls = ordered() {
            Number = {
               LINKS_Name = "Number",
               LINKID_DataType = "Number",
               INPID_InputControl = "ScrewControl",
               INP_Integer = true,
               ICS_ControlPage = "Text"
            }
         }
      }
   }
}



Edit: I tried to link the expression to a User Control on the Text+ tool itself, but for some reason the result I got was "ctype <struct Number>." Not sure what the difference is between the User Control and a slider on Custom Tool.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

julian_b

  • Posts: 236
  • Joined: Sun Jan 22, 2017 1:45 pm
  • Real Name: Julian Böhme

Re: Number countdown

PostWed May 09, 2018 2:15 am

It's weird: Just today, I needed the exact same thing.
Here's my solution.
Almost the same as Bryan Ray's, but a little bit more elegant.
It only uses one Text+ tool with a custom Screw Control.

@Bryan Ray:
You probably got that error, because you named your Control "Number". And python sees "Number" as a data type. It does not refer to your control named "Number". I had the exact same problem and solved it by referring to my control using the text+ tool's name (e.g. "Text2"): Text(Text2.Number).
In the code below I resolved the issue by simply calling the control "Numbers" instead of "Number" and didn't get any error. This way, I could just refer to it using "Text(Numbers).


Code: Select all
{
   Tools = ordered() {
      Text2 = 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 = "3676",
               Expression = "Text(Numbers)",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Numbers = Input {
               SourceOp = "Text2Numbers1",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 247.5 } },
         UserControls = ordered() {
            Numbers = {
               LINKS_Name = "Numbers",
               LINKID_DataType = "Number",
               INPID_InputControl = "ScrewControl",
               INP_Integer = true,
               INP_MinScale = -100,
               INP_MaxScale = 100,
               INP_MinAllowed = -20000,
               INP_MaxAllowed = 20000,
            }
         }
      },
      Text2Numbers1 = BezierSpline {
         SplineColor = { Red = 187, Green = 15, Blue = 240 },
         NameSet = true,
         KeyFrames = {
            [0] = { 15000, RH = { 34, 10000 }, Flags = { Linear = true } },
            [102] = { 0, LH = { 68, 5000 }, Flags = { Linear = true } }
         }
      }
   },
   ActiveTool = "Text2"
}



Edit:
@alvanh:
Fusion doesn't know that you want it to interpolate numbers. It sees your numbers as text. So it wont count up nor down.
You can change my "Numbers" control by right-clicking on the text+ node and selecting "Edit Controls...". In the "ID" field search for "Numbers". You can change the settings there if you need to.
To add custom controls like that, you alsoo use the "Edit Controls..." window. Just enter a new Name and ID etc. for the new control.
Last edited by julian_b on Wed May 09, 2018 3:14 am, edited 1 time in total.
Offline
User avatar

Bryan Ray

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

Re: Number countdown

PostWed May 09, 2018 2:24 am

Julian Böhme wrote:@Bryan Ray:
You probably got that error, because you named your Control "Number". And python sees "Number" as a data type. It does not refer to your control named "Number".


Ah! Yes, that makes sense. Except for the reference to Python because Fusion expressions are Lua.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

julian_b

  • Posts: 236
  • Joined: Sun Jan 22, 2017 1:45 pm
  • Real Name: Julian Böhme

Re: Number countdown

PostWed May 09, 2018 3:13 am

Bryan Ray wrote:
Julian Böhme wrote:@Bryan Ray:
You probably got that error, because you named your Control "Number". And python sees "Number" as a data type. It does not refer to your control named "Number".


Ah! Yes, that makes sense. Except for the reference to Python because Fusion expressions are Lua.


I know that the expressions are not Python.
But ctypes is a Python library to call C functions.
From a quick search on google, it seems like LUA has neither structs nor a ctypes library.
And since Fusion also allows Python scripting, maybe it's calling that in the background. Whatever...
Offline

Frank Feijen

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

Re: Number countdown

PostWed May 09, 2018 7:20 am


Return to Fusion

Who is online

Users browsing this forum: No registered users and 18 guests