Rank: Member
Groups: Registered
Joined: 9/29/2021(UTC) Posts: 11 Location: Porto Thanks: 3 times
|
this is a big help! thanks! first get some order in your for loops (example) Code:
for inp as Integer = 1 to 3
for lay as Integer = 1 to 3
Api.Function("LayerOn", Input:= inp, Value:=lay)
next
next
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Send Email from within vMix Scripting (Gmail)Code:
'Gmail will prevent access for your e-mail account from custom applications.
'You need to turn on "Allow less secure apps" in your Google account.
'https://myaccount.google.com/lesssecureapps
Try
Dim Smtp_Server As New System.Net.Mail.SmtpClient
Dim e_mail As New System.Net.Mail.MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("username@gmail.com", "password")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
e_mail = New System.Net.Mail.MailMessage()
e_mail.From = New System.Net.Mail.MailAddress("Your@mail.com", "Name")
e_mail.To.Add("To@mail.com")
e_mail.Subject = "From vMix Script"
e_mail.IsBodyHtml = False
e_mail.Body = "Test Email Send through vMix Scripting"
Smtp_Server.Send(e_mail)
console.writeline("Mail Sent")
Catch error_t As Exception
Console.WriteLine("failed to send email with the following error:")
console.writeline(error_t.ToString)
End Try
|
2 users thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/15/2021(UTC) Posts: 72 Thanks: 8 times Was thanked: 9 time(s) in 7 post(s)
|
Hello, i'm looking for the API Command to get the active Output2 Source. Like this: activeinput = (x.SelectSingleNode("//active").InnerText) WhatIsOnPreview = (x.SelectSingleNode("//preview").InnerText)
I try "Output2" and other variables (Out2, ExternalOutput2, OutputExternal2, active2, External2) but it don't work: activeoutput2 = (x.SelectSingleNode("//Output2").InnerText)
Set Output2 is no problem. But get out2 make me crazy.
Can someone help? Thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: Salvatore Hello, i'm looking for the API Command to get the active Output2 Source. Like this: activeinput = (x.SelectSingleNode("//active").InnerText) WhatIsOnPreview = (x.SelectSingleNode("//preview").InnerText)
I try "Output2" and other variables (Out2, ExternalOutput2, OutputExternal2, active2, External2) but it don't work: activeoutput2 = (x.SelectSingleNode("//Output2").InnerText)
Set Output2 is no problem. But get out2 make me crazy.
Can someone help? Thanks Nope Not possible (you should have checked the API XML to see if it was even available!) If you have Set it you already should know what it is and keep track of it
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows. So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses. Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.
Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/23/2020(UTC) Posts: 170 Location: Wichita Thanks: 10 times Was thanked: 24 time(s) in 20 post(s)
|
Originally Posted by: nowski I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows. So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses. Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.
Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it? What API are you using to access your datasource and what sort of datasource are you accessing? Without that basic information we have nowhere to start in providing advice.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nowski I have a datasource with questions organised in rounds of 10, I can move next/previous row, but I want to be able to jump in blocks of +/-10 rows. So I can easily jumpt to round 2 then increment to question 4 or jump to round 6 whatever, rather than previous row x number of times - I might be at Q5 of Round 20, whoch would mean a LOT of buntton presses. Muy idea is to create two shortcut buttons that just jump in blocks of 10. )I dont want one per round if possible.
Cant seem to find a way to get currentrownumber of datasource, any other ideas on how to acheive it? can't unless you script and keep track of your row somehow yourself (dynamic values could be of help to save it as a variable) . for jumping 10 rows at once one can use a little for next loop in a script Building an external app that reads and displays your datasource files in a table would give you full control and allow you to keep track of the currently selected row (vb.net) and use httprequests to send the selected data to your title and such
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
Thanks chaps, I'm using Google Sheets - which are proving to be very useful all round. Dont like the idea of external apps and whatnot, sounds like I might be stuck wth a few button presses. But as an aside, I already use a Sheet. scripting (thanks to Doggy) and variables to drive the whole show. I just edit a sheet with all the notes and links etc and that drives it all. Data: topic title, external link, any notes (not seen) and any videos I need to cue up are shown in the preview window, then when I start the topic, url gets posted to Youtube chat, also to a text file with record time, which makes it very easy to spit out the youtube chapter markers - saves at least one play though after the event to chapterize it. From this show https://youtu.be/zc5CiHdMZwA Capture.PNG (1,074kb) downloaded 7 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Ability to indicate on a StreamDeck a status within your script or from multiple shortcut.
If you have some free DynamicInputs to use:
- Have a StreamDeck button with the vMix plugin - Set a DynamicInputx with a value between 1 and number of inputs you have from within your script or by means of the shortcuts. - Create an activator on Event DynamicInputx and use the input as number you want respond to. (Don't use input numbers you use for other activators ;-) ) - Repeat previous point to create as many colors you want based on specific values used to show on the same button.
- Use imagination for use
|
2 users thanked doggy for this useful post.
|
|
|
Rank: Member
Groups: Registered
Joined: 8/2/2021(UTC) Posts: 12 Location: Utrecht Thanks: 2 times Was thanked: 4 time(s) in 3 post(s)
|
First of all, thanks for everybody posting in this topic! It got me started exploring the scripting possibilities in vmix. With the help of some scripts here I came up with my first script. We have a pc in the office running a small show, with an introduction video to vmixcall and how we use it. We send out vmixcall login's to guests prior to their event so they can get a feel for what they are up to on the day of production. To check who logged in at what time, we're using this script: Code:
'gets name of callers and stores it in file named Caller_Log.txt
'Fill in complete path to folder, end with \
dim FILEPATH as string = "C:\User\Example\Folder\"
dim FILENAME as string = "Caller_Log.txt"
' Leave the rest untouched
dim FILE as string = FILEPATH & FILENAME
dim callers() as string = {"caller1","caller2","caller3","caller4"}
dim nodes() as string = {"//input[@number=1]", "//input[@number=2]", "//input[@number=3]", "//input[@number=4]"}
dim i as integer = 0
do while true
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
do while i < 4
dim node as string = nodes(i)
dim caller as string = callers(i)
dim name as string = (x.SelectSingleNode(node)).InnerText
If name <> caller:
Dim callerid As string = (i+1).ToString()
Dim timeStamp As DateTime = DateTime.Now
Dim callertxt as string = "- New caller at ID" & " " & callerid & " - "& name
Dim writenew as string = timestamp & " " & callertxt
System.IO.File.AppendAllText(FILE, writenew + Environment.NewLine)
Console.writeline(writenew)
callers(i) = name
End If
i = i+1
loop
i = 0
sleep(1000)
loop
|
2 users thanked QuintvK for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/18/2021(UTC) Posts: 8 Location: Boston Thanks: 5 times
|
Hi Scripters, I'm looking to mock up (what I think is) a fairly basic function via VB.net script. What I want the script to do:When [Mic1 Audio is On], set DynamicVal4 to 100 When [Mic1 Audio is Off], set DynamicVal4 to 0. Right now I'm having trouble finding the right syntax for "When Mic1 Audio is On." The basic idea would look something like this: Quote:dim Mic1State as String = (x.SelectSingleNode("//input[@title='Mic1']/@audio").Value) If Mic1State = 1 then API.Function("SetDynamicValue4", Value:="100")
Else if Mic1State = 0 then API.Function("SetDynamicValue4", Value:="0")
What am I missing? What's the right lookup and values for the On/Off state of an audio input in VMix?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/20/2020(UTC) Posts: 74 Thanks: 13 times Was thanked: 9 time(s) in 9 post(s)
|
reading out the API is the right direction. But you should get the meterF1 or meterF2 Value.
If Mic is off the meter value is definitely 0 If on you will have at least some noise at a value above 0
so Dim IsMicOn = (x.SelectSingleNode("//input[@title=Mic2]/@meterF1").Value)
then your path If IsMicOn = 0 .... If IsMicOn > 0 .....
|
1 user thanked Chris Daum for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
I am working on a hack to show which layers are active on a given input - a 2 box. I currently use two rows of a an APK mini to select the inputs for L and R layers for a 2 box pip - this works fine, though there is no mechanism for retuning active layer to the APK via an activator. So I figured I could use two unuse AudioBusses - top row would set busD to active for that selected input BusE for the bottom row. This works, but I would need seven shortcuts for each button - one to turn on the bus and foive to turn off the bus for the ones not currently selected so I can have visual feedback on the buttons. This seems very cumbersome, so I am thinking scripting would be the way to go, though not sure of the strategy to persue. Can i query the XML to return a list or array of inuts 1-6 audiobusses states, then flip them depending on the current button press? Quote:(x.SelectSingleNode("//input[@number='1,2,3,4,5,6']/@audiobusses").Value) - eg select multiple inputs at once or do I need to goe through each one and add it to some kind of list then set the vaules based on whatever logic I want? EG: If input 1 is assiged to busD deaasign all other inputs from busD Just looking for a bit of guidance - thanks
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: nowski I am working on a hack to show which layers are active on a given input - a 2 box. Confused, if an input has multiple layers aren't they all active (shown) ? Quote:I currently use two rows of a an APK mini to select the inputs for L and R layers for a 2 box pip - this works fine, though there is no mechanism for retuning active layer to the APK via an activator. SO i guess you want to know which other input is displayed in one of the layers ? one has to read the key contained in the layer(s) which refers to the key of the input used Quote:So I figured I could use two unuse AudioBusses - top row would set busD to active for that selected input BusE for the bottom row. This works, but I would need seven shortcuts for each button - one to turn on the bus and foive to turn off the bus for the ones not currently selected so I can have visual feedback on the buttons.
This seems very cumbersome, so I am thinking scripting would be the way to go, though not sure of the strategy to persue. Can i query the XML to return a list or array of inuts 1-6 audiobusses states, then flip them depending on the current button press?
(x.SelectSingleNode("//input[@number='1,2,3,4,5,6']/@audiobusses").Value) - eg select multiple inputs at once or do I need to goe through each one and add it to some kind of list then set the vaules based on whatever logic I want? EG: If input 1 is assiged to busD deaasign all other inputs from busD
Just looking for a bit of guidance - thanks
and can get the layernumber and or input number too from the API XML Post 169 might be of use too
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/5/2017(UTC) Posts: 135 Location: UK
Thanks: 15 times Was thanked: 11 time(s) in 9 post(s)
|
Thanks Doggy, I figured out the fast and dirty way to do it is to run a script on Note On that turns off all BusD or E then turn on Bus D or E on note off. Script then runs: Note On Runs: Dim i as Integer = 1 for i = 1 to 6 API.Function("AudioBusOff", i, "D") next Note Off runs shortcut: Set AudioBusOn D That way all I need as an action on each button is - run script, turn on bus. Now I can see which are the active inputs on my multi layered PiP Although I wi 1642080254657.jpg (666kb) downloaded 4 time(s).I'll need to remember if I ever use Bus D or E to redo them... :-)
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/18/2021(UTC) Posts: 8 Location: Boston Thanks: 5 times
|
Still working on my basic "audio on/off checker" script. Thanks to Chris Daum for the advice but I am running into this error message. What's wrong with line 4?? The name of the input I am trying to read is "CR1 Mic". help.png (21kb) downloaded 8 time(s).
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
.....[@title='CR1 Mic']/@...
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/18/2021(UTC) Posts: 8 Location: Boston Thanks: 5 times
|
Originally Posted by: doggy .....[@title='CR1 Mic']/@... Oof! Thanks doggy. Added apostrophes but still returning the same error message. What else am I missing? Error message:BC30009: Reference required to assembly 'DirectShowLib-2005, Version=2.1.0.0, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f' containing the implemented interface 'DirectShowLib.IVMRImagePresenter9'. Add one to your project.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,216 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: josh_5tool Originally Posted by: doggy .....[@title='CR1 Mic']/@... Oof! Thanks doggy. Added apostrophes but still returning the same error message. What else am I missing? Error message:BC30009: Reference required to assembly 'DirectShowLib-2005, Version=2.1.0.0, Culture=neutral, PublicKeyToken=67e7b740cdfc2d3f' containing the implemented interface 'DirectShowLib.IVMRImagePresenter9'. Add one to your project. Something is wrong with your vMix instalation Version ? license type ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 8/18/2021(UTC) Posts: 8 Location: Boston Thanks: 5 times
|
Originally Posted by: doggy Something is wrong with your vMix instalation
Version ? license type ?
Uh oh! We're running 24.0.0.72 on a Pro license. Haven't had any issues with scripting previously. There are a few other identical VMix machines around the office that I'll test the script on today!
|
|
|
|
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.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close