logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
TL68  
#1 Posted : Saturday, July 4, 2026 12:36:48 AM(UTC)
TL68

Rank: Advanced Member

Groups: Registered
Joined: 12/8/2022(UTC)
Posts: 154
Sweden

Thanks: 48 times
Was thanked: 3 time(s) in 3 post(s)
Hi all!
I'm looking into the possibility to toggle between a defined set of inputs on a layer on an input using a button on a streamdeck.
So that a button press changes to the next input on that layer on a predefined list of inputs.
Use case is to find an easy way to change input in a box on a splitview input without having to go into vMix settings or use up a lot of buttons on the streamdeck.

I would prefer if this was possible using the Companion software. But I would also be happy to map a button to shortcuts in vmix and/or script.

Thanks in advance for any help with this!
TL68  
#2 Posted : Saturday, July 4, 2026 1:02:41 AM(UTC)
TL68

Rank: Advanced Member

Groups: Registered
Joined: 12/8/2022(UTC)
Posts: 154
Sweden

Thanks: 48 times
Was thanked: 3 time(s) in 3 post(s)
Update: Mr AI helped me create a script that seems to do what I want :-)! I will run some more testing and then post it in the scripting forum.
TL68  
#3 Posted : Monday, July 6, 2026 4:19:41 PM(UTC)
TL68

Rank: Advanced Member

Groups: Registered
Joined: 12/8/2022(UTC)
Posts: 154
Sweden

Thanks: 48 times
Was thanked: 3 time(s) in 3 post(s)
Here is the script AI created for this function.
It works with input names to instead of input numbers.



Code:

' ==========================================
' SETTINGS
' ==========================================
' Change to your actual input numbers or names
Dim targetInput As String = "1" 
Dim layerNumber As Integer = 1 
Dim sourceInputs() As String = {"2", "3", "4"}
' ==========================================

Dim xml As String = API.XML()
Dim x As New System.Xml.XmlDocument
x.LoadXml(xml)

' The correct XML path for vMix Dynamic Values is //dynamic/value1
Dim currentIndexNode As System.Xml.XmlNode = x.SelectSingleNode("//dynamic/value1")
Dim currentIndexStr As String = ""
If currentIndexNode IsNot Nothing Then
    currentIndexStr = currentIndexNode.InnerText
End If

Dim currentIndex As Integer = 0

' Attempt to convert the saved value to an integer
If Integer.TryParse(currentIndexStr, currentIndex) Then
    ' Move to the next input in the list
    currentIndex = currentIndex + 1
Else
    ' If the value is empty (e.g., the very first time the script runs)
    currentIndex = 0 
End If

' If we have reached the end of the list, start over from zero
If currentIndex >= sourceInputs.Length Then
    currentIndex = 0
End If

' Get the name/number of the next input from the list
Dim nextInput As String = sourceInputs(currentIndex)

' Print info in the vMix Scripting log for troubleshooting
Console.WriteLine("Found saved index: " & currentIndexStr)
Console.WriteLine("Changing to index: " & currentIndex & " (Which is Input: " & nextInput & ")")

' Build the SetLayer command and send it to vMix
Dim layerValue As String = layerNumber.ToString() & "," & nextInput
API.Function("SetLayer", Input:=targetInput, Value:=layerValue)

' Save the new index so vMix remembers it for the NEXT time the script is executed
API.Function("SetDynamicValue1", Value:=currentIndex.ToString())
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.