Jump to: Board index » General » Fusion

A simple expression not working in DVR 17.4

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

mableflat

  • Posts: 29
  • Joined: Sun Jul 19, 2020 1:31 pm
  • Real Name: Stepan Bondar

A simple expression not working in DVR 17.4

PostTue Oct 26, 2021 6:04 pm

Hello everyone! Faced a little problem with simple expression in DVR 17.4.

I have an animation of increasing a number from 0 to 100 with a % symbol attached to the right.
Here is the expression
Code: Select all
math.floor((Offset+0.000001)*Value).."%"


In previous versions, when I removed the last part of the code
.."%"
to leave the animation of increasing numbers without the attached percentage, everything was fine. But in the new 17.4 version when I remove this part
.."%"
node stops working.

Here is the node

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            StyledText = Input {
               Value = "100%",
               Expression = "math.floor((Offset+0.000001)*Value)..\"%\"",
            },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            Offset = Input {
               SourceOp = "Text1Offset",
               Source = "Value",
            },
            Value = Input { Value = 100, },
         },
         ViewInfo = OperatorInfo { Pos = { 0, 49.5 } },
         UserControls = ordered() {
            Offset = {
               INPID_InputControl = "ScrewControl",
               INP_Integer = false,
               LINKID_DataType = "Number",
               LINKS_Name = "Offset",
            },
            Value = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               INPID_InputControl = "SliderControl",
               INP_MinScale = 0,
               INP_MaxScale = 1000,
               LINKS_Name = "Value",
            }
         }
      },
      Text1Offset = BezierSpline {
         SplineColor = { Red = 234, Green = 92, Blue = 75 },
         KeyFrames = {
            [0] = { 0, RH = { 17.4242424242424, 0 } },
            [25] = { 1, LH = { 7.57575757575757, 1 } }
         }
      }
   },
   ActiveTool = "Text1"
}
Offline
User avatar

Bryan Ray

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

Re: A simple expression not working in DVR 17.4

PostTue Oct 26, 2021 6:10 pm

Interesting. Text+ was evidently rewritten extensively in the latest release, and others have noticed differences in the way it responds to expressions, also.

If you enclose the entire thing in Text(), then it works again. I think it's because appending the % to the end implicitly converts the entire thing to a string. If you omit that, it becomes a number, and you have to inform the tool that it should be converted to text.

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            StyledText = Input {
               Value = "100%",
               Expression = "Text(math.floor((Offset+0.000001)*Value))",
            },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
            Offset = Input {
               SourceOp = "Text1Offset",
               Source = "Value",
            },
            Value = Input { Value = 79, },
         },
         ViewInfo = OperatorInfo { Pos = { 132, -4.75758 } },
         UserControls = ordered() {
            Offset = {
               LINKS_Name = "Offset",
               INP_Integer = false,
               LINKID_DataType = "Number",
               INPID_InputControl = "ScrewControl",
            },
            Value = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               INPID_InputControl = "SliderControl",
               INP_MinScale = 0,
               INP_MaxScale = 1000,
               LINKS_Name = "Value",
            }
         }
      },
      Text1Offset = BezierSpline {
         SplineColor = { Red = 234, Green = 92, Blue = 75 },
         KeyFrames = {
            [0] = { 0.188, RH = { 17.4242424242424, 0.188 } },
            [25] = { 1, LH = { 7.57575757575757, 1 } }
         }
      }
   },
   ActiveTool = "Text1"
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

mableflat

  • Posts: 29
  • Joined: Sun Jul 19, 2020 1:31 pm
  • Real Name: Stepan Bondar

Re: A simple expression not working in DVR 17.4

PostFri Oct 29, 2021 7:57 pm

Bryan Ray wrote:Interesting. Text+ was evidently rewritten extensively in the latest release, and others have noticed differences in the way it responds to expressions, also.

If you enclose the entire thing in Text(), then it works again. I think it's because appending the % to the end implicitly converts the entire thing to a string. If you omit that, it becomes a number, and you have to inform the tool that it should be converted to text.

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            StyledText = Input {
               Value = "100%",
               Expression = "Text(math.floor((Offset+0.000001)*Value))",
            },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
            Offset = Input {
               SourceOp = "Text1Offset",
               Source = "Value",
            },
            Value = Input { Value = 79, },
         },
         ViewInfo = OperatorInfo { Pos = { 132, -4.75758 } },
         UserControls = ordered() {
            Offset = {
               LINKS_Name = "Offset",
               INP_Integer = false,
               LINKID_DataType = "Number",
               INPID_InputControl = "ScrewControl",
            },
            Value = {
               INP_Integer = false,
               LINKID_DataType = "Number",
               INPID_InputControl = "SliderControl",
               INP_MinScale = 0,
               INP_MaxScale = 1000,
               LINKS_Name = "Value",
            }
         }
      },
      Text1Offset = BezierSpline {
         SplineColor = { Red = 234, Green = 92, Blue = 75 },
         KeyFrames = {
            [0] = { 0.188, RH = { 17.4242424242424, 0.188 } },
            [25] = { 1, LH = { 7.57575757575757, 1 } }
         }
      }
   },
   ActiveTool = "Text1"
}

Thanks so much! :)
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: A simple expression not working in DVR 17.4

PostFri Oct 29, 2021 9:03 pm

As of 17.4.1 it's working without Text() again - presumably it was a bug rather than a deliberate change.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor

Return to Fusion

Who is online

Users browsing this forum: BMDR User 9201 and 34 guests