-
Notifications
You must be signed in to change notification settings - Fork 33
Button widget and scripting
Button widget is most complex widget in UTC. Using it you can just execute some API functions or completely automate your work. With ExecLink capabilities it also can interact with another widgets.
By default commands in script executed sequentially, but with Condition and GoTo commands you can make branches and loops. Just don't forget to add Timer delay because script don't wait when command will be executed.
Except vMix API comands, there is some UTC native commands, which works only in UTC.
Timer command add delay in msec to execution flow.
ExecLink command execute named shortcut of any widget into controller. So you can make something like procedures, executing scripts from another buttons.
GoTo command set execution pointer to Command Index value, so you can skip or repeat some commands. Please, avoid infinite loops.
SetVariable command sets internal variable value. It's seen only in button script, you can't access it externally.
Condition command has two input parameters for fast access to input keys. So if you need compare two values from different titles, you don't need to copy-paste keys from your browser. There is two substitutions: {0}
for input 1 key and {1}
for input 2 key. You can use this substitutions in state access function.
Condition command opens condition branch, all commands between Condition and ConditionEnd executed if condition is true. Otherwise they will be skipped. In combination with GoTo command you can make If-Else statement.
- Condition
- IfCommand 1
- IfCommand 2
- ...
- GoTo 9
- ConditionEnd
- ElseCommand 1
- ElseCommand 2
- Command 1
- Command 2
So, if condition is true commands 2-5 executed, and 7-8 skipped; if condition is false, commands 7-8 executed and 2-5 are skipped.
HasVariable command is the same as condition, but just check that some variable is exists. You must close it with ConditionEnd command.
UpdateSTate command updates global UTC state, which affect on all widgets.
UpdateInternalButtonState command updates state, which used only into state dependent buttons.
All other commands are from vMix API, you can add them manually to Functions.xml file, or use existing ones.