vMix Forums
»
General
»
GT
»
Rectangle Visible Toggle via VBScript
Rank: Advanced Member
Groups: Registered
Joined: 8/3/2013(UTC) Posts: 405 Location: Gold Coast, Australia
Thanks: 27 times Was thanked: 76 time(s) in 58 post(s)
|
Hello,
I'm trying to use Scripting in Vmix to toggle an element based on what some text says. Any hints from a guru on what I'm doing wrong here.
I know my if statement is good, just trying to make a rectangle in GT Designer, display or not based on the content of a title and failing. Can you do this for items from GT Designer or only images?
If Input.Find("MM-Top.gtzip").Text("OnlineText.Text") = "1" Then API.Function("SetVisibleOn","MM-Top.gtzip","OnlineRect") Else API.Function("SetVisibleOff","MM-Top.gtzip","OnlineRect") End If
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
GT page and use SelectIndex
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/3/2013(UTC) Posts: 405 Location: Gold Coast, Australia
Thanks: 27 times Was thanked: 76 time(s) in 58 post(s)
|
Thanks pointed me just enough in the right direction (to find the Youtube tutorial on pages). Also looking at Onchange of data option in the designer, since it's on/off might be useful without a script to do on change. I'll test that for my purpose.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,243 Location: Belgium Thanks: 294 times Was thanked: 960 time(s) in 794 post(s)
|
Originally Posted by: Speegs Thanks pointed me just enough in the right direction (to find the Youtube tutorial on pages). Also looking at Onchange of data option in the designer, since it's on/off might be useful without a script to do on change. I'll test that for my purpose. GT title On Change only handles a change , not a value check You will have to go with script
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/3/2013(UTC) Posts: 405 Location: Gold Coast, Australia
Thanks: 27 times Was thanked: 76 time(s) in 58 post(s)
|
Script was the best way.. here is the exact code in case it helps someone out. This worked for me. The IsOnline.Text is under our company logo so nobody can see it changing from 0 to 1. It's being populated via a XML data source with a bunch of other standard title text fields. Code:
Sleep(100)
Dim TitlePage as Integer = 1
Do While true
If Input.Find("MM-Top.gtzip").Text("IsOnline.Text") = "1" Then
If TitlePage = 1 Then
TitlePage = 2
API.Function("SelectIndex","MM-Top.gtzip","2")
End If
Else
If TitlePage = 2 Then
TitlePage = 1
API.Function("SelectIndex","MM-Top.gtzip","1")
End If
End If
Sleep(100)
Loop
The only improvement I guess could be triggering the VBScript when the data reloads from the data source manager. I have no idea how to do that, probably not possible. Would make a good feature to trigger a script based on the Update data ever xxx milliseconds on the data source facility. If someone has a way I'm all ears :)
|
|
|
|
vMix Forums
»
General
»
GT
»
Rectangle Visible Toggle via VBScript
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