Recent Posts

Expression Builder Plugin V2.0

Overview Installation UI Overview Expression Builder Open / Load Save Copy Search Page Keywords Copy Glossary Categories Copy to Clipboard Hints Links Expression Builder is for Davinci Resolve Studio version 18. Expression Builder lite will be available soon for Davinci Resolve. Overview Expression Builder assists those learning Fusion Expressions and contains hundreds of examples, however, expressions can be almost limitless and we are adding more every day. New expressions will be available through or update schedule, which is why it is important to include your correct email address. The plugin is capable of saving and loading your own custom expressions for modification or reuse. Expressions can be saved as a .txt .setting or .comp file but must be given a name and extension prior to 'save'. If you wish to contribute your expressions to be included in a future update then you can do so here. Submit an Expression Download and Installation Extract the Expression Builder zip f

Moving Control Position in the inspector

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:-

  1.                                 Input1 = InstanceInput {
  2. SourceOp = "Text1",
  3. Source = "StyledText",
  4. },
  5. Input2 = InstanceInput {
  6. SourceOp = "Text1",
  7. Source = "Font",
  8. ControlGroup = 2,
  9. },
  10. Input3 = InstanceInput {
  11. SourceOp = "Text1",
  12. Source = "Style",
  13. ControlGroup = 2,
  14. },
Matches the code above

To move the controls we simply rearrange them in the code.

  1.                                 Input2 = InstanceInput {
  2. SourceOp = "Text1",
  3. Source = "Font",
  4. ControlGroup = 2,
  5. },
  6. Input3 = InstanceInput {
  7. SourceOp = "Text1",
  8. Source = "Style",
  9. ControlGroup = 2,
  10. },
  11. Input1 = InstanceInput {
  12. SourceOp = "Text1",
  13. Source = "StyledText",
  14. },

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
  1. {
  2. Tools = ordered() {
  3. DropDown = MacroOperator { 
  4. Inputs = ordered() {
  5. -- label instance
  6. Label01 = InstanceInput {
  7. SourceOp = "Text1",
  8. Source = "Label01",
  9. },
  10. -- end of label instance
  11. Input1 = InstanceInput {
  12. SourceOp = "Text1",
  13. Source = "StyledText",
  14. },
  15. Input2 = InstanceInput {
  16. SourceOp = "Text1",
  17. Source = "Font",
  18. ControlGroup = 2,
  19. },
  20. Input3 = InstanceInput {
  21. SourceOp = "Text1",
  22. Source = "Style",
  23. ControlGroup = 2,
  24. },
  25. Input4 = InstanceInput {
  26. SourceOp = "Text1",
  27. Source = "Red1Clone",
  28. Name = "Color",
  29. ControlGroup = 3,
  30. Default = 1,
  31. },
  32. Input5 = InstanceInput {
  33. SourceOp = "Text1",
  34. Source = "Green1Clone",
  35. ControlGroup = 3,
  36. Default = 1,
  37. },
  38. Input6 = InstanceInput {
  39. SourceOp = "Text1",
  40. Source = "Blue1Clone",
  41. ControlGroup = 3,
  42. Default = 1,
  43. },
  44. Input7 = InstanceInput {
  45. SourceOp = "Text1",
  46. Source = "Alpha1Clone",
  47. ControlGroup = 3,
  48. Default = 1,
  49. },
  50. Input8 = InstanceInput {
  51. SourceOp = "Text1",
  52. Source = "Size",
  53. Default = 0.16,
  54. },
  55. Input9 = InstanceInput {
  56. SourceOp = "Text1",
  57. Source = "CharacterSpacingClone",
  58. Name = "Tracking",
  59. Default = 1,
  60. },
  61. -- label instance
  62. Label02 = InstanceInput {
  63. SourceOp = "Background1",
  64. Source = "Label02",
  65. },
  66. -- end of label instance
  67. Input10 = InstanceInput {
  68. SourceOp = "Background1",
  69. Source = "Type",
  70. },
  71. Input11 = InstanceInput {
  72. SourceOp = "Background1",
  73. Source = "TopLeftRed",
  74. Name = "Color",
  75. ControlGroup = 7,
  76. Default = 0,
  77. },
  78. Input12 = InstanceInput {
  79. SourceOp = "Background1",
  80. Source = "TopLeftGreen",
  81. ControlGroup = 7,
  82. Default = 0,
  83. },
  84. Input13 = InstanceInput {
  85. SourceOp = "Background1",
  86. Source = "TopLeftBlue",
  87. ControlGroup = 7,
  88. Default = 0,
  89. },
  90. },
  91. Outputs = {
  92. MainOutput1 = InstanceOutput {
  93. SourceOp = "Merge1",
  94. Source = "Output",
  95. }
  96. },
  97. ViewInfo = GroupInfo { Pos = { 0, 0 } },
  98. Tools = ordered() {
  99. Text1 = TextPlus {
  100. CtrlWZoom = false,
  101. Inputs = {
  102. Width = Input { Value = 1920, },
  103. Height = Input { Value = 1080, },
  104. UseFrameFormatSettings = Input { Value = 1, },
  105. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  106. StyledText = Input { Value = "DROPDOWN", },
  107. Font = Input { Value = "Open Sans", },
  108. Style = Input { Value = "Bold", },
  109. Size = Input { Value = 0.16, },
  110. VerticalJustificationNew = Input { Value = 3, },
  111. HorizontalJustificationNew = Input { Value = 3, },
  112. ManualFontKerningPlacement = Input {
  113. Value = StyledText {
  114. Array = {
  115. },
  116. Value = ""
  117. },
  118. },
  119. },
  120. ViewInfo = OperatorInfo { Pos = { 990, -16.5 } },
  121. UserControls = ordered() {
  122. Label01 = {
  123. LINKS_Name = "Label01",
  124. LINKID_DataType = "Number",
  125. INPID_InputControl = "LabelControl",
  126. INP_Integer = false,
  127. LBLC_DropDownButton = true,
  128. LBLC_NumInputs = 9,
  129. INP_External = false,
  130. INP_Passive = true,
  131. }
  132. }
  133. },
  134. Background1 = Background {
  135. Inputs = {
  136. Width = Input { Value = 1920, },
  137. Height = Input { Value = 1080, },
  138. UseFrameFormatSettings = Input { Value = 1, },
  139. ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
  140. TopLeftAlpha = Input { Value = 0, },
  141. },
  142. ViewInfo = OperatorInfo { Pos = { 880, 49.5 } },
  143. UserControls = ordered() {
  144. Label02 = {
  145. LINKS_Name = "Label02",
  146. LINKID_DataType = "Number",
  147. INPID_InputControl = "LabelControl",
  148. INP_Integer = false,
  149. LBLC_DropDownButton = true,
  150. LBLC_NumInputs = 4,
  151. INP_External = false,
  152. INP_Passive = true,
  153. }
  154. }
  155. },
  156. Merge1 = Merge {
  157. Inputs = {
  158. Background = Input {
  159. SourceOp = "Background1",
  160. Source = "Output",
  161. },
  162. Foreground = Input {
  163. SourceOp = "Text1",
  164. Source = "Output",
  165. },
  166. PerformDepthMerge = Input { Value = 0, },
  167. },
  168. ViewInfo = OperatorInfo { Pos = { 990, 49.5 } },
  169. }
  170. },
  171. }
  172. },
  173. ActiveTool = "DropDown"
  174. }
  175. 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

Popular posts from this blog

DaVinci Resolve Expressions

Expression Builder Plugin V2.0

Organising The Fonts Folder