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
Carnagio  
#1 Posted : Sunday, July 14, 2019 11:55:12 AM(UTC)
Carnagio

Rank: Newbie

Groups: Registered
Joined: 7/14/2019(UTC)
Posts: 8
United States

I'm a coder by profession and am looking to write some scripts for vmix but I'm having trouble locating some sort of object knowledge base for the objects accessible through scripting --

I've tried poking around to piece together something obvious but am not having much luck yet.

So first question is: Could someone please point me to a complete reference? I'm not looking for info on the web api.

Example of what I'm trying to accomplish:

Goal - Upon script execution:
1. Locate input by name
2. Set it to a specified multiview overlay slot on a specified input
3. Play the input.
4. Wait for play completion.
5. Unset the multiview overlay slot.

I've tried grabbing what might be method names from the web api but am not getting anywhere.

Code:
dim SpinnyBlockInput = Input.Find("Spinny Blocky Thingy.mov")
dim PepeMaymay = Input.Find("Clown Pepe.mov")

SpinnyBlockInput.SetMultiViewOverlay(6, PepeMaymay)
'Start playing
'wait for completion somehow
'unset overlay somehow



Thanks for your help in advance.
Carnagio  
#2 Posted : Sunday, July 14, 2019 12:50:11 PM(UTC)
Carnagio

Rank: Newbie

Groups: Registered
Joined: 7/14/2019(UTC)
Posts: 8
United States

Wait... Is this the complete reference? https://www.vmix.com/hel....htm?VBNetScripting.html

So it's pretty much a passthrough for the web api through the Input.Function method?

If thats true I'm trying to use the same things I'd use on the shortcut creation window...

Code:
SpinnyBlockInput.Function("SetMultiViewOverlay", "6,17")


This works but -- I need to specify by input name, not number... Is there an instance property or method I can use on the PepeMaymay object to get its input number to hand to this "Function" function?
Carnagio  
#3 Posted : Sunday, July 14, 2019 1:19:33 PM(UTC)
Carnagio

Rank: Newbie

Groups: Registered
Joined: 7/14/2019(UTC)
Posts: 8
United States

So this is close to done. Just need some pointers on a couple things --

Code:
dim SpinnyBlockInput = Input.Find("Spinny Blocky Thingy.mov")
dim PepeMaymay = Input.Find("Clown Pepe.mov")

SpinnyBlockInput.Function("SetMultiViewOverlay", "6,17")
PepeMaymay.Function("Play")
PepeMaymay.WaitForCompletion(20000)
PepeMaymay.Function("Pause")


Outstanding:
1. I need a way to specify by input name or get the input number to hand to SetMultiViewOverlay.

2. Ideally I could run this script from a short cut and pass the script the name of the target input to drop into the multiview overlay. Is there a way to pass params to a script from a shortcut?

Thanks again for any help you can give. <3


Carnagio  
#4 Posted : Wednesday, July 17, 2019 6:28:21 AM(UTC)
Carnagio

Rank: Newbie

Groups: Registered
Joined: 7/14/2019(UTC)
Posts: 8
United States

bump? <3
doggy  
#5 Posted : Wednesday, July 17, 2019 7:06:55 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,512
Belgium
Location: Belgium

Thanks: 140 times
Was thanked: 450 time(s) in 370 post(s)
How about replacing the 17 with the name of the input ?

Code:

dim SpinnyBlockInput = Input.Find("yourInput")
SpinnyBlockInput.Function("SetMultiViewOverlay", "3,NameofInput")

'this works also

API.Function("SetMultiViewOverlay",Input:="yourInput",Value:="3,NameofInput")



Helps if you rename the inputs to a more simple name ;-)

Also why pass parameters to a shortcut if the shortcut can do it directly , and have multiple actions under the same shortcut and/or create triggers ?
Longur  
#6 Posted : Friday, July 19, 2019 4:23:58 AM(UTC)
Longur

Rank: Member

Groups: Registered
Joined: 6/13/2017(UTC)
Posts: 23
Location: Vancouver

Thanks: 8 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: Carnagio Go to Quoted Post
So this is close to done. Just need some pointers on a couple things --

Code:
dim SpinnyBlockInput = Input.Find("Spinny Blocky Thingy.mov")
dim PepeMaymay = Input.Find("Clown Pepe.mov")

SpinnyBlockInput.Function("SetMultiViewOverlay", "6,17")
PepeMaymay.Function("Play")
PepeMaymay.WaitForCompletion(20000)
PepeMaymay.Function("Pause")


Outstanding:
1. I need a way to specify by input name or get the input number to hand to SetMultiViewOverlay.

2. Ideally I could run this script from a short cut and pass the script the name of the target input to drop into the multiview overlay. Is there a way to pass params to a script from a shortcut?

Thanks again for any help you can give. <3




Ran into the problem of needing a way to pass parameters to a script that controls different titles. The hack I used was to create a bunch of hidden text fields inside my titles with exact same names which my script would read.
desmar  
#7 Posted : Friday, July 19, 2019 9:37:28 AM(UTC)
desmar

Rank: Advanced Member

Groups: Registered
Joined: 8/21/2015(UTC)
Posts: 324
Man
Canada
Location: Cornwall, Ontario, Canada

Thanks: 18 times
Was thanked: 79 time(s) in 60 post(s)
You need to send this command via the Web API.

http://127.0.0.1:8088/api/?

It will return an XML response of all Inputs with Key, Number, Name, Type, State and other properties. Which input is in preview, output etc..

You will need to parse the XML response to get information you need.

Here is a sample with 2 inputs..

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<vmix>
<version>22.0.0.60</version>
<edition>Basic</edition>
<inputs>
<input key="4d5a8bff-08a7-4869-93c9-875ce80a3c39" number="1" type="GT" title="Title 0- The Classic Green.gtzip" state="Paused" position="0" duration="0" loop="False" selectedIndex="0">
Title 0- The Classic Green.gtzip
<text index="0" name="Headline.Text">HEADLINE</text>
<text index="1" name="Description.Text">DESCRIPTION</text>
</input>
<input key="06f05edd-3530-4d23-88a5-e26e89880c3f" number="2" type="Video" title="bear.mp4" state="Paused" position="0" duration="32880" loop="False" muted="True" volume="100" balance="0" solo="False" audiobusses="M" meterF1="0" meterF2="0">bear.mp4</input>
</inputs>
<overlays>
<overlay number="1"/>
<overlay number="2"/>
<overlay number="3"/>
<overlay number="4"/>
<overlay number="5"/>
<overlay number="6"/>
</overlays>
<preview>2</preview>
<active>1</active>
<fadeToBlack>False</fadeToBlack>
<transitions>
<transition number="1" effect="Fade" duration="500"/>
<transition number="2" effect="Merge" duration="1000"/>
<transition number="3" effect="Wipe" duration="1000"/>
<transition number="4" effect="CubeZoom" duration="1000"/>
</transitions>
<recording>False</recording>
<external>False</external>
<streaming>False</streaming>
<playList>False</playList>
<multiCorder>False</multiCorder>
<fullscreen>False</fullscreen>
<audio>
<master volume="100" muted="False" meterF1="0" meterF2="0" headphonesVolume="100"/>
<busB volume="100" muted="False" meterF1="0" meterF2="0"/>
</audio>
</vmix>
Carnagio  
#8 Posted : Sunday, July 21, 2019 2:53:42 PM(UTC)
Carnagio

Rank: Newbie

Groups: Registered
Joined: 7/14/2019(UTC)
Posts: 8
United States

Originally Posted by: desmar Go to Quoted Post
You need to send this command via the Web API.


Is this something that can be done from inside their scripts running in vmix? Is their code for that somewhere? Seems odd to need a script to call an external web interface to get something as basic as the name of an input though...?
doggy  
#9 Posted : Sunday, July 21, 2019 7:14:19 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 2,512
Belgium
Location: Belgium

Thanks: 140 times
Was thanked: 450 time(s) in 370 post(s)
Quote:
Is this something that can be done from inside their scripts running in vmix? Is their code for that somewhere?


Yes as its same as reading a xml file and one can specify your elements parse with xpath criteria (similar if you wanted this info into a title , hint)
if you can do it in vb.net you can do it here

Quote:
Seems odd to need a script to call an external web interface to get something as basic as the name of an input though...?


Well as there is no shortcut for it (yet) probably due to the big demand for this specifically so this is one potential workaround

Quote:
I'm a coder by profession


we are not but there is google and suggestions in this forum ;-)


Users browsing this topic
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.