I don't think people realize how much this could help them prevent errors when live.
Here is my script that I currently use in case anyone wants to do it the way I have.
'Call this as a shortcut.
'Ideally the first two items below should be passed via argumnets in the short cut.
'But vMix does not currently support that (ver. 29).
'Specify ptzinput name for the virtual input that matches the button being pressed
Dim ptzcamNAME As String = "PTZ - N - Ambo"
'Ideally you could call the camera via the underlying UUID that vMix assigns, then changing the Name or moving inputs around
'would not matter.
'Specify the input name of the camera itself, that all the PTZshots are built from
Dim realcamNAME As String = "CAM 1 - PTZ North"
' script to prevent human error from moving accidentally moving an active PTZ camera
' Jeff Regan -
j--0@outlok.com - Oct 28, 2016
' If the camera the user wants to put up in preview to move is up in the Active Output
' then select the real camera input itself in preview - no auto PTZ movements will occur.
' The user can then adjust PTZ by hand live if they want
' If the camera is not up on the active shot, select the PTZcam the user requested.
' Then wait half a second and select the real camera feed and put it up in preview.
' This allows the user to make fine adjustments to the camera PTZ before sending it
' to the active shot. When the camera does go live, it will stay with the adjusted shot
' and will not recall the saved PTZcam movement the user originally selected.
'Load current xml from vmix
Dim doc As New XmlDocument()
doc.Load("http://127.0.0.1:8088/API")
'Find out which input ID is up on the active output.
Dim activecamNUM As String = doc.SelectSingleNode("/vmix/active").InnerText
'Find name of active input
Dim activecamNAME As String = doc.SelectSingleNode("/vmix/inputs/input[@number='"+activecamNUM +"']").InnerText
Dim nodes As XmlNodeList
Dim node As XmlNode
nodes = doc.SelectNodes("/vmix/inputs/input")
dim num as string
dim title as string
dim errNUM as string
dim realcamNUM as string
dim ptzcamNUM as string
dim inputerrNUM as string
For Each node In nodes
'Console.WriteLine("number: "+node.SelectSingleNode("@number").InnerText+" title: "+node.SelectSingleNode("@title").InnerText)
num=node.SelectSingleNode("@number").InnerText
title=node.SelectSingleNode("@title").InnerText
' find ptz camera input number that matches the name of the ptz
If ptzcamNAME = title Then
ptzcamNUM = num
'Console.WriteLine("ptzcam:"+ptzcamNUM+" "+ptzcamNAME)
End If
' find the real camera input number that matches the name of the camera
If realcamNAME = title Then
realcamNUM = num
'Console.WriteLine("realcam:"+realcamNUM+" "+realcamNAME)
End If
Next
'Console.WriteLine("activecam:"+activecamNUM+" "+activecamNAME)
If activecamNUM = realcamNUM or activecamNUM = ptzcamNUM Then
API.Function("PreviewInput",realcamNUM)
else
API.Function("PTZMoveToVirtualInputPosition",ptzcamNUM)
API.Function("PreviewInput",ptzcamNUM)
Sleep(500)
API.Function("PreviewInput",realcamNUM)
End If