logo

Live Production Software Forums


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

Notification

Icon
Error

26 Pages«<1213141516>»
Options
Go to last post Go to first unread
doggy  
#261 Posted : Sunday, June 12, 2022 4:52:57 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: kolorasta Go to Quoted Post
Hi. How can I change the source of an Image Input... ?

For example, I have an input with the image somefile.png and I want to change it to somefile2.png via api

Which function should I use? i can't find it.

sorry for my english


You can not because there is none (https://forums.vmix.com/posts/t5032-Is-there-anyway-to--Change--an-input-in-the-API)

Can however if it is in a title (hint, latest v25)
Or choose a photo input
Nguyendung  
#262 Posted : Sunday, August 14, 2022 12:15:58 PM(UTC)
Nguyendung

Rank: Newbie

Groups: Registered
Joined: 4/9/2022(UTC)
Posts: 2
Viet Nam
Location: Hanoi

Thanks: 2 times
Hello, first of all, sorry for my English. I hope you can understand me.
I write for the following:

If AudioBus (input1) on D,E bus and AudioBus (input2) on D bus then "Do nothing"
Else
AudioBus (input1) on D bus and AudioBus (input2) on C bus
I dont know what to do.
Please help me! Thanks a lot.
Roy Sinclair  
#263 Posted : Monday, August 15, 2022 8:35:42 AM(UTC)
Roy Sinclair

Rank: Advanced Member

Groups: Registered
Joined: 11/23/2020(UTC)
Posts: 170
United States
Location: Wichita

Thanks: 10 times
Was thanked: 24 time(s) in 20 post(s)
Originally Posted by: Nguyendung Go to Quoted Post
Hello, first of all, sorry for my English. I hope you can understand me.
I write for the following:

If AudioBus (input1) on D,E bus and AudioBus (input2) on D bus then "Do nothing"
Else
AudioBus (input1) on D bus and AudioBus (input2) on C bus
I dont know what to do.
Please help me! Thanks a lot.


This code from the original post in this thread shows how to query the state of vMix and select specific items from the XML that vMix returns.

Code:

'Is a input Running or on Pause retrieved from the API xml
dim xml = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
dim StateOf = (x.SelectSingleNode("//input[@type='Replay']/@state").Value)
'or
dim StateOf = (x.SelectSingleNode("//input[@number='10']/@state").Value)
Console.WriteLine(StateOf)


As long as vMix includes which audio busses any specific input has active then what you ask should be possible. I cannot say what is provided as I don't have an example of a vMix status handy but examining one is where I would start. Check any information that is returned about a speficic input AND check for any other XML referring to Audio busses, what you are looking for could be in either, both or none. If none then it's not going to be possible without a feature request to include more information in the state XML.
thanks 1 user thanked Roy Sinclair for this useful post.
Nguyendung on 1/5/2024(UTC)
Wayne Herbert  
#264 Posted : Tuesday, August 30, 2022 12:46:28 AM(UTC)
Wayne Herbert

Rank: Newbie

Groups: Registered
Joined: 6/16/2022(UTC)
Posts: 3
South Africa
Location: jhb

Good Day i am Bad at Scripting to start
Is there a way of making GT Titles Toggle the Visible not Visible Via a Data source for like 90 or so items
JACKPOT 1.png (1,237kb) downloaded 3 time(s).

I Have Red Tiles with Numbers in them now what i want to happen is if there is a number in the tile i want the tile to be Visible when there is no number i want tile not to be there
i did this with data source how ever the tile does not return when data is re added
WTW TEST - BET TYPES - .xlsx (34kb) downloaded 10 time(s).

I need some help

Thanks
Chris Daum  
#265 Posted : Sunday, September 11, 2022 10:19:05 AM(UTC)
Chris Daum

Rank: Advanced Member

Groups: Registered
Joined: 11/20/2020(UTC)
Posts: 74
Man
Germany

Thanks: 13 times
Was thanked: 9 time(s) in 9 post(s)
Cheers Wayne,
just did a little testing, here´s is what I got:

Code:
Dim TbxContent As String
Dim Tbx As String
Dim Img As String
Do
For i As Integer = 1 To 4
Tbx = ("txt" & i & ".Text")
Img = ("Img" & i & ".Source")
TbxContent = Input.Find("Test").Text(Tbx)
If String.IsNullOrEmpty(TbxContent) Then
api.function("SetImageVisibleOff", input:="Test", SelectedName:=Img)
Else
api.function("SetImageVisibleOn", input:="Test", SelectedName:=Img)
End If
Next
Loop


Note:
Tbx in the above script represents the textfield name in my test title
Img the image name
Test is the name of my title input

In my test title both correspond to each other, means:
tbx1.Text is placed on img1.Source (these are the original names in my title)

Code:
<text index="0" name="txt4.Text">s</text>
<text index="1" name="txt3.Text">aa</text>
<text index="2" name="txt2.Text">aa</text>
<text index="3" name="txt1.Text">ss</text>
<image index="0" name="Img4.Source">45ac9978-9d83-4fa1-a514-086055a3618d\Bild1.png</image>
<image index="1" name="Img3.Source">45ac9978-9d83-4fa1-a514-086055a3618d\Bild1.png</image>
<image index="2" name="Img2.Source">45ac9978-9d83-4fa1-a514-086055a3618d\Bild1.png</image>
<image index="3" name="Img1.Source">45ac9978-9d83-4fa1-a514-086055a3618d\Bild1.png</image>


I have no idea how to access the image related to the textfield if naming in your .gtzip isn´t
built like that!

´nother note you can only set images on/off if you used "Rectangles" I have no idea how to
change their properties via script...

and... my for loop only counts to 4 I had it loop for testing purpose counting to 100 all good, vMix doesn´t seem to care if gets delivered empty strings... :-)

the script of course has to run in a loop during your show, but that should´t much of an issue...

for testing purpose I removed the text in the title editor (manually) the corresponding image went on and off

have fun

If you have further issues down there, let me know I know how to get on a plane :-) :-)
engelschall  
#266 Posted : Sunday, September 11, 2022 5:57:28 PM(UTC)
engelschall

Rank: Advanced Member

Groups: Registered
Joined: 3/7/2022(UTC)
Posts: 71
Germany
Location: Munich

Was thanked: 33 time(s) in 17 post(s)
In case you are searching for real-life and working examples of more elaborate and clean vMix VB.Net scripts, check out https://github.com/rse/vmix-scripts/. Here you can find many reusable code snippets you can borrow.
titasas  
#267 Posted : Monday, September 12, 2022 8:15:40 PM(UTC)
titasas

Rank: Newbie

Groups: Registered
Joined: 9/21/2021(UTC)
Posts: 9
Lithuania
Location: Elektrėnai

Was thanked: 1 time(s) in 1 post(s)
Hello 🙂
Maybe anyone can help with scripting? Never done this but i need something very simple.

if home-powerplay.gtzip input pp.Text is more then 0:01, then function MultiViewOverlayOn to scoreboard input Value 1.
If home-powerplay.gtzip input pp.Text is empty, then function MultiViewOverlayOff to scoreboard input Value 1.

To put it simply, in ice hockey I need scoreboard input layer 1 to turn on when the penalty minutes start ticking, and when the pp.Text field is empty, scoreboard input layer 1 turns off.

Thanks!
doggy  
#268 Posted : Monday, September 12, 2022 8:40:04 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: titasas Go to Quoted Post
Hello 🙂
Maybe anyone can help with scripting? Never done this but i need something very simple.

if home-powerplay.gtzip input pp.Text is more then 0:01, then function MultiViewOverlayOn to scoreboard input Value 1.
If home-powerplay.gtzip input pp.Text is empty, then function MultiViewOverlayOff to scoreboard input Value 1.

To put it simply, in ice hockey I need scoreboard input layer 1 to turn on when the penalty minutes start ticking, and when the pp.Text field is empty, scoreboard input layer 1 turns off.

Thanks!


There are quit a bit of examples in this post on how to read values from a title text field .
All you need is to compare those values with your criteria in a script (if-then-else in vb.net speak) and activate the functions accordingly your matching criteria

If...Then...Else Statement
titasas  
#269 Posted : Monday, September 12, 2022 8:59:13 PM(UTC)
titasas

Rank: Newbie

Groups: Registered
Joined: 9/21/2021(UTC)
Posts: 9
Lithuania
Location: Elektrėnai

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post
Hello 🙂
Maybe anyone can help with scripting? Never done this but i need something very simple.

if home-powerplay.gtzip input pp.Text is more then 0:01, then function MultiViewOverlayOn to scoreboard input Value 1.
If home-powerplay.gtzip input pp.Text is empty, then function MultiViewOverlayOff to scoreboard input Value 1.

To put it simply, in ice hockey I need scoreboard input layer 1 to turn on when the penalty minutes start ticking, and when the pp.Text field is empty, scoreboard input layer 1 turns off.

Thanks!


There are quit a bit of examples in this post on how to read values from a title text field .
All you need is to compare those values with your criteria in a script (if-then-else in vb.net speak) and activate the functions accordingly your matching criteria

If...Then...Else Statement



maybe something worked out

do while True
if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
else
API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
end if
sleep(500)
Loop
doggy  
#270 Posted : Monday, September 12, 2022 9:31:43 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !


clibil  
#271 Posted : Tuesday, September 13, 2022 4:45:35 PM(UTC)
clibil

Rank: Member

Groups: Registered
Joined: 3/30/2020(UTC)
Posts: 17
Man
France
Location: Leran

Thanks: 14 times
Hi
I am a newbie to scripting but not to VMix.
Is there a way to select a Camera in a Virtual Studio Input ?
As part of a script I need to be able to make the input choose a specific camera position.
Does anyone know if there is a function which enables this please ?
Many thanks
doggy  
#272 Posted : Tuesday, September 13, 2022 5:15:19 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: clibil Go to Quoted Post
Hi
I am a newbie to scripting but not to VMix.
Is there a way to select a Camera in a Virtual Studio Input ?
As part of a script I need to be able to make the input choose a specific camera position.
Does anyone know if there is a function which enables this please ?
Many thanks


isnt a virtual studio from a camera position on its own so select another VS (input) ?
clibil  
#273 Posted : Tuesday, September 13, 2022 7:19:17 PM(UTC)
clibil

Rank: Member

Groups: Registered
Joined: 3/30/2020(UTC)
Posts: 17
Man
France
Location: Leran

Thanks: 14 times
Good morning Doggy

First of all thank you for responding so quickly 🙂

A VMix-supplied virtual studio set appears as a single Input, and then there are (on the one I am using at least) 4 camera positions provided. They are, in effect, pre-set Zoom Levels. Unfortunately there seems to be no way to access these via a function command.

Clibil
doggy  
#274 Posted : Tuesday, September 13, 2022 7:25:07 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: clibil Go to Quoted Post
Good morning Doggy

First of all thank you for responding so quickly 🙂

A VMix-supplied virtual studio set appears as a single Input, and then there are (on the one I am using at least) 4 camera positions provided. They are, in effect, pre-set Zoom Levels. Unfortunately there seems to be no way to access these via a function command.

Clibil


Oh talking about various zoom positions in your VS

Google could have told you ;-)

https://www.vmix.com/knowledgebase/article.aspx/204/how-to-change-virtual-set-zoom-positions-angles-using-shortcuts

if a shortcut exists a function for scripting does too ;-)
thanks 1 user thanked doggy for this useful post.
clibil on 9/13/2022(UTC)
clibil  
#275 Posted : Tuesday, September 13, 2022 7:39:08 PM(UTC)
clibil

Rank: Member

Groups: Registered
Joined: 3/30/2020(UTC)
Posts: 17
Man
France
Location: Leran

Thanks: 14 times
Thank you so very much - without your help I would have never tracked this down !
👍🙂
titasas  
#276 Posted : Thursday, September 15, 2022 5:34:33 AM(UTC)
titasas

Rank: Newbie

Groups: Registered
Joined: 9/21/2021(UTC)
Posts: 9
Lithuania
Location: Elektrėnai

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !




Thanks :)

Now I'm thinking how to upgrade this code and also add them to change position.

If input1 is more than 0:01, enable it. If at that time input2 is more than 0:01, turn it on as well.

If input1 becomes empty, and input2 is still timed out, switch input1 off, move input2 to input1 position. At the end of the time, return to the previous position. If neither input gets time, both layers are disabled.
doggy  
#277 Posted : Thursday, September 15, 2022 5:45:59 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !




Thanks :)

Now I'm thinking how to upgrade this code and also add them to change position.

If input1 is more than 0:01, enable it. If at that time input2 is more than 0:01, turn it on as well.

If input1 becomes empty, and input2 is still timed out, switch input1 off, move input2 to input1 position. At the end of the time, return to the previous position. If neither input gets time, both layers are disabled.


Just translate your thought/logic into code (language), you know: if then else/elseif's and's and or's etc
or are you trying to trick someone into doing that for you ;-)
titasas  
#278 Posted : Thursday, September 15, 2022 6:12:24 AM(UTC)
titasas

Rank: Newbie

Groups: Registered
Joined: 9/21/2021(UTC)
Posts: 9
Lithuania
Location: Elektrėnai

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !




Thanks :)

Now I'm thinking how to upgrade this code and also add them to change position.

If input1 is more than 0:01, enable it. If at that time input2 is more than 0:01, turn it on as well.

If input1 becomes empty, and input2 is still timed out, switch input1 off, move input2 to input1 position. At the end of the time, return to the previous position. If neither input gets time, both layers are disabled.


Just translate your thought/logic into code (language), you know: if then else/elseif's and's and or's etc
or are you trying to trick someone into doing that for you ;-)


I tried to create that, but for me is too much "if" and "or", but you remember me that is "elseif". Just cant find function to move X layer position :?
doggy  
#279 Posted : Thursday, September 15, 2022 6:20:46 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !




Thanks :)

Now I'm thinking how to upgrade this code and also add them to change position.

If input1 is more than 0:01, enable it. If at that time input2 is more than 0:01, turn it on as well.

If input1 becomes empty, and input2 is still timed out, switch input1 off, move input2 to input1 position. At the end of the time, return to the previous position. If neither input gets time, both layers are disabled.


Just translate your thought/logic into code (language), you know: if then else/elseif's and's and or's etc
or are you trying to trick someone into doing that for you ;-)


I tried to create that, but for me is too much "if" and "or", but you remember me that is "elseif". Just cant find function to move X layer position :?


Can always use the setzoom, setpanx, setpanY to the input used in the layers instead



titasas  
#280 Posted : Thursday, September 15, 2022 6:34:30 AM(UTC)
titasas

Rank: Newbie

Groups: Registered
Joined: 9/21/2021(UTC)
Posts: 9
Lithuania
Location: Elektrėnai

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: titasas Go to Quoted Post


maybe something worked out

Code:
do while True
 if Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
 else
   API.Function("MultiViewOverlayoff", Input:="scoreboard.gtzip", Value:="1")
 end if
sleep(500)
Loop


take note theat the new name for the "MultiViewOverlay" is now simply "Layer"

keep in mind that a script and the functions do need more than 0.01 secs to process .
your sleep is half a second !




Thanks :)

Now I'm thinking how to upgrade this code and also add them to change position.

If input1 is more than 0:01, enable it. If at that time input2 is more than 0:01, turn it on as well.

If input1 becomes empty, and input2 is still timed out, switch input1 off, move input2 to input1 position. At the end of the time, return to the previous position. If neither input gets time, both layers are disabled.


Just translate your thought/logic into code (language), you know: if then else/elseif's and's and or's etc
or are you trying to trick someone into doing that for you ;-)


I tried to create that, but for me is too much "if" and "or", but you remember me that is "elseif". Just cant find function to move X layer position :?


Can always use the setzoom, setpanx, setpanY to the input used in the layers instead





Thanks, but elseif not work for me :|

Code:
[i]do while True
 if Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5")
 elseif
    Input.Find("home-powerplay.gtzip").Text("pp.Text") >= "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="1")
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5")
 elseif
    Input.Find("home-powerplay.gtzip").Text("pp.Text") < "0:01" and Input.Find("home-powerplay2.gtzip").Text("pp.Text") >= "0:01" then
   API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="1")
   API.Function("MultiViewOverlayOn", Input:="scoreboard.gtzip", Value:="5") and something with setpanX
 else
   API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="1")
   API.Function("MultiViewOverlayOff", Input:="scoreboard.gtzip", Value:="5")
 end if
sleep(500)
Loop[/i]


And get Error Line 4 BC30201: Expression expected error
Users browsing this topic
Guest
26 Pages«<1213141516>»
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.