Jump to: Board index » General » Fusion

dimensions of flat text (bounding box) ?

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

kingluma

  • Posts: 24
  • Joined: Tue Apr 10, 2018 3:27 pm
  • Real Name: Dirk de Jong

dimensions of flat text (bounding box) ?

PostThu Apr 19, 2018 4:47 pm

When I generate some text using the "Text+" tool, I'd like to be able to set other Tools' 2D position parameters in relation to the Left/Right/Top/Bottom of the visible text (as if there was a text bounding rectangle defined by the parts of the text that extend farthest in those directions) - and have it be dynamic in the sense that everything would update when the text was edited (causing the bounding rectangle dimensions to change)... Basically I want to be able to have the other position coordinates be in relation to the text block edges rather than the output image edges... How best to achieve this in Fusion ? (I happen to be in the integrated Fusion within Resolve 15 beta) I imagine the answer could involve applying expressions to those parameters that I want to behave that way but the expressions would somehow need to reference the dimensions of the visible text... Sorry if it turns out this is kind of a noob question, I did try a couple web searches before posting... Thanks for any suggestions
Offline
User avatar

Bryan Ray

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

Re: dimensions of flat text (bounding box) ?

PostThu Apr 19, 2018 6:04 pm

Hmm… It's not an easy solve by any means. If you put the Text+ in a Viewer and turn on the DoD button at the bottom of the Viewer, you can see the Domain of Definition outline. That will show you the pixel coordinates of the lower left and upper right corners of the text's bounding box.

These values are contained in a table called DataWindow, a property of the Output or Input. The table contains four values:
1) Lower left X
2) Lower Left Y
3) Upper Right X
4) Upper Right Y

The tricky bit is that most Fusion tools use normalized coordinates instead of pixel coordinate values, so you'll need to perform a little math to get another node to use the DataWindow correctly.

Let's suppose you want to set a Transform's Center control to the lower-left corner of the DataWindow. Under most circumstances, you'd set a Simple Expression on the Center control and use the Point() function to control its location. While you can certainly do that in this situation, it will be a little easier to understand if we do the calculations one at a time in a Custom Tool.

CustomTool has eight sliders that don't do anything except hold values for use elsewhere. We'll use the first four to query the DataWindow and the second four to convert the pixel coordinates to normalized values. For Number In 1, the expression is:
Text1.Output.DataWindow[1].

That's the X coordinate of the lower-left corner. To normalize it, we divide it by the width of the frame. So the expression for Number In 5 is:
NumberIn1 / Text1.Output.OriginalWidth

We do the same for the other three values in DataWindow, except that 2 and 4 are the Y values and are therefore divided by OriginalHeight. Once that's done, we can set Point In 1 and Point In 2 using the values from NumberIn 5 - 8.


Untitled.png
Untitled.png (76.96 KiB) Viewed 10220 times



Those two points can be linked to whatever you like. You could use additional Custom Tools to do more math on the locations, giving them offsets from the corners or whatever. And you can obviously get the other two corners by composing them from the existing ones. Upper left, for instance, is DataWindow[1], DataWindow[4]


Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 330, 181.5 } },
      },
      CustomTool1 = Custom {
         CustomData = {
            Settings = {
               [1] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        Name = "CustomTool1",
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        Name = "CustomTool1LUTIn1",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 0, Blue = 0, Red = 204 }
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        Name = "CustomTool1LUTIn2",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 204, Blue = 0, Red = 0 }
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        Name = "CustomTool1LUTIn3",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 0, Blue = 204, Red = 0 }
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        Name = "CustomTool1LUTIn4",
                        NameSet = true,
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        SplineColor = { Green = 204, Blue = 204, Red = 204 }
                     }
                  }
               },
               [2] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           RedExpression = Input { Value = "c1-c2" },
                           GreenExpression = Input { Value = "c1-c2" },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           BlueExpression = Input { Value = "c1-c2" },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 0, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 0, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 204, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 204, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     }
                  }
               },
               [3] = {
                  Tools = ordered() {
                     CustomTool1 = Custom {
                        Inputs = {
                           LUTIn3 = Input {
                              SourceOp = "CustomTool1LUTIn3",
                              Source = "Value"
                           },
                           LUTIn4 = Input {
                              SourceOp = "CustomTool1LUTIn4",
                              Source = "Value"
                           },
                           Image2 = Input {
                              SourceOp = "ChangeDepth1_1",
                              Source = "Output"
                           },
                           RedExpression = Input { Value = "c1+c2" },
                           GreenExpression = Input { Value = "c1+c2" },
                           LUTIn1 = Input {
                              SourceOp = "CustomTool1LUTIn1",
                              Source = "Value"
                           },
                           Image1 = Input {
                              SourceOp = "TimeSpeed1",
                              Source = "Output"
                           },
                           BlueExpression = Input { Value = "c1+c2" },
                           LUTIn2 = Input {
                              SourceOp = "CustomTool1LUTIn2",
                              Source = "Value"
                           }
                        },
                        CtrlWZoom = false,
                        ViewInfo = OperatorInfo { Pos = { 550, 181.5 } },
                        CustomData = {
                        }
                     },
                     CustomTool1LUTIn1 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 0, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn2 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 0, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn3 = LUTBezier {
                        SplineColor = { Green = 0, Blue = 204, Red = 0 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     },
                     CustomTool1LUTIn4 = LUTBezier {
                        SplineColor = { Green = 204, Blue = 204, Red = 204 },
                        KeyColorSplines = {
                           [0] = {
                              [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
                              [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
                           }
                        },
                        NameSet = true
                     }
                  }
               },
            }
         },
         Inputs = {
            PointIn1 = Input {
               Value = { 0.330729166666667, 0.411111111111111 },
               Expression = "Point(NumberIn5,NumberIn6)",
            },
            PointIn2 = Input {
               Value = { 0.670833333333333, 0.588888888888889 },
               Expression = "Point(NumberIn7, NumberIn8)",
            },
            NumberIn1 = Input {
               Value = 635,
               Expression = "Text1.Output.DataWindow[1]",
            },
            NumberIn2 = Input {
               Value = 444,
               Expression = "Text1.Output.DataWindow[2]",
            },
            NumberIn3 = Input {
               Value = 1288,
               Expression = "Text1.Output.DataWindow[3]",
            },
            NumberIn4 = Input {
               Value = 636,
               Expression = "Text1.Output.DataWindow[4]",
            },
            NumberIn5 = Input {
               Value = 0.330729166666667,
               Expression = "NumberIn1 / Text1.Output.OriginalWidth",
            },
            NumberIn6 = Input {
               Value = 0.411111111111111,
               Expression = "NumberIn2 / Text1.Output.OriginalHeight",
            },
            NumberIn7 = Input {
               Value = 0.670833333333333,
               Expression = "NumberIn3 / Text1.Output.OriginalWidth",
            },
            NumberIn8 = Input {
               Value = 0.588888888888889,
               Expression = "NumberIn4 / Text1.Output.OriginalHeight",
            },
            LUTIn1 = Input {
               SourceOp = "CustomTool1LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool1LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool1LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool1LUTIn4",
               Source = "Value",
            },
            ShowPoint3 = Input { Value = 0, },
            ShowPoint4 = Input { Value = 0, },
            ShowLUT1 = Input { Value = 0, },
            ShowLUT2 = Input { Value = 0, },
            ShowLUT3 = Input { Value = 0, },
            ShowLUT4 = Input { Value = 0, },
            Image1 = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 280.5 } },
      },
      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,
      },
      Transform1 = Transform {
         CtrlWZoom = false,
         Inputs = {
            Center = Input { Expression = "CustomTool1.PointIn1", },
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 181.5 } },
      },
      Text1 = TextPlus {
         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 = "Some text.\nIt sets the DoD", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 385, 280.5 } },
      }
   }
}



Once you really understand what's happening, you could, of course, compose the entire thing in a single Simple Expression on the Transform's Center, but I find it really easy to make mistakes when writing a long expression like that. I think it's easier to decompose it like I've done here.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

kingluma

  • Posts: 24
  • Joined: Tue Apr 10, 2018 3:27 pm
  • Real Name: Dirk de Jong

Re: dimensions of flat text (bounding box) ?

PostThu Apr 19, 2018 6:18 pm

If you put the Text+ in a Viewer and turn on the DoD button at the bottom of the Viewer, you can see the Domain of Definition outline. That will show you the pixel coordinates of the lower left and upper right corners of the text's bounding box.

Thanks so much for the thorough reply - I had been mousing over the tool node and seeing the DoD values in the tool tip change when the text was edited and so I was thinking that data was what I needed but had no idea yet how to get at it and use it... I had been fiddling with the Set Domain tool hoping there might be some way there but was kind of getting nowhere. I expect I'll probably be able to do it using the info in your reply - thanks again !
Offline

kingluma

  • Posts: 24
  • Joined: Tue Apr 10, 2018 3:27 pm
  • Real Name: Dirk de Jong

Re: dimensions of flat text (bounding box) ?

PostFri Apr 20, 2018 4:00 pm

kingluma wrote:
I expect I'll probably be able to do it using the info in your reply - thanks again !
I'm finding it to work well in Fusion standalone, but for some reason the very same thing in Resolve 15 beta doesn't work (doesn't render anything, eventually causes the app to stop responding) - guess I'll report it in the public beta forum...

joel.eggenberger

Re: dimensions of flat text (bounding box) ?

PostWed Sep 12, 2018 12:33 pm

Thank you so much Bryan - I was able to create a responsive lower third - although I'm new to scripting in Fusion. I'm coming from Premiere - AE Workflow and our company is now thinking about switching to Resolve - Fusion!

Attached you'll find the Macro I created! I'm having the same issues like kingluma - it works well in fusion 9 Standalone, but as soon as I switch into Resolve the Performance is horrible and it crashes many times! I think Resolve has a problem with the Custom Tool.

Code: Select all
{
   Tools = ordered() {
      AM_ResponsiveLowerThird_01 = GroupOperator {
         Inputs = ordered() {
            Input1 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "StyledText",
            },
            Input2 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Font",
               ControlGroup = 2,
            },
            Input3 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Style",
               ControlGroup = 2,
            },
            Input4 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Red1Clone",
               Name = "Color",
               ControlGroup = 3,
               Default = 0,
            },
            Input5 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Green1Clone",
               ControlGroup = 3,
               Default = 0,
            },
            Input6 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Blue1Clone",
               ControlGroup = 3,
               Default = 0,
            },
            Input7 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Alpha1Clone",
               ControlGroup = 3,
               Default = 1,
            },
            Input8 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "Size",
               Default = 0.065,
            },
            Input9 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "CharacterSpacingClone",
               Name = "Tracking",
               Default = 1,
            },
            Input10 = InstanceInput {
               SourceOp = "Text1_1",
               Source = "LineSpacingClone",
               Default = 1,
            },
            Input11 = InstanceInput {
               SourceOp = "Rectangle_1",
               Source = "SpacingX",
               Page = "Controls",
               Default = 0.005,
            },
            Input12 = InstanceInput {
               SourceOp = "Rectangle_1",
               Source = "SpacingY",
               Page = "Controls",
               Default = 0.02,
            },
            Input13 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopLeftRed",
               Name = "Highlite Color",
               ControlGroup = 9,
               Default = 0,
            },
            Input14 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopLeftGreen",
               ControlGroup = 9,
               Default = 0,
            },
            Input15 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopLeftBlue",
               ControlGroup = 9,
               Default = 0,
            },
            Input16 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopLeftAlpha",
               ControlGroup = 9,
               Default = 1,
            },
            Input17 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopRightRed",
               Name = "Top Right",
               ControlGroup = 10,
               Default = 0,
            },
            Input18 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopRightGreen",
               ControlGroup = 10,
               Default = 0,
            },
            Input19 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopRightBlue",
               ControlGroup = 10,
               Default = 0,
            },
            Input20 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "TopRightAlpha",
               ControlGroup = 10,
               Default = 1,
            },
            Input21 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomLeftRed",
               Name = "Bottom Left",
               ControlGroup = 11,
               Default = 0,
            },
            Input22 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomLeftGreen",
               ControlGroup = 11,
               Default = 0,
            },
            Input23 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomLeftBlue",
               ControlGroup = 11,
               Default = 0,
            },
            Input24 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomLeftAlpha",
               ControlGroup = 11,
               Default = 1,
            },
            Input25 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomRightRed",
               Name = "Bottom Right",
               ControlGroup = 12,
               Default = 0,
            },
            Input26 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomRightGreen",
               ControlGroup = 12,
               Default = 0,
            },
            Input27 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomRightBlue",
               ControlGroup = 12,
               Default = 0,
            },
            Input28 = InstanceInput {
               SourceOp = "BG_Highlite_1",
               Source = "BottomRightAlpha",
               ControlGroup = 12,
               Default = 1,
            },
            Input29 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopLeftRed",
               Name = "Box Color",
               ControlGroup = 13,
               Default = 1,
            },
            Input30 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopLeftGreen",
               ControlGroup = 13,
               Default = 1,
            },
            Input31 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopLeftBlue",
               ControlGroup = 13,
               Default = 1,
            },
            Input32 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopLeftAlpha",
               ControlGroup = 13,
               Default = 1,
            },
            Input33 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopRightRed",
               Name = "Top Right",
               ControlGroup = 14,
               Default = 0,
            },
            Input34 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopRightGreen",
               ControlGroup = 14,
               Default = 0,
            },
            Input35 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopRightBlue",
               ControlGroup = 14,
               Default = 0,
            },
            Input36 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "TopRightAlpha",
               ControlGroup = 14,
               Default = 1,
            },
            Input37 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomLeftRed",
               Name = "Bottom Left",
               ControlGroup = 15,
               Default = 0,
            },
            Input38 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomLeftGreen",
               ControlGroup = 15,
               Default = 0,
            },
            Input39 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomLeftBlue",
               ControlGroup = 15,
               Default = 0,
            },
            Input40 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomLeftAlpha",
               ControlGroup = 15,
               Default = 1,
            },
            Input41 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomRightRed",
               Name = "Bottom Right",
               ControlGroup = 16,
               Default = 0,
            },
            Input42 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomRightGreen",
               ControlGroup = 16,
               Default = 0,
            },
            Input43 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomRightBlue",
               ControlGroup = 16,
               Default = 0,
            },
            Input44 = InstanceInput {
               SourceOp = "BG_Box_1",
               Source = "BottomRightAlpha",
               ControlGroup = 16,
               Default = 1,
            },
         },
         Outputs = {
            MainOutput1 = InstanceOutput {
               SourceOp = "FADE_1_1",
               Source = "Output",
            }
         },
         ViewInfo = GroupInfo { Pos = { 0, 0 } },
         Tools = ordered() {
            Text1_1 = TextPlus {
               NameSet = true,
               Inputs = {
                  Alignment = Input { Value = 1, },
                  Width = Input { Value = 1920, },
                  Height = Input { Value = 1080, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
                  Center = Input { Value = { 0.0437260231548334, 0.1492309699728 }, },
                  Red1 = Input { Value = 0, },
                  Green1 = Input { Value = 0, },
                  Blue1 = Input { Value = 0, },
                  StyledText = Input { Value = "animations and more", },
                  Font = Input { Value = "Open Sans", },
                  Style = Input { Value = "Bold", },
                  Size = Input { Value = 0.065, },
                  VerticalJustificationNew = Input { Value = 3, },
                  HorizontalLeftCenterRight = Input { Value = -1, },
                  HorizontalJustificationNew = Input { Value = 3, },
                  ManualFontKerningPlacement = Input {
                     Value = StyledText {
                        Array = {
                        },
                        Value = ""
                     },
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 1527.72, 94.3632 } },
            },
            CustomTool1_1 = Custom {
               CustomData = { Settings = { [1] = { Tools = ordered() { CustomTool1 = Custom { Inputs = { LUTIn3 = Input { SourceOp = "CustomTool1LUTIn3", Source = "Value" }, LUTIn1 = Input { SourceOp = "CustomTool1LUTIn1", Source = "Value" }, Image1 = Input { SourceOp = "TimeSpeed1", Source = "Output" }, Image2 = Input { SourceOp = "ChangeDepth1_1", Source = "Output" }, LUTIn4 = Input { SourceOp = "CustomTool1LUTIn4", Source = "Value" }, LUTIn2 = Input { SourceOp = "CustomTool1LUTIn2", Source = "Value" } }, Name = "CustomTool1", CtrlWZoom = false, ViewInfo = OperatorInfo { Pos = { 550, 181.5 } }, CustomData = {
                              } }, CustomTool1LUTIn1 = LUTBezier { Name = "CustomTool1LUTIn1", NameSet = true, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Green = 0, Blue = 0, Red = 204 } }, CustomTool1LUTIn2 = LUTBezier { Name = "CustomTool1LUTIn2", NameSet = true, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Green = 204, Blue = 0, Red = 0 } }, CustomTool1LUTIn3 = LUTBezier { Name = "CustomTool1LUTIn3", NameSet = true, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Green = 0, Blue = 204, Red = 0 } }, CustomTool1LUTIn4 = LUTBezier { Name = "CustomTool1LUTIn4", NameSet = true, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, SplineColor = { Green = 204, Blue = 204, Red = 204 } } } }, [2] = { Tools = ordered() { CustomTool1 = Custom { Inputs = { LUTIn3 = Input { SourceOp = "CustomTool1LUTIn3", Source = "Value" }, LUTIn4 = Input { SourceOp = "CustomTool1LUTIn4", Source = "Value" }, Image2 = Input { SourceOp = "ChangeDepth1_1", Source = "Output" }, RedExpression = Input { Value = "c1-c2" }, GreenExpression = Input { Value = "c1-c2" }, LUTIn1 = Input { SourceOp = "CustomTool1LUTIn1", Source = "Value" }, Image1 = Input { SourceOp = "TimeSpeed1", Source = "Output" }, BlueExpression = Input { Value = "c1-c2" }, LUTIn2 = Input { SourceOp = "CustomTool1LUTIn2", Source = "Value" } }, CtrlWZoom = false, ViewInfo = OperatorInfo { Pos = { 550, 181.5 } }, CustomData = {
                              } }, CustomTool1LUTIn1 = LUTBezier { SplineColor = { Green = 0, Blue = 0, Red = 204 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn2 = LUTBezier { SplineColor = { Green = 204, Blue = 0, Red = 0 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn3 = LUTBezier { SplineColor = { Green = 0, Blue = 204, Red = 0 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn4 = LUTBezier { SplineColor = { Green = 204, Blue = 204, Red = 204 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true } } }, [3] = { Tools = ordered() { CustomTool1 = Custom { Inputs = { LUTIn3 = Input { SourceOp = "CustomTool1LUTIn3", Source = "Value" }, LUTIn4 = Input { SourceOp = "CustomTool1LUTIn4", Source = "Value" }, Image2 = Input { SourceOp = "ChangeDepth1_1", Source = "Output" }, RedExpression = Input { Value = "c1+c2" }, GreenExpression = Input { Value = "c1+c2" }, LUTIn1 = Input { SourceOp = "CustomTool1LUTIn1", Source = "Value" }, Image1 = Input { SourceOp = "TimeSpeed1", Source = "Output" }, BlueExpression = Input { Value = "c1+c2" }, LUTIn2 = Input { SourceOp = "CustomTool1LUTIn2", Source = "Value" } }, CtrlWZoom = false, ViewInfo = OperatorInfo { Pos = { 550, 181.5 } }, CustomData = {
                              } }, CustomTool1LUTIn1 = LUTBezier { SplineColor = { Green = 0, Blue = 0, Red = 204 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn2 = LUTBezier { SplineColor = { Green = 204, Blue = 0, Red = 0 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn3 = LUTBezier { SplineColor = { Green = 0, Blue = 204, Red = 0 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true }, CustomTool1LUTIn4 = LUTBezier { SplineColor = { Green = 204, Blue = 204, Red = 204 }, KeyColorSplines = { [0] = { [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } }, [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } } } }, NameSet = true } } } } },
               Inputs = {
                  PointIn1 = Input {
                     Value = { 0.0447916666666667, 0.123148148148148 },
                     Expression = "Point(NumberIn5,NumberIn6)",
                  },
                  PointIn2 = Input {
                     Value = { 0.4515625, 0.177777777777778 },
                     Expression = "Point(NumberIn7, NumberIn8)",
                  },
                  NumberIn1 = Input {
                     Value = 86,
                     Expression = "Text1_1.Output.DataWindow[1]",
                  },
                  NumberIn2 = Input {
                     Value = 133,
                     Expression = "Text1_1.Output.DataWindow[2]",
                  },
                  NumberIn3 = Input {
                     Value = 867,
                     Expression = "Text1_1.Output.DataWindow[3]",
                  },
                  NumberIn4 = Input {
                     Value = 192,
                     Expression = "Text1_1.Output.DataWindow[4]",
                  },
                  NumberIn5 = Input {
                     Value = 0.0447916666666667,
                     Expression = "NumberIn1 / Text1_1.Output.OriginalWidth",
                  },
                  NumberIn6 = Input {
                     Value = 0.123148148148148,
                     Expression = "NumberIn2 / Text1_1.Output.OriginalHeight",
                  },
                  NumberIn7 = Input {
                     Value = 0.4515625,
                     Expression = "NumberIn3 / Text1_1.Output.OriginalWidth",
                  },
                  NumberIn8 = Input {
                     Value = 0.177777777777778,
                     Expression = "NumberIn4 / Text1_1.Output.OriginalHeight",
                  },
                  LUTIn1 = Input {
                     SourceOp = "CustomTool1LUTIn1_1",
                     Source = "Value",
                  },
                  LUTIn2 = Input {
                     SourceOp = "CustomTool1LUTIn2_1",
                     Source = "Value",
                  },
                  LUTIn3 = Input {
                     SourceOp = "CustomTool1LUTIn3_1",
                     Source = "Value",
                  },
                  LUTIn4 = Input {
                     SourceOp = "CustomTool1LUTIn4_1",
                     Source = "Value",
                  },
                  ShowPoint3 = Input { Value = 0, },
                  ShowPoint4 = Input { Value = 0, },
                  ShowLUT1 = Input { Value = 0, },
                  ShowLUT2 = Input { Value = 0, },
                  ShowLUT3 = Input { Value = 0, },
                  ShowLUT4 = Input { Value = 0, },
                  Image1 = Input {
                     SourceOp = "Text1_1",
                     Source = "Output",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 1729.59, 96.4132 } },
            },
            CustomTool1LUTIn1_1 = 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 },
               CtrlWShown = false,
            },
            CustomTool1LUTIn2_1 = 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 },
               CtrlWShown = false,
            },
            CustomTool1LUTIn3_1 = 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 },
               CtrlWShown = false,
            },
            CustomTool1LUTIn4_1 = 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 },
               CtrlWShown = false,
            },
            Rectangle_1 = RectangleMask {
               NameSet = true,
               Inputs = {
                  MaskWidth = Input { Value = 1920, },
                  MaskHeight = Input { Value = 1080, },
                  PixelAspect = Input { Value = { 1, 1 }, },
                  ClippingMode = Input { Value = FuID { "None" }, },
                  Center = Input {
                     Value = { 0, 0.1492309699728 },
                     Expression = "Point(0.0, Text1_1.Center.Y)",
                  },
                  Width = Input {
                     Value = 0.913125,
                     Expression = "(SpacingX+CustomTool1_1.NumberIn7)*2",
                  },
                  Height = Input {
                     Value = 0.0746296296296296,
                     Expression = "(CustomTool1_1.NumberIn8-CustomTool1_1.NumberIn6)+SpacingY",
                  },
                  SpacingX = Input { Value = 0.005, },
                  SpacingY = Input { Value = 0.02, },
               },
               ViewInfo = OperatorInfo { Pos = { 1726.94, -136.061 } },
               UserControls = ordered() { SpacingX = { INP_Integer = false, LINKID_DataType = "Number", ICS_ControlPage = "Controls", INPID_InputControl = "SliderControl", INP_MinScale = -1, INP_MaxScale = 1, LINKS_Name = "Spacing X" }, SpacingY = { INP_Integer = false, LINKID_DataType = "Number", ICS_ControlPage = "Controls", INPID_InputControl = "SliderControl", INP_MinScale = -1, INP_MaxScale = 1, LINKS_Name = "Spacing Y" } }
            },
            TimeSpeed_1_1 = TimeSpeed {
               NameSet = true,
               Inputs = {
                  Delay = Input { Value = -1, },
                  Input = Input {
                     SourceOp = "Transform1_1",
                     Source = "Output",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 2209.81, -139.965 } },
            },
            Instance_Transform1_1 = Transform {
               SourceOp = "Transform1_1",
               Inputs = {
                  StartEndRenderScripts = Input { },
                  ReferenceSize = Input { },
                  Input = Input {
                     SourceOp = "BG_Box_1",
                     Source = "Output",
                  },
                  EffectMask = Input { }
               },
               ViewInfo = OperatorInfo { Pos = { 2072.45, -193.991 } },
            },
            Transform1_1XSize = BezierSpline {
               SplineColor = { Red = 251, Green = 94, Blue = 44 },
               CtrlWShown = false,
               NameSet = true,
               KeyFrames = {
                  [0] = { 0, RH = { 22.35, 0.003 } },
                  [30] = { 1.004, LH = { 6, 0.970999999999999 } }
               }
            },
            Transform1_1 = Transform {
               Inputs = {
                  MotionBlur = Input { Value = 1, },
                  Quality = Input { Value = 3, },
                  Pivot = Input { Value = { 0, 0.5 }, },
                  UseSizeAndAspect = Input { Value = 0, },
                  XSize = Input {
                     SourceOp = "Transform1_1XSize",
                     Source = "Value",
                  },
                  Input = Input {
                     SourceOp = "BG_Highlite_1",
                     Source = "Output",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 2076.65, -140.507 } },
            },
            BG_Highlite_1 = Background {
               NameSet = true,
               Inputs = {
                  Width = Input { Value = 1920, },
                  Height = Input { Value = 1080, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
                  EffectMask = Input {
                     SourceOp = "Rectangle_1",
                     Source = "Mask",
                  }
               },
               ViewInfo = OperatorInfo { Pos = { 1900.67, -137.154 } },
            },
            BG_Box_1 = Background {
               CtrlWZoom = false,
               NameSet = true,
               Inputs = {
                  Width = Input { Value = 1920, },
                  Height = Input { Value = 1080, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
                  TopLeftRed = Input { Value = 1, },
                  TopLeftGreen = Input { Value = 1, },
                  TopLeftBlue = Input { Value = 1, },
                  EffectMask = Input {
                     SourceOp = "Rectangle_1",
                     Source = "Mask",
                  }
               },
               ViewInfo = OperatorInfo { Pos = { 1890.99, -193.288 } },
            },
            Merge3_1 = Merge {
               Inputs = {
                  Background = Input {
                     SourceOp = "TimeSpeed_1_1",
                     Source = "Output",
                  },
                  Foreground = Input {
                     SourceOp = "Instance_Transform1_1",
                     Source = "Output",
                  },
                  PerformDepthMerge = Input { Value = 0, },
               },
               ViewInfo = OperatorInfo { Pos = { 2319.81, -142.293 } },
            },
            Merge1_1 = Merge {
               Inputs = {
                  Background = Input {
                     SourceOp = "PipeRouter6_1",
                     Source = "Output",
                  },
                  Foreground = Input {
                     SourceOp = "CustomTool1_1",
                     Source = "Output",
                  },
                  PerformDepthMerge = Input { Value = 0, },
                  EffectMask = Input {
                     SourceOp = "PipeRouter6_1",
                     Source = "Output",
                  }
               },
               ViewInfo = OperatorInfo { Pos = { 2386.3, 95.7532 } },
            },
            PipeRouter6_1 = PipeRouter {
               Inputs = {
                  Input = Input {
                     SourceOp = "Merge3_1",
                     Source = "Output",
                  },
               },
               ViewInfo = PipeRouterInfo { Pos = { 2408.38, -140.117 } },
            },
            PipeRouter1_1_1 = PipeRouter {
               Inputs = {
                  Input = Input {
                     SourceOp = "Merge1_1",
                     Source = "Output",
                  },
               },
               ViewInfo = PipeRouterInfo { Pos = { 2832.63, 37.2132 } },
            },
            Reverse_1_1 = TimeSpeed {
               NameSet = true,
               Inputs = {
                  Speed = Input { Value = -1, },
                  Input = Input {
                     SourceOp = "Merge1_1",
                     Source = "Output",
                  },
                  EndRenderScripts = Input { Value = 1, },
               },
               ViewInfo = OperatorInfo { Pos = { 2932.93, 88.3532 } },
            },
            FADE_1_1 = Dissolve {
               Transitions = {
                  [0] = "DFTDissolve"
               },
               NameSet = true,
               Inputs = {
                  Mix = Input {
                     SourceOp = "FADE_1_1BackgroundForeground",
                     Source = "Value",
                  },
                  Background = Input {
                     SourceOp = "Reverse_1_1",
                     Source = "Output",
                  },
                  Foreground = Input {
                     SourceOp = "PipeRouter2_1_1",
                     Source = "Output",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 3088.69, 89.1532 } },
            },
            FADE_1_1BackgroundForeground = BezierSpline {
               SplineColor = { Red = 16, Green = 164, Blue = 235 },
               CtrlWShown = false,
               NameSet = true,
               KeyFrames = {
                  [30] = { 1, RH = { 36.6666666666667, 0.666666666666667 }, Flags = { Linear = true } },
                  [50] = { 0, LH = { 43.3333333333333, 0.333333333333333 }, Flags = { Linear = true } }
               }
            },
            PipeRouter2_1_1 = PipeRouter {
               Inputs = {
                  Input = Input {
                     SourceOp = "PipeRouter1_1_1",
                     Source = "Output",
                  },
               },
               ViewInfo = PipeRouterInfo { Pos = { 3063.9, 35.8932 } },
            }
         },
      }
   },
   ActiveTool = "AM_ResponsiveLowerThird_01"
}
Offline

kingluma

  • Posts: 24
  • Joined: Tue Apr 10, 2018 3:27 pm
  • Real Name: Dirk de Jong

Re: dimensions of flat text (bounding box) ?

PostSun Sep 16, 2018 11:48 am

joel.eggenberger wrote:I'm having the same issues like kingluma - it works well in fusion 9 Standalone, but as soon as I switch into Resolve the Performance is horrible and it crashes many times! I think Resolve has a problem with the Custom Tool.


That specific problem I was seeing seemed to have been fixed in a subsequent resolve 15 public beta - and I just did a quick check in the current 15.1 release and it seems OK there too. maybe there's something else going on ? I didn't try grabbing the code you posted and trying to run that but I will try to do that soon. FWIW I happen to be on Mac OS and haven't tested it recently on Windows
Offline

dpower

  • Posts: 16
  • Joined: Thu Jun 27, 2019 7:07 pm
  • Location: Brooklyn, NY
  • Real Name: David Power

Re: dimensions of flat text (bounding box) ?

PostThu Jun 27, 2019 7:30 pm

Bryan Ray, et al.,

The info you've provided above is fantastic. And it's working well for me...

Provided the text node is visible.

If it's occluded by a mask (for instance), values for Text1.Output.DataWindow[N] change... and eventually go to zero when the entire node is occluded.

I understand why this happens. But at the same time, there should be a way to obtain the dimensions of a text element even when it's not visible. After all, the text string itself continues to have dimensions whether or not you can see it.

I'm finding advanced Fusion expression info hard to find. Thanks to anyone who can offer advice.
Offline
User avatar

Bryan Ray

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

Re: dimensions of flat text (bounding box) ?

PostThu Jun 27, 2019 10:48 pm

Make an instance of the Text+ node that doesn't get any masking. Then either reference the DoD of that node directly or use a SetDomain in Adjust Mode to Copy the DoD from the unmasked Text+ to the masked one:

Code: Select all
{
   Tools = ordered() {
      Rectangle2 = RectangleMask {
         CtrlWZoom = false,
         Inputs = {
            MaskWidth = Input { Value = 2048, },
            MaskHeight = Input { Value = 1152, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.757234726688103, 0.5 }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -676.5 } },
      },
      Text1 = TextPlus {
         Inputs = {
            GlobalIn = Input { Value = 1001, },
            GlobalOut = Input { Value = 6000, },
            Width = Input { Value = 2048, },
            Height = Input { Value = 1152, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Size = Input { Value = 0.2863, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "text", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            EffectMask = Input {
               SourceOp = "Rectangle2",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -610.5 } },
      },
      Instance_Text1 = TextPlus {
         SourceOp = "Text1",
         Inputs = {
            ["Gamut.ColorSpaceNest"] = Input { },
            ["Gamut.GammaSpaceNest"] = Input { },
            LayoutRotation = Input { },
            InternationalFontControls = Input { },
            AdvancedFontControls = Input { },
            Alignment = Input { },
            LineRotation = Input { },
            WordRotation = Input { },
            CharacterRotation = Input { },
            Options1 = Input { },
            Color1 = Input { },
            Softness1 = Input { },
            Transform1 = Input { },
            StartEndRenderScripts = Input { },
            EffectMask = Input { }
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -511.5 } },
      },
      SetDomain1 = SetDomain {
         Inputs = {
            Input = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Instance_Text1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 2035, -610.5 } },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

dpower

  • Posts: 16
  • Joined: Thu Jun 27, 2019 7:07 pm
  • Location: Brooklyn, NY
  • Real Name: David Power

Re: dimensions of flat text (bounding box) ?

PostFri Jun 28, 2019 1:34 pm

Bryan,

Your solution is brilliant in its simplicity. I appreciate you taking the time to share it.

Rather than hijacking this thread, I'll start a new one outlining what I'm trying to accomplish and the challenges I'm facing. I'll appreciate any thoughts you care to offer there.

Intuitively, my goal should be possible but at this stage, a number of aspects of Fusion are far from intuitive for me.

Much thanks again for your reply.
Offline

T-Light

  • Posts: 12
  • Joined: Mon Jul 08, 2019 4:58 pm
  • Real Name: Brent Holmes

Re: dimensions of flat text (bounding box) ?

PostMon Jul 08, 2019 5:01 pm

Sorry for reviving an old thread.
Just wanted to say a big thankyou Bryan.
Offline

byscense

  • Posts: 6
  • Joined: Fri Nov 15, 2019 7:07 am
  • Real Name: Chris Samoza

Re: dimensions of flat text (bounding box) ?

PostTue Dec 17, 2019 8:05 am

Bryan Ray wrote:Make an instance of the Text+ node that doesn't get any masking. Then either reference the DoD of that node directly or use a SetDomain in Adjust Mode to Copy the DoD from the unmasked Text+ to the masked one:

Code: Select all
{
   Tools = ordered() {
      Rectangle2 = RectangleMask {
         CtrlWZoom = false,
         Inputs = {
            MaskWidth = Input { Value = 2048, },
            MaskHeight = Input { Value = 1152, },
            PixelAspect = Input { Value = { 1, 1 }, },
            ClippingMode = Input { Value = FuID { "None" }, },
            Center = Input { Value = { 0.757234726688103, 0.5 }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -676.5 } },
      },
      Text1 = TextPlus {
         Inputs = {
            GlobalIn = Input { Value = 1001, },
            GlobalOut = Input { Value = 6000, },
            Width = Input { Value = 2048, },
            Height = Input { Value = 1152, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Size = Input { Value = 0.2863, },
            Font = Input { Value = "Open Sans", },
            StyledText = Input { Value = "text", },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = ""
               },
            },
            EffectMask = Input {
               SourceOp = "Rectangle2",
               Source = "Mask",
            }
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -610.5 } },
      },
      Instance_Text1 = TextPlus {
         SourceOp = "Text1",
         Inputs = {
            ["Gamut.ColorSpaceNest"] = Input { },
            ["Gamut.GammaSpaceNest"] = Input { },
            LayoutRotation = Input { },
            InternationalFontControls = Input { },
            AdvancedFontControls = Input { },
            Alignment = Input { },
            LineRotation = Input { },
            WordRotation = Input { },
            CharacterRotation = Input { },
            Options1 = Input { },
            Color1 = Input { },
            Softness1 = Input { },
            Transform1 = Input { },
            StartEndRenderScripts = Input { },
            EffectMask = Input { }
         },
         ViewInfo = OperatorInfo { Pos = { 1870, -511.5 } },
      },
      SetDomain1 = SetDomain {
         Inputs = {
            Input = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Instance_Text1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 2035, -610.5 } },
      }
   }
}


When I try to get the bounding box of the Mask itself, all outputs are 0.0,
Rect1.Output.DataWindow[1] returns 0.0.

Any idea how I can get it ?
Offline
User avatar

Bryan Ray

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

Re: dimensions of flat text (bounding box) ?

PostMon Mar 30, 2020 6:27 pm

It's been a couple of months, but someone elsewhere directed my attention here. The output of a Mask tool isn't called Output. It's called Mask. So what you want is Rect1.Mask.DataWindow[1]
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 37 guests