This post is a continuation of Labels and Drop-Down Menus.
NB: The full code for the comp is at the bottom of the post.
In the Labels and Drop-Down Menus post I made a simple title and then opened the .setting file in a text editor. I will be referring to that file here to ensure continuity and simplicity.
You do not have to add labels or drop-downs to move controls around in the inspector and can move controls in any .setting file.
The controls of a text node:-
- StyledText
- Font
- Font Weight
- Size
- Tracking
Moving controls within the same tool (Node) is straightforward, however, you need to be aware of ControlGroups. An example of a ControlGroup is "font" which has more than 1 control to enable it to work correctly. The 2 controls are font and style (font-weight). In the code below you will see that they are both in ControlGroup = 2, You can split ControlGroups, however, I suggest keeping them together for sanity.
When labels or drop-downs have been added, moving controls requires the number assigned in the node to be correct.
For simplicity, I am going to move "Font" & "Style" above the "StyledText"
Currently, the code which shows the controls in the inspector for "StyledText", "Font" and "Style" is:-
- Input1 = InstanceInput {
- SourceOp = "Text1",
- Source = "StyledText",
- },
- Input2 = InstanceInput {
- SourceOp = "Text1",
- Source = "Font",
- ControlGroup = 2,
- },
- Input3 = InstanceInput {
- SourceOp = "Text1",
- Source = "Style",
- ControlGroup = 2,
- },
|
Matches the code above |
To move the controls we simply rearrange them in the code.
- Input2 = InstanceInput {
- SourceOp = "Text1",
- Source = "Font",
- ControlGroup = 2,
- },
- Input3 = InstanceInput {
- SourceOp = "Text1",
- Source = "Style",
- ControlGroup = 2,
- },
- Input1 = InstanceInput {
- SourceOp = "Text1",
- Source = "StyledText",
- },
|
Code rearranged = Controls rearranged |
Looking at the code you will see that "Inputs1" to "Inputs9" make up the controls for the "Text1" node in our composition. When adding a Drop-Down we entered the number of controls in the "Edit Controls" "Hide Next#" section.
The corresponding code to "Hide Next#" is "LBLC_NumInputs = 9," in the label section of the code. When moving controls inside/outside a drop-down the LBLC_NumInputs number must match the number of controls within the drop-down. If the number is too low the controls will fall out of the drop-down, too high and the controls can nest (break).
To be continued.....
The whole code of our simple title
All the green text is what you see in the inspector, these are the controls we checked in the "macro editor"
The text in Fuschia is the label we added, directly to the code.
The red text is the output, in fusion this would connect to the MediaOut. In the cut & edit page resolve handles this for you.
The yellow text is the code that makes up the node.
The aqua text is the label added using "edit controls" we can seriously customise this section.
--This is a comment
- {
- Tools = ordered() {
- DropDown = MacroOperator {
- Inputs = ordered() {
- -- label instance
- Label01 = InstanceInput {
- SourceOp = "Text1",
- Source = "Label01",
- },
- -- end of label instance
- Input1 = InstanceInput {
- SourceOp = "Text1",
- Source = "StyledText",
- },
- Input2 = InstanceInput {
- SourceOp = "Text1",
- Source = "Font",
- ControlGroup = 2,
- },
- Input3 = InstanceInput {
- SourceOp = "Text1",
- Source = "Style",
- ControlGroup = 2,
- },
- Input4 = InstanceInput {
- SourceOp = "Text1",
- Source = "Red1Clone",
- Name = "Color",
- ControlGroup = 3,
- Default = 1,
- },
- Input5 = InstanceInput {
- SourceOp = "Text1",
- Source = "Green1Clone",
- ControlGroup = 3,
- Default = 1,
- },
- Input6 = InstanceInput {
- SourceOp = "Text1",
- Source = "Blue1Clone",
- ControlGroup = 3,
- Default = 1,
- },
- Input7 = InstanceInput {
- SourceOp = "Text1",
- Source = "Alpha1Clone",
- ControlGroup = 3,
- Default = 1,
- },
- Input8 = InstanceInput {
- SourceOp = "Text1",
- Source = "Size",
- Default = 0.16,
- },
- Input9 = InstanceInput {
- SourceOp = "Text1",
- Source = "CharacterSpacingClone",
- Name = "Tracking",
- Default = 1,
- },
- -- label instance
- Label02 = InstanceInput {
- SourceOp = "Background1",
- Source = "Label02",
- },
- -- end of label instance
- Input10 = InstanceInput {
- SourceOp = "Background1",
- Source = "Type",
- },
- Input11 = InstanceInput {
- SourceOp = "Background1",
- Source = "TopLeftRed",
- Name = "Color",
- ControlGroup = 7,
- Default = 0,
- },
- Input12 = InstanceInput {
- SourceOp = "Background1",
- Source = "TopLeftGreen",
- ControlGroup = 7,
- Default = 0,
- },
- Input13 = InstanceInput {
- SourceOp = "Background1",
- Source = "TopLeftBlue",
- ControlGroup = 7,
- Default = 0,
- },
- },
- Outputs = {
- MainOutput1 = InstanceOutput {
- SourceOp = "Merge1",
- Source = "Output",
- }
- },
- ViewInfo = GroupInfo { Pos = { 0, 0 } },
- Tools = ordered() {
- Text1 = TextPlus {
- CtrlWZoom = false,
- Inputs = {
- Width = Input { Value = 1920, },
- Height = Input { Value = 1080, },
- UseFrameFormatSettings = Input { Value = 1, },
- ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
- StyledText = Input { Value = "DROPDOWN", },
- Font = Input { Value = "Open Sans", },
- Style = Input { Value = "Bold", },
- Size = Input { Value = 0.16, },
- VerticalJustificationNew = Input { Value = 3, },
- HorizontalJustificationNew = Input { Value = 3, },
- ManualFontKerningPlacement = Input {
- Value = StyledText {
- Array = {
- },
- Value = ""
- },
- },
- },
- ViewInfo = OperatorInfo { Pos = { 990, -16.5 } },
- UserControls = ordered() {
- Label01 = {
- LINKS_Name = "Label01",
- LINKID_DataType = "Number",
- INPID_InputControl = "LabelControl",
- INP_Integer = false,
- LBLC_DropDownButton = true,
- LBLC_NumInputs = 9,
- INP_External = false,
- INP_Passive = true,
- }
- }
- },
- Background1 = Background {
- Inputs = {
- Width = Input { Value = 1920, },
- Height = Input { Value = 1080, },
- UseFrameFormatSettings = Input { Value = 1, },
- ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
- TopLeftAlpha = Input { Value = 0, },
- },
- ViewInfo = OperatorInfo { Pos = { 880, 49.5 } },
- UserControls = ordered() {
- Label02 = {
- LINKS_Name = "Label02",
- LINKID_DataType = "Number",
- INPID_InputControl = "LabelControl",
- INP_Integer = false,
- LBLC_DropDownButton = true,
- LBLC_NumInputs = 4,
- INP_External = false,
- INP_Passive = true,
- }
- }
- },
- Merge1 = Merge {
- Inputs = {
- Background = Input {
- SourceOp = "Background1",
- Source = "Output",
- },
- Foreground = Input {
- SourceOp = "Text1",
- Source = "Output",
- },
- PerformDepthMerge = Input { Value = 0, },
- },
- ViewInfo = OperatorInfo { Pos = { 990, 49.5 } },
- }
- },
- }
- },
- ActiveTool = "DropDown"
- }
Thanks for taking the time to read this post and if you would like to buy me a coffee, pizza, narrowboat then it is greatly appreciated.
Comments
Post a Comment