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

Labels and Drop Down Menus

I really wish I could find an interface between Blogger and my brain, I have a lot of articles to write but can't get them posted fast enough. Although it's not the posting per se it's the typing and time to do it.

As I wait for a delivery of a Henry Vacuum cleaner as both vacuums in the house have been killed whilst cleaning up my decorating escapades. I thought I would at least start another article. 

Labels And Drop Down Menus.

Strap yourself in and grab a coffee you are in for a wild ride. I wish someone had written a manual for DaVinci Resolve's hidden features. Currently, there are around a trillion snippets of information spilled over the internet. There is a massive manual but I think some of the pages must have fallen out. One day I may even write a manual, maybe when I retire to my narrowboat on the English canal network. 

On a completely unrelated topic, I worked in the tourism industry for fifteen years and when based in Lanzarote airport their was a company called "Canal Tours" and the meet and greet person used to cover the letter "C" with his fingers when he was greeting flights.

Assumptions.

  • You are on the fusion page
  • You are either modifying an existing tool/effect or creating your own.
  • The result will be a GroupOperator/MacroOperator
  • The result can be for fusion, edit page, or cut page.

Labels

In this article, a label is referring to a label in the inspector to identify a section of controls.

Look at me, I managed a screenshot

A label is the easiest thing I am going to write about today and needs a little forethought. A label is classed as a control and will always get placed at the bottom of the inspector. So it is best practice to create your label first before adding any other tools. 

The only problem is when you want to add a label to an existing control. There are two ways to move the position of the label in the inspector, one is to edit the code the other is to select each individual control in the "edit controls" panel. Editing the code is far easier but I will explain both.

Adding a simple label gets even more confusing when building a macro as the label will end up on the wrong control page as most nodes do not have "Controls" as a page option. This is not an issue when editing the code as you can place the label anywhere you want with a simple cut & paste. Fixing this inside resolve is possible but currently, a pain in the arse as you have to use "edit controls" on the macro and resave it.

I suppose I should explain how to create a label in the first place as after all that is why you are here. There is more than one way so I will list both.

Official Way (which is limited to the number of labels you can add)

  1. Select the node you want the label on
  2. Right-click and choose "Edit Controls"
  3. Select the drop-down next to the ID: "NewControl"
  4. Select "Blank2" or "Blank5"
  5. Type the labels name above the "Blank2"
  6. Leave "Type" as "Number"
  7. Select the "Page" you want the label to be on
  8. Uncheck "Animatable"
  9. Check "Passive"
  10. Input Crtl select LabelControl
  11. Select "OK"


You have just created a basic label, this will appear in the inspector at the bottom of the page you selected.

Another Way (As many labels as you would like)

  1. Select the node you want the label(s) on
  2. Right-click and choose "Edit Controls"
  3. Over Type Name: "New Contol" with your label title
  4. Leave "Type" as "Number"
  5. Select the "Page" you want the label to be on
  6. Uncheck "Animatable"
  7. Check "Passive"
  8. Input Crtl select LabelControl
  9. Select "OK"
This method has created a new control which the "SourceOp" has the same name as your label. No need to know what "SourceOp" is just yet. In the previous version, the "SourceOp" was "Blank2"

As rearranging the position of labels and drop-down menus is the same I will move on to creating a drop-down and then wrap things up with how to move them.

Drop-down menus can be a real pain and I will state from the outset that the coding method is far quicker. However, it is possible to stay within resolve to add them and position them it just seems clunky. 

If you have created a label then you have most of the steps down, we just need to tweak them.

Official Way (which is limited to the number of drop-downs you can add)

  1. Select the node you want the label on
  2. Right-click and choose "Edit Controls"
  3. Select the drop-down next to ID: "NewControl"
  4. Select "Blank2" or "Blank5"
  5. Type the labels name above the "Blank2"**
  6. Leave "Type" as "Number"
  7. Select the "Page" you want the label to be on
  8. Uncheck "Animatable"
  9. Check "Passive"
  10. In "Default" 0 is closed and 1 is open
  11. Input Crtl select LabelControl
  12. Check "Show Arrow"
  13. "Hide Next#" Enter the number of controls the drop-down will have below it. *
  14. "Nest Level" Same as "Hide Next" 
  15. Select "OK" 
* not easy as you haven't built the macro yet, this will either come with experience or we can change it directly in the code.

**There is an error known as name clash so be aware of what you call your drop-down. Avoid control names (Angle, Size) & Node Names, take special care when you have added any expressions as it will completely cock it up. I use Label01, Label02, etc, and change the name in the code, that way I can name it anything I want.



Before I continue I can hear those experienced macro builders shouting at the screen. Yes, there are other ways, however, if you haven't done it before this is, in my opinion, an easy way.

The next option for drop-down menus is a commitment to dabble with the code, although coding is far quicker and more powerful it is not for everyone. Saying that once you see the hoops you have to jump through to stay within resolve, I bet you take up coding. 

The next option is in two parts, you add a drop-down inside fusion and then make it visible in the inspector by adding a few lines of code to the macro.

Another Way (As many drop-downs as you would like)

  1. Select the node you want the label on
  2. Right-click and choose "Edit Controls"
  3. Over Type Name: "New Contol" with your drop-down title**
  4. Leave "Type" as "Number"
  5. Select the "Page" you want the drop-down to be on
  6. Uncheck "Animatable"
  7. Check "Passive"
  8. In "Default" 0 is closed and 1 is open
  9. Input Crtl select LabelControl
  10. Check "Show Arrow"
  11. "Hide Next#" Enter the number of controls the drop-down will have below it. *
  12. "Nest Level" not required
  13. Select "OK" 
* not easy as you haven't built the macro yet, this will either come with experience or we can change it directly in the code.

**There is an error known as name clash so be aware of what you call your drop-down. Avoid control names like Angle, Size & Node Names, take special care when you have added any expressions as it will completely cock it up. I use Label01, Label02, etc, and change the name in the code, that way I can name it anything I want afterward.

To make the "Another Way" drop-down visible in the inspector you have to complete building your GroupOperator/MacroOperator and then open it in a text editor. 

Once you have created your composition and saved it as a .setting file you can view its contents in a text editor. The advantages to editing the code are:-
  • It's a lot quicker than changing stuff inside resolve
  • Move things around super easy
  • Add custom attributes and sex it up
  • Add comments and info
  • Change default settings without rebuilding the macro/group
  • Add links to internal/external websites
  • Create a button which the user can use to run a script, run another app, open a popup window with previews in. 
  • Set the "F1" help key, and a whole lot more.
At the very top of the code, you are going to see something very similar to this:-
  1. {
  2. Tools = ordered() {
  3. DropDown = MacroOperator { 
  4. Inputs = ordered() {
Line 4 is the start of the controls you see in the inspector. You would add the Label Code Snippet below line 4 but at the top of the control (node), you added the label to.

-- label instance
  1. Label = InstanceInput {
  2. SourceOp = "Text1",
  3. Source = "Label",
  4. },
-- end of label instance
 Above is the code to add a label:-
--Label Instance is a comment

1. Label = InstanceInput { --Label is the name I gave my drop-down.
2. SourceOp = "Text1" -- This is the node I added the label to.
3. Source = "Label" --this must match the label title (not always)
4. }, --closes the code, the comma is important.

--end of label instance is a comment

That piece of code displays the drop-down in the inspector, however, if you didn't use "edit controls" inside fusion nothing happens. That code is lower down just below the actual tool.

I can hear you thinking, "Well that is as clear as mud". It takes some time to navigate your way around the code but after a few Years, Weeks, you get the hang of it.

What follows is the code for the title I made which consists of a "Background1" "Merge1" "Text1" and although there is a "MediaOut" in the fusion node graph, you don't have to include it in a macro. There are occasions when you do want to include a "MediaOut" in a macro.




I will break it down for you and later we will customise it.
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. }
That is the basic overview of adding drop-down menus in the inspector via the code, let's take a look at how to do this within resolve.

Adding drop-down menus whilst staying inside resolve requires you to create the MacroOperator/GroupOperator and then bring it back into the fusion graph. There are several ways to bring it back in.

  • Drag the .setting file from your computer into the node graph.
  • Copy the .setting file and paste it into the fusion graph
  • Add the macro to a timeline on the edit or cut page and then open it in fusion.
How to add a drop-down
  1. Select the node for your macro
  2. Right-click and select "edit controls"
  3. Over Type Name: "New Contol" with your drop-down title**
  4. Leave "Type" as "Number"
  5. Select the "Controls" page***
  6. Uncheck "Animatable"
  7. Check "Passive"
  8. In "Default" 0 is closed and 1 is open
  9. Input Crtl select LabelControl
  10. Check "Show Arrow"
  11. "Hide Next#" Enter the number of controls the drop-down will have below it. *
  12. "Nest Level" Same as "Hide Next" 
  13. Select "OK" 
* not easy as you haven't built the macro yet, this will either come with experience or we can change it directly in the code.

**There is an error known as name clash so be aware of what you call your drop-down. Avoid control names like Angle, Size & Node Names, take special care when you have added any expressions as it will completely cock it up. I use Label01, Label02, etc, and change the name in the code, that way I can name it anything I want afterward.

***The page for the label has to be the same as the page the controls appear in the inspector without the labels. Normally this will be "controls" unless you have customised it.

This is where the fun and games come in, you need to select the correct input from the "edit controls" drop-down menu to move the tool control below the label in the correct order. 

I found that experimenting helps here, so to see how it works follow the list below, you can then rearrange the tool controls as you wish later.
  1. Select the node of your macro.
  2. Right-click and select "edit controls".
  3. Use the drop-down arrow next to the ID: NewControl
  4. Select "Input1"
  5. Change Page to "Controls"
  6. Select "OK"
What you see will be determined by the entries in these two sections. 
  • "Hide Next#" Enter the number of controls the drop-down will have below it. *
  • "Nest Level" Same as "Hide Next" 

  • For example. You entered 1 in each, then you will see the "Styled Text" under the drop-down you created at the bottom of the inspector. You may need to open the drop-down to see it.

    The annoying part is you now have to determine the correct number for both
  • "Hide Next#" Enter the number of controls the drop-down will have below it. *
  • "Nest Level" Same as "Hide Next" 

  • Followed by selecting the correct "Input1", "Input2" etc.

    Did I mention changing the code was easier?

    Once you have all the tool controls you require below your drop-down you need to
    1. Select the node
    2. Right-click select settings > SaveAs
    3. Save with a different name
    Renaming is to avoid overwriting your original.

    I am going to pause here so we can all take a breath, especially me, I need a coffee. In a future post, I will explain what customisation is possible and how to add multiple labels to one tool (node) after you built the macro (.setting).

    I find changing and adapting the code far easier than playing inside resolve, so that's how we will be moving forward. 

    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