Recent Posts
Renaming Controls in the Inspector Using Code
- Get link
- X
- Other Apps
Why would you want to rename controls in the inspector?
- Aid in identifying the function of a control.
- Assist an end-user in identifying an appropriate control.
- Because we can.
This can be done without leaving resolve when building a Macro. You can change the names next to the controls you select in the Marco Editor. In Fusion, you can use "Edit Controls" to find the control you want to change the name in the ID: drop-down list. The problem with "Edit Controls" is the control will move to the bottom of the inspector on the page you selected.
Coding is easy and does not require resaving and renaming a macro/effect. You just save the code in the original macro/effect.
To change the name of a control is as simple as adding the following to the "InstanceInput"
Name = "New Name",
The original name is usually set inside the node, however, we can just overwrite it in the instance. In this example, I am going to change "Color" to "Font Color". You will notice that the instance for the font color already has Name = "Color" available so I can just add the word "Font".
- Input4 = InstanceInput {
- SourceOp = "Text1",
- Source = "Red1Clone",
- Name = "Font Color",
- ControlGroup = 3,
- Default = 1,
- },
- Input8 = InstanceInput {
- SourceOp = "Text1",
- Source = "Size",
- Default = 0.16,
- Name = "Font Size",
- },
The whole code of our simple title
- {
- 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 = "Font 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,
- Name = "Font Size",
- },
- 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.
- Get link
- X
- Other Apps
Comments
Post a Comment