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
KrisMark  
#1 Posted : Saturday, July 4, 2020 7:57:28 AM(UTC)
KrisMark

Rank: Newbie

Groups: Registered
Joined: 4/30/2020(UTC)
Posts: 7
Poland
Location: Katowice

Hello

sorry if this is a stupid question, but I spent a lot of time looking for a solution. without effects
I'd like write script that set on multiview on overlay8 zoom and position (small PiP)




If activename = "Virtual - SOLO" Then

API.Function("PreviewInput","Virtual - SOLO+1")
' SetZoom, SetPanX, Set PanY on multiview on overlay8

End If

and my second problem

If activeinput = 3 Then

' cut this input on mix2

End If


I'll be greateful for your help
Thanks
doggy  
#2 Posted : Saturday, July 4, 2020 8:29:40 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
KrisMark  
#3 Posted : Saturday, July 4, 2020 9:20:42 PM(UTC)
KrisMark

Rank: Newbie

Groups: Registered
Joined: 4/30/2020(UTC)
Posts: 7
Poland
Location: Katowice

Of course I know this websites, but unfortunately ican't use the knowledge contained on it.
thanks
DWAM  
#4 Posted : Saturday, July 4, 2020 11:33:03 PM(UTC)
DWAM

Rank: Advanced Member

Groups: Registered
Joined: 3/20/2014(UTC)
Posts: 2,721
Man
France
Location: Bordeaux, France

Thanks: 243 times
Was thanked: 794 time(s) in 589 post(s)
You said you want to "write" scripts, such things is not a matter of copy and paste...
Start with basic functions, learn step by step, get familiar with the syntax and operators and you will soon be able to do complex things
thanks 1 user thanked DWAM for this useful post.
doggy on 7/5/2020(UTC)
doggy  
#5 Posted : Sunday, July 5, 2020 2:21:35 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
I like to add before thinking about writing a script ( and learn how to) one needs to check if a script is actual the solution

Based on your description the intention does not make much sense , like why resize a layer of a multiview and then be done with it ( as if that layer is full size it will obscure all the rest ) while another input is active? ( except having it in preview)

Nor do i comprehend the use of when an input is active to also cut that input in a mix (and not active)

Making scripts (programming) is all about the logic of the whole process to begin with

You do seem to know if -end if statements yet you say the knowledge in the links you can't use ? because they are not the exact functions you want to use, but similar ones are in the list of functions for you to adjust ?

Based on your respons knowing the links given , you also read about the HTTP WEB API in the documentation ?
KrisMark  
#6 Posted : Sunday, July 5, 2020 3:33:05 AM(UTC)
KrisMark

Rank: Newbie

Groups: Registered
Joined: 4/30/2020(UTC)
Posts: 7
Poland
Location: Katowice

OK once again, from the begining

We broadcast a program (
?t=2461 ) My composition in Vmix is getting bigger and more complicated. Quite often I have to add or remove another pip's. That's why I thought to prepare scripts "add one pip" and "remove one pip". I'm not a programist but searching websites I wrote sript witch gives me activeinputs and activeinput's name.

dim activeinput as string = ""
dim xml as string = API.XML()
dim x as new system.xml.xmldocument
x.loadxml(xml)
activeinput = (x.SelectSingleNode("//active").InnerText)
Dim node As XmlNode = x.SelectSingleNode("/vmix/inputs/input[@number='"+ activeinput +"']")
Dim activename As String = node.FirstChild.InnerText

and depending on active inputs I'd like to use only one button to add pips

If activename = "SOLO" Then
API.Function("PreviewInput","Virtual - SOLO +1")
Sleep(20)
Input.Preview.Function("Merge",,700)
Sleep(720)
API.Function("PreviewInput","Virtual - SOLO +1 next")
Sleep(20)
Input.Preview.Function("Merge",,700)
End If


If activename = "Virtual - SOLO +1 next" Then

.....
...
..
etc

I currently use many inputs for deferent situation but the plan is to write the script which prepares me input depend on situation.

I can change source in multiview but i can't find way to change position or zoom my pips.

And one more thing, I have no idea how to change input on mix2. I try

API.Function("CutDirect","input1",,Mix:=2)
Function=CutDirect&Input=input1.jpg&Mix=2

but it doesn't work

thanks
doggy  
#7 Posted : Sunday, July 5, 2020 9:09:46 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
ok , i already gave link to the list of available functions ( shortcuts)

a good idea is to check a function first by creating a shortcut for it . As such you will see what details you will need like input and value etc .if they actually do what you want to do (also read the little description within)

Quote:
And one more thing, I have no idea how to change input on mix2. I try

API.Function("CutDirect","input1",,Mix:=2)
Function=CutDirect&Input=input1.jpg&Mix=2


hmm you want to change a content within a mix but are using a transition (which would be a wrong one btw)

to change the content of the mix use ActiveInput and PreviewInput functions ( see the helpfiles regarding Mix)

to reposition /zoom an input SetZoom, PanX and Y are seperate functions to begin with and you can do that on the input itself ( or virtual Input = copy) used in the multiview by shortcut but not on a individual layer of a multiview with a shortcut ( i know of)

if you can do the shortcut you can use it as a function in a script
doggy  
#8 Posted : Sunday, July 5, 2020 9:27:07 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
btw API.Function("Merge",Input:=0) where 0 stands for the preview
KrisMark  
#9 Posted : Monday, July 6, 2020 9:14:29 AM(UTC)
KrisMark

Rank: Newbie

Groups: Registered
Joined: 4/30/2020(UTC)
Posts: 7
Poland
Location: Katowice

I found a solution to my second problem

API.Function("Cut","input1", Mix:=2) ' ---> this script works :)

but I'm still struggling with problem position panx on multiview/overlay

Function=SetPanX&Input=Input3t&Overlay=5&value=0 ---> this is unfortunately doasn't work :(
doggy  
#10 Posted : Monday, July 6, 2020 10:03:07 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Quote:


but I'm still struggling with problem position panx on multiview/overlay

Function=SetPanX&Input=Input3t&Overlay=5&value=0 ---> this is unfortunately doasn't work :(


i did write:"... but not on a individual layer of a multiview with a shortcut" (hence not a script function)!
KrisMark  
#11 Posted : Monday, July 6, 2020 10:45:06 AM(UTC)
KrisMark

Rank: Newbie

Groups: Registered
Joined: 4/30/2020(UTC)
Posts: 7
Poland
Location: Katowice

Even if I see this position in http://127.0.0.1:8088/api/ ?

Sooo I have to think about it then.

Thanks for help :)
doggy  
#12 Posted : Monday, July 6, 2020 5:48:09 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: KrisMark Go to Quoted Post
Even if I see this position in http://127.0.0.1:8088/api/ ?

Sooo I have to think about it then.

Thanks for help :)


workaround is to apply the zoom and pan to the original input (or virtual counterpart) used in the multiview
doggy  
#13 Posted : Monday, July 6, 2020 6:09:31 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
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.