davinci-resolve-mcp 2.33.0 → 2.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,259 @@
1
+ # Control Reference
2
+
3
+ Two distinct mechanisms for adding controls to your effect:
4
+
5
+ 1. **`InstanceInput`** — re-expose an *existing* internal node parameter at the Group level. Used 95% of the time.
6
+ 2. **`UserControls`** — declare a *brand new* control on any node. Use when you need a button, label, or control that doesn't map to an existing node input.
7
+
8
+ Most templates mix both: `UserControls` declares the new controls, `InstanceInput` re-exposes them on the Group so they appear in the Edit-page inspector.
9
+
10
+ ## 1. `InstanceInput` Attributes (Complete Catalog)
11
+
12
+ ```lua
13
+ Name = InstanceInput {
14
+ -- REQUIRED
15
+ SourceOp = "InternalNodeName",
16
+ Source = "InternalParamName",
17
+
18
+ -- LABEL & PLACEMENT
19
+ Name = "Display Label", -- defaults to Source
20
+ Page = "Controls", -- inspector tab (creates tab if new)
21
+ ControlGroup = 4, -- collapse adjacent inputs into one widget
22
+
23
+ -- NUMERIC DEFAULTS & RANGE
24
+ Default = 0.5, -- scalar default (numeric params)
25
+ DefaultX = 0.5, -- 2-component default X (points/sizes)
26
+ DefaultY = 0.5, -- 2-component default Y
27
+ DefaultText = "", -- placeholder string for text/file-picker params (ClipName, ColorFile1, etc.)
28
+ MinScale = 0, -- slider soft min
29
+ MaxScale = 1, -- slider soft max
30
+ -- NOTE: MinAllowed / MaxAllowed are UserControls-only keys. They are NOT valid on InstanceInput.
31
+
32
+ -- LIVE FORMULA
33
+ Expression = "OtherNode.Param + offset", -- binds value to a live Lua expression referencing other inputs
34
+ -- e.g. Expression = "Shape3D1_1.Transform3DOp.Translate.X+num1"
35
+
36
+ -- LAYOUT
37
+ Width = 0.5, -- 0..1 fraction of row width (for side-by-side)
38
+
39
+ -- USERCONTROLS RE-EXPOSURE
40
+ -- When re-exposing a UserControls entry, ICS_ControlPage and INP_Default may appear
41
+ -- inside the InstanceInput block to mirror the original UserControls definition.
42
+ ICS_ControlPage = "Controls",
43
+ INP_Default = 0,
44
+ },
45
+ ```
46
+
47
+ ### Common `Source` Values by Node Type
48
+
49
+ | Node type | Useful `Source` values |
50
+ |-----------|----------------------|
51
+ | `Blur` | `XBlurSize`, `YBlurSize`, `Filter`, `LockXY` |
52
+ | `Background` | `TopLeftRed/Green/Blue/Alpha`, `Type`, `Gradient`, `Center`, `Width`, `Height` |
53
+ | `Transform` | `Center`, `Size`, `Angle`, `Pivot`, `XSize`, `YSize` |
54
+ | `RectangleMask` / `EllipseMask` | `Center`, `Width`, `Height`, `Angle`, `BorderWidth`, `SoftEdge`, `Invert` |
55
+ | `Merge` | `Center`, `Size`, `Angle`, `Blend`, `ApplyMode`, `Operator` |
56
+ | `Dissolve` | `Mix`, `Operation`, `Map`, `["DFTLumaRamp.Softness"]`, `["DFTLumaRamp.Border"]` |
57
+ | `TextPlus` | `StyledText`, `Font`, `Style`, `Size`, `CharacterSpacingClone`, `LineSpacingClone`, `Center`, `VerticalJustificationTop/Center/Bottom`, `HorizontalJustificationLeft/Center/Right`, `Red`, `Green`, `Blue`, `Alpha`, `BackgroundColor` |
58
+ | `FastNoise` | `Detail`, `Contrast`, `Brightness`, `XScale`, `YScale`, `SeetheRate`, `Gradient`, `Type`, `GradientType`, `Center` |
59
+ | `Displace` | `Type`, `RefractionStrength`, `XRefraction`, `YRefraction`, `MaskChannel` |
60
+ | `ColorCorrector` | `WheelHue1..4`, `Saturation1..4`, `Gain1..4`, `Lift1..4`, `ColorRanges` |
61
+ | `Shape3D` | `Shape`, plus shape-specific namespaced params like `SurfaceCylinderInputs.Radius`, `SurfaceCylinderInputs.Height`, `SurfaceCylinderInputs.SubdivisionLevelBase` |
62
+ | `Transform3DOp` (inside any 3D node) | `Transform3DOp.Translate.X/Y/Z`, `Transform3DOp.Rotate.X/Y/Z`, `Transform3DOp.Pivot.X/Y/Z`, `Transform3DOp.Scale` |
63
+ | `MtlBlinn` / `MtlStdInputs` | `Diffuse.Color.Red/Green/Blue/Alpha`, `Specular.Color.*`, `Specular.Exponent`, `Diffuse.Opacity`, `Reflection.GlancingStrength`, `Reflection.FaceOnStrength` |
64
+ | `pEmitter` | `Number`, `["ParticleStyle.Size"]`, `["ParticleStyle.SizeVariance"]`, `["ParticleStyle.Red/Green/Blue"]`, `["CubeRgn.Width/Height/Depth"]`, `RandomSeed`, `Rotation`, `Spin`, `TemporalDistribution` |
65
+
66
+ Namespaced parameters (containing `.`) must be quoted and bracketed: `Source = "Diffuse.Color.Red"`.
67
+
68
+ ### `ControlGroup` Patterns
69
+
70
+ Group ids are arbitrary integers. Consecutive `InstanceInput`s sharing the same id merge into one inspector widget. The *first* input in the group is the "lead" and gets the widget label. Common patterns:
71
+
72
+ - **Color pickers:** 4 consecutive R/G/B/A inputs with matching `ControlGroup`. Lead input has `Name = "Color"`.
73
+ - **Vertical alignment (Top/Center/Bottom):** 3 consecutive checkbox-style inputs → single radio-button widget.
74
+ - **Horizontal alignment (Left/Center/Right):** same pattern.
75
+ - **Emphasis (Strikeout + Underline):** 2 consecutive inputs with matching group → single button bar.
76
+
77
+ Pick any free integer. Don't reuse within the same effect unless you mean to merge.
78
+
79
+ ## 2. `UserControls` — Adding New Controls
80
+
81
+ Declared inside any node:
82
+
83
+ ```lua
84
+ SomeNode = NodeType {
85
+ Inputs = { ... },
86
+ UserControls = ordered() {
87
+ ControlName = {
88
+ INPID_InputControl = "SliderControl", -- control type (REQUIRED)
89
+ LINKID_DataType = "Number", -- data type of the value
90
+ LINKS_Name = "Display Label",
91
+ ICS_ControlPage = "Controls",
92
+ INP_Default = 0.5,
93
+ INP_MinScale = 0,
94
+ INP_MaxScale = 1,
95
+ INP_Integer = false,
96
+ ICD_Width = 0.5,
97
+ },
98
+ },
99
+ },
100
+ ```
101
+
102
+ Once declared, the new control behaves like a real node input. You can read it from other nodes (`SourceOp = "SomeNode", Source = "ControlName"`) or re-expose it on the GroupOperator via an `InstanceInput`.
103
+
104
+ ### Control Types (`INPID_InputControl`)
105
+
106
+ | Type | Use for | Key extra fields |
107
+ |------|---------|------------------|
108
+ | `SliderControl` | Numeric slider (float or int) | `INP_MinScale`, `INP_MaxScale`, `INP_Default`, `INP_Integer`, `IC_Steps` |
109
+ | `CheckboxControl` | On/off toggle | `INP_Default` (0 or 1), `CBC_TriState` |
110
+ | `ButtonControl` | Clickable button | `BTNCS_Execute` — Lua snippet run when clicked |
111
+ | `LabelControl` | Section header (collapsible) | `LBLC_DropDownButton = true`, `LBLC_NumInputs = N` — see "Collapsible LabelControl Section Headers" below |
112
+ | `MultiButtonControl` | Radio group / tab bar | `MBTNC_StretchToFit`, `MBTNC_ShowName`, options as `{ MBTNC_AddButton = "Label" }` anonymous entries |
113
+ | `ColorControl` | Color picker (single value) | `CLRC_ShowWheel`, `CLRC_ShowSliders` |
114
+ | `ComboControl` | Dropdown menu | `CC_LabelPosition`, `LINKID_DataType = "Number"`, options as anonymous table entries `{ CCS_AddString = "Label" }` (see syntax note below) |
115
+ | `ScrewControl` | Rotary/dial for angle inputs | `INP_MinScale = -180`, `INP_MaxScale = 180`, `IC_Steps = 3601` |
116
+ | `TextEditControl` | Multi-line text input | `TEC_Lines` (line count), `TEC_Wrap` (bool), `TEC_ReadOnly` (bool), `LINKID_DataType = "Text"` or `"StyledText"` |
117
+ | `OffsetControl` | 2D crosshair/offset picker | `INPID_PreviewControl = "CrosshairControl"`, `CHC_Style`, `LINKID_DataType = "Point"` |
118
+ | `RangeControl` | Dual-handle range slider | Two sibling `RangeControl` entries sharing `IC_ControlGroup`; set `IC_ControlID = 1` on the first and `IC_ControlID = 0` on the second |
119
+
120
+ **`ComboControl` option syntax** — options are a table of anonymous entries, NOT numbered keys:
121
+
122
+ ```lua
123
+ -- CORRECT
124
+ BrushLoader = {
125
+ INPID_InputControl = "ComboControl",
126
+ LINKID_DataType = "Number",
127
+ LINKS_Name = "Brush",
128
+ ICS_ControlPage = "Controls",
129
+ INP_Integer = true,
130
+ { CCS_AddString = "Round" },
131
+ { CCS_AddString = "Square" },
132
+ { CCS_AddString = "Streaky" },
133
+ },
134
+ -- WRONG — [1] = "...", [2] = "..." does not work
135
+ ```
136
+
137
+ **`RangeControl` pair example:**
138
+
139
+ ```lua
140
+ RangeMin = {
141
+ INPID_InputControl = "RangeControl",
142
+ LINKID_DataType = "Number",
143
+ LINKS_Name = "Range",
144
+ IC_ControlGroup = 3,
145
+ IC_ControlID = 1,
146
+ INP_Default = 0,
147
+ },
148
+ RangeMax = {
149
+ INPID_InputControl = "RangeControl",
150
+ LINKID_DataType = "Number",
151
+ LINKS_Name = "Range",
152
+ IC_ControlGroup = 3,
153
+ IC_ControlID = 0,
154
+ INP_Default = 1,
155
+ },
156
+ ```
157
+
158
+ **Always include:**
159
+
160
+ - `LINKID_DataType` — `"Number"` for scalar controls, `"Point"` for 2D, `"Text"` for strings, `"Image"` for image inputs.
161
+ - `LINKS_Name` — the display label.
162
+ - `ICS_ControlPage` — which inspector tab the control lives on (`"Controls"` is conventional).
163
+ - `INPID_InputControl` — the type itself.
164
+
165
+ ### Width / Layout Fields
166
+
167
+ - **`ICD_Width`** — fraction 0..1 of the inspector row width. Two controls with `ICD_Width = 0.5` will sit side-by-side.
168
+ - **`Width`** (on `InstanceInput`) — same idea when layout is driven at the Group level.
169
+
170
+ ### Additional UserControls Attribute Catalog
171
+
172
+ - **`INP_External = false`** (134 stock occurrences) — marks a control as not exposed externally (not animatable/scriptable from the outside). Common on `LabelControl` entries.
173
+
174
+ - **`INP_Passive = true`** (6 occurrences) — marks a control as passive (not keyframeable). Often paired with `INP_External = false` on label/header controls.
175
+
176
+ - **`INP_SplineType = "Default"`** (4 occurrences) — sets the animation curve type for the input. Pass `"Default"` or a specific spline type string.
177
+
178
+ - **`IC_ControlPage`** (12 occurrences, integer) — numeric alternative to `ICS_ControlPage` (string). Used on Fusion-native nodes. `IC_ControlPage = 0` is the first page. Prefer `ICS_ControlPage` for named tabs in custom effects; use `IC_ControlPage` only when matching native node conventions.
179
+
180
+ - **`INPID_PreviewControl = "CrosshairControl"`** (2 occurrences) — names a viewport overlay widget. Used alongside `OffsetControl` to show a draggable crosshair in the Fusion viewer.
181
+
182
+ ### `ButtonControl` + `BTNCS_Execute`
183
+
184
+ Buttons run Lua snippets in Fusion's context. Common uses:
185
+
186
+ - **Preset buttons:** set several inputs at once.
187
+
188
+ ```lua
189
+ Button01 = {
190
+ INPID_InputControl = "ButtonControl",
191
+ LINKID_DataType = "Number",
192
+ LINKS_Name = "Center",
193
+ ICS_ControlPage = "Controls",
194
+ ICD_Width = 0.33,
195
+ BTNCS_Execute = "tool:SetInput('Input9',{0.5,0.5})\n tool:SetInput('Input10',{1.0,0.5})",
196
+ },
197
+ ```
198
+
199
+ - **Reset to defaults:** set a bunch of inputs back to known values.
200
+ - **Copy values between slots:** read one input, write another.
201
+
202
+ `tool` in the snippet refers to the node the button lives on. Use `tool:SetInput("Name", value)` and `tool:GetInput("Name")`. For colors and points, pass a table: `{r, g, b, a}` or `{x, y}`.
203
+
204
+ ### Page Name Conventions
205
+
206
+ The `Page` field on `InstanceInput` (and `ICS_ControlPage` in `UserControls`) is a free-form string — Resolve creates a new inspector tab for any new value. The stock library uses these values (most common first):
207
+
208
+ - `"Controls"` — default convention; use this unless you have a reason to separate
209
+ - `"Color"`, `"Gradient"`, `"Image"`, `"Animate"`, `"Noise"`
210
+ - `"Common Controls"`, `"BG"`, `"3D Controls"`, `"Materials"`, `"Transform"`
211
+
212
+ Keep tab names short and consistent within an effect. Mismatched capitalisation creates duplicate tabs.
213
+
214
+ ### Collapsible LabelControl Section Headers
215
+
216
+ 121 stock files use `LabelControl` with `LBLC_DropDownButton` to create collapsible inspector sections:
217
+
218
+ ```lua
219
+ UserControls = ordered() {
220
+ SectionHeader = {
221
+ LINKS_Name = "My Section",
222
+ LINKID_DataType = "Number",
223
+ INPID_InputControl = "LabelControl",
224
+ LBLC_DropDownButton = true, -- shows a collapse/expand arrow
225
+ LBLC_NumInputs = 5, -- number of following controls that collapse under this header
226
+ INP_External = false,
227
+ INP_Passive = true,
228
+ },
229
+ -- next 5 controls belong to this section...
230
+ },
231
+ ```
232
+
233
+ - **`LBLC_DropDownButton = true`** — enables the collapse/expand arrow on the header.
234
+ - **`LBLC_NumInputs = N`** — how many of the immediately following controls fold under this header when collapsed.
235
+ - Set `INP_External = false` and `INP_Passive = true` on the label itself so it doesn't appear as an animatable input.
236
+
237
+ ## 3. Exposing a `UserControls` Entry on the Group
238
+
239
+ Once declared, you address it just like a real input:
240
+
241
+ ```lua
242
+ -- On the GroupOperator:
243
+ ColorSection = InstanceInput {
244
+ SourceOp = "SomeNode", -- the node that declared the UserControls entry
245
+ Source = "ColorSection", -- the UserControls key
246
+ Page = "Controls",
247
+ },
248
+ ```
249
+
250
+ ## 4. Which Approach When
251
+
252
+ | Situation | Use |
253
+ |-----------|-----|
254
+ | You want to tweak a parameter that already exists on an internal node | `InstanceInput` |
255
+ | You want a color picker for an R/G/B/A set | 4× `InstanceInput` with same `ControlGroup` |
256
+ | You want a Top/Bottom/Center radio group | 3× `InstanceInput` with same `ControlGroup` on boolean params |
257
+ | You want a button that runs a Lua snippet | `UserControls { ButtonControl, BTNCS_Execute }` on a `Fuse.Wireless` carrier, then `InstanceInput` to expose |
258
+ | You want a section header | `UserControls { LabelControl, LBLC_NumInputs = N }` |
259
+ | You want a control whose value drives multiple nodes | Declare once in `UserControls`, then reference `SourceOp = "CarrierNode", Source = "ControlName"` from each internal node |