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
Fountain Kamanga  
#1 Posted : Tuesday, April 19, 2022 2:51:26 AM(UTC)
Fountain Kamanga

Rank: Advanced Member

Groups: Registered
Joined: 11/2/2018(UTC)
Posts: 44
Malawi
Location: Blantyre

Thanks: 6 times
Would you please assist me create a script that looks into first shape, if its colour is red it should go to the next, if the next is also red it should go to the next again until it finds one in white. When it finds one in white it should change it to red.

Thanks in advance.
doggy  
#2 Posted : Tuesday, April 19, 2022 3:13:36 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: Fountain Kamanga Go to Quoted Post
Would you please assist me create a script that looks into first shape, if its colour is red it should go to the next, if the next is also red it should go to the next again until it finds one in white. When it finds one in white it should change it to red.

Thanks in advance.


Only possible as of V25 !

do a if then else looking at the shapes color from the API XML and change is matches criteria with the setcolor function.

have a look at the "scripting for dummies"post in this forum for vMix specifics and research vb.net for proper coding

Fountain Kamanga  
#3 Posted : Thursday, April 21, 2022 6:46:02 AM(UTC)
Fountain Kamanga

Rank: Advanced Member

Groups: Registered
Joined: 11/2/2018(UTC)
Posts: 44
Malawi
Location: Blantyre

Thanks: 6 times
Originally Posted by: doggy Go to Quoted Post
Originally Posted by: Fountain Kamanga Go to Quoted Post
Would you please assist me create a script that looks into first shape, if its colour is red it should go to the next, if the next is also red it should go to the next again until it finds one in white. When it finds one in white it should change it to red.

Thanks in advance.


Only possible as of V25 !

do a if then else looking at the shapes color from the API XML and change is matches criteria with the setcolor function.

have a look at the "scripting for dummies"post in this forum for vMix specifics and research vb.net for proper coding




Thanks for the response. If possible an example would do a good job. I am completely lost, thanks.
doggy  
#4 Posted : Thursday, April 21, 2022 8:31:35 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: Fountain Kamanga Go to Quoted Post

Thanks for the response. If possible an example would do a good job. I am completely lost, thanks.


You asked to assist meaning you want to learn
Did you check on vb.net and the reference post mentioned ( that has many examples)
What do you have so far ? what are the shape details (name etc)? how many? script just checking for first white one and change or do all of them sequentially ? .....
Are there other shapes in the title that do not need changing ?
Is your vMix license scripting able ?

Hint:
Read the API XML
get the colorvalue of one of the shapes by name for example or loop through them using their index of the title in question
if matches your color criteria change it else skip and check next one
Basically the logic as what you described " looks into first shape, if its colour is red it should go to the next, until it finds one in white. one in white change it to red."

btw if you put this link in your browser you will see the content of the API XML http://127.0.0.1:8088/api
Robert Grafe  
#5 Posted : Wednesday, August 30, 2023 12:58:57 AM(UTC)
Robert Grafe

Rank: Newbie

Groups: Registered
Joined: 10/17/2019(UTC)
Posts: 8
Man
Germany
Location: Zwickau

Originally Posted by: doggy Go to Quoted Post
get the colorvalue

i found this thread because i have a similar problem.

api xml
Code:
<input key="11ba47c0-06d8-41aa-9238-fe80eaad2b7c" number="2" type="GT" title="x.gtzip" shortTitle="x.gtzip" state="Running" position="0" duration="0" loop="False" selectedIndex="7">
x.gtzip
...
<color index="0" name="1.Fill.Color">#FF0000</color>
...
</input>

i tried like that
Code:

Input.Find("x.gtzip").Color("1.Fill.Color")
-> Color is no Member from vMix.Scripting.Internal.Input

where is the problem?
doggy  
#6 Posted : Wednesday, August 30, 2023 1:17:37 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: Robert Grafe Go to Quoted Post
Originally Posted by: doggy Go to Quoted Post
get the colorvalue

i found this thread because i have a similar problem.

api xml
Code:
<input key="11ba47c0-06d8-41aa-9238-fe80eaad2b7c" number="2" type="GT" title="x.gtzip" shortTitle="x.gtzip" state="Running" position="0" duration="0" loop="False" selectedIndex="7">
x.gtzip
...
<color index="0" name="1.Fill.Color">#FF0000</color>
...
</input>

i tried like that
Code:

Input.Find("x.gtzip").Color("1.Fill.Color")
-> Color is no Member from vMix.Scripting.Internal.Input

where is the problem?


one needs a script reading direclty from the API XML with a proper node selection (xpath)
Plenty of examples on how to read from the API XML in the "scripting for dummies" post
Robert Grafe  
#7 Posted : Monday, September 4, 2023 8:08:00 PM(UTC)
Robert Grafe

Rank: Newbie

Groups: Registered
Joined: 10/17/2019(UTC)
Posts: 8
Man
Germany
Location: Zwickau

Originally Posted by: doggy Go to Quoted Post
one needs a script reading direclty from the API XML with a proper node selection (xpath)
Plenty of examples on how to read from the API XML in the "scripting for dummies" post


Code:
Input.Find("x.gtzip").Text("1.Text")
-> works like a charm

Code:
Input.Find("x.gtzip").Color("1.Fill.Color")
-> Color is no Member from vMix.Scripting.Internal.Input


ofc read out the xml is ANOTHER way.

but i dont get why my command works with Text and not with Colors in this specific example.
doggy  
#8 Posted : Monday, September 4, 2023 11:36:47 PM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 294 times
Was thanked: 961 time(s) in 795 post(s)
Originally Posted by: Robert Grafe Go to Quoted Post


ofc read out the xml is ANOTHER way.

but i dont get why my command works with Text and not with Colors in this specific example.


Because it is not available hense the API XML route (both are for within a script anyway, just a diff type of coding)
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.