scripting_examples
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting_examples [2024/09/22 13:07] – [Changes the font colour of a specific text field (SetTextColour)] peteraellig | scripting_examples [2025/12/05 10:53] (current) – [Which input is active at PREVIEW] peteraellig | ||
|---|---|---|---|
| Line 190: | Line 190: | ||
| loop | loop | ||
| </ | </ | ||
| + | |||
| + | ===== Script to switch the active input to the next one ===== | ||
| + | Switches output to 2 when output is 1, to 3 when it is 2, etc. | ||
| + | |||
| + | < | ||
| + | 'get the API data from vMix | ||
| + | Dim xml As String = API.XML() | ||
| + | Dim x As New System.Xml.XmlDocument() | ||
| + | x.LoadXml(xml) | ||
| + | |||
| + | 'get active input | ||
| + | Dim activeNumber As Integer = Integer.Parse(x.SelectSingleNode("/ | ||
| + | |||
| + | ' get number of inputs | ||
| + | Dim inputCount As Integer = x.SelectNodes("/ | ||
| + | |||
| + | ' | ||
| + | Dim nextInput As Integer = activeNumber + 1 | ||
| + | |||
| + | 'this is, if you want to do someting at the beginning of the inputs (1), it starts again at the last one. | ||
| + | If nextInput > inputCount Then nextInput = 1 ' wrap | ||
| + | |||
| + | ' cut to the next input | ||
| + | API.Function(" | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Script to switch the active input to the previous one ===== | ||
| + | Switches output to 3 when output is 4, to 2 when it is 3, etc. | ||
| + | |||
| + | < | ||
| + | 'get the API data from vMix | ||
| + | Dim xml As String = API.XML() | ||
| + | Dim x As New System.Xml.XmlDocument() | ||
| + | x.LoadXml(xml) | ||
| + | |||
| + | 'get active input | ||
| + | Dim activeNumber As Integer = Integer.Parse(x.SelectSingleNode("/ | ||
| + | |||
| + | 'get number of inputs | ||
| + | Dim inputCount As Integer = x.SelectNodes("/ | ||
| + | |||
| + | ' | ||
| + | Dim prevInput As Integer = activeNumber - 1 | ||
| + | |||
| + | 'wrap , returns to the highest if at 1 | ||
| + | If prevInput < 1 Then prevInput = inputCount | ||
| + | |||
| + | 'cut to the previous input | ||
| + | API.Function(" | ||
| + | </ | ||
| + | |||
| + | |||
| ===== Cut input to one of the outputs ===== | ===== Cut input to one of the outputs ===== | ||
| As of version 26, vMix has up to 16 so-called mix inputs (Aux or M/E) more than just the output (Mix1 or Mix0 in the API) These can then be routed to other outputs. (max. 6 outputs in vMix) So also set Mix! From version 27, more than two EXTERNAL OUTPUTS can be set, depending on the performance of the computer. From a QUADRO RTX 4000, 4 work perfectly. From the GeFroce RTX models of the 3000 series, more will also work. However, if the computer is still making slow or massive recordings, then I would only access these functions with a new A series card. | As of version 26, vMix has up to 16 so-called mix inputs (Aux or M/E) more than just the output (Mix1 or Mix0 in the API) These can then be routed to other outputs. (max. 6 outputs in vMix) So also set Mix! From version 27, more than two EXTERNAL OUTPUTS can be set, depending on the performance of the computer. From a QUADRO RTX 4000, 4 work perfectly. From the GeFroce RTX models of the 3000 series, more will also work. However, if the computer is still making slow or massive recordings, then I would only access these functions with a new A series card. | ||
| Line 485: | Line 538: | ||
| Next | Next | ||
| </ | </ | ||
| + | |||
| + | ===== toggle all Audio outputs===== | ||
| + | < | ||
| + | ' | ||
| + | Dim busValues As String() = {" | ||
| + | For Each value As String In busValues | ||
| + | API.Function(" | ||
| + | Next</ | ||
| + | |||
| + | ===== turn all audio outputs off (not Master) ===== | ||
| + | < | ||
| + | Dim busValues As String() = {" | ||
| + | For Each value As String In busValues | ||
| + | API.Function(" | ||
| + | Next</ | ||
| + | |||
| + | ===== turn all audio outputs ON (not Master) ===== | ||
| + | < | ||
| + | Dim busValues As String() = {" | ||
| + | For Each value As String In busValues | ||
| + | API.Function(" | ||
| + | Next</ | ||
| + | |||
| + | ===== turn on, off, toggle, Audio Master ===== | ||
| + | < | ||
| + | < | ||
| + | oder toggle | ||
| + | < | ||
| + | |||
| ===== gets Audio Titelname from a INPUT (Musictitle) ===== | ===== gets Audio Titelname from a INPUT (Musictitle) ===== | ||
| Line 729: | Line 811: | ||
| argb values and names can be found here\\ | argb values and names can be found here\\ | ||
| [[https:// | [[https:// | ||
| + | |||
| + | <fc # | ||
| + | Example: #FF0000 becomes %23FF0000\\</ | ||
| + | |||
| + | You can use HEX rgba values for one color\\ | ||
| + | SAMPLE: rgba(red, green, blue, alpha)\\ | ||
| + | |||
| + | #FF0000 for red 100% visible\\ | ||
| + | #FF00007F for red 50% transparent, | ||
| + | |||
| + | |||
| ATTENTION: vmix uses colour for this command, not color\\ | ATTENTION: vmix uses colour for this command, not color\\ | ||
| \\ | \\ | ||
| < | < | ||
| - | ===== Changes the font colour of a specific text field depending on a numerical value ===== | + | ===== Changes the font colour of a specific text field depending on a numerical value (SetTextColour)===== |
| + | |||
| + | <fc # | ||
| + | Example: #FF0000 becomes %23FF0000\\</ | ||
| + | |||
| + | You can use HEX rgba values for one color\\ | ||
| + | SAMPLE: rgba(red, green, blue, alpha)\\ | ||
| + | |||
| + | #FF0000 for red 100% visible\\ | ||
| + | #FF00007F for red 50% transparent, | ||
| If a text field displays a certain value, the text colour is changed with this script. This can be the text colour of the text field that displays the value or a different one.\\ | If a text field displays a certain value, the text colour is changed with this script. This can be the text colour of the text field that displays the value or a different one.\\ | ||
| + | The script example uses the title ‘Title 0- The Classic Blue.gtzip’ contained in vMix. Change the title name and the field from which you want to get the numerical value and the field from which you want to change the colour.\\ | ||
| < | < | ||
| Line 755: | Line 858: | ||
| ' depending on a value, it changes the color of the text | ' depending on a value, it changes the color of the text | ||
| + | ' you can use any logical funktion like: | ||
| + | ' If numericvalue < 10 Then | ||
| + | ' If numericvalue > 10 Then | ||
| + | ' If numericvalue < 100 Or numericvalue > 200 Then (all from 100 to 199) | ||
| + | ' If numericvalue Mod 2 = 0 Then (only even number) | ||
| + | ' If numericvalue Mod 10 = 0 Then (only 10, | ||
| + | ' etc.... | ||
| + | | ||
| If numericvalue = 10 Then | If numericvalue = 10 Then | ||
| API.Function(" | API.Function(" | ||
| Line 768: | Line 879: | ||
| </ | </ | ||
| - | ===== Changes shape color of a specific shape, e.g. a circle or a rectangle) (Setcolor) ===== | + | ===== Changes shape color of a specific shape, e.g. a circle or a rectangle (Setcolor) ===== |
| Changes shape color of a specific shape, e.g. a circle or a rectangle) (Setcolor) | Changes shape color of a specific shape, e.g. a circle or a rectangle) (Setcolor) | ||
| Line 792: | Line 903: | ||
| This is a script that shows how to read the color of a shape from a title and then perform an action based on the color. The script must be started and runs in the background as a loop. | This is a script that shows how to read the color of a shape from a title and then perform an action based on the color. The script must be started and runs in the background as a loop. | ||
| - | the title used in the example can be downloaded {{ :: | + | the title used in the example can be downloaded {{ :: |
| - | {{: | + | {{: |
| gets the color value of a shape in a gtzip-title: | gets the color value of a shape in a gtzip-title: | ||
scripting_examples.1727003241.txt.gz · Last modified: by peteraellig
