vMix Forums
»
General
»
General Discussion
»
Script to Look in a value of a shape fill and change it if is white.
Rank: Advanced Member
Groups: Registered
Joined: 11/2/2018(UTC) Posts: 44 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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,246 Location: Belgium Thanks: 294 times Was thanked: 961 time(s) in 795 post(s)
|
Originally Posted by: Fountain Kamanga 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
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 11/2/2018(UTC) Posts: 44 Location: Blantyre Thanks: 6 times
|
Originally Posted by: doggy Originally Posted by: Fountain Kamanga 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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,246 Location: Belgium Thanks: 294 times Was thanked: 961 time(s) in 795 post(s)
|
Originally Posted by: Fountain Kamanga 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
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/17/2019(UTC) Posts: 8 Location: Zwickau
|
Originally Posted by: doggy 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?
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,246 Location: Belgium Thanks: 294 times Was thanked: 961 time(s) in 795 post(s)
|
Originally Posted by: Robert Grafe Originally Posted by: doggy 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
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/17/2019(UTC) Posts: 8 Location: Zwickau
|
Originally Posted by: doggy 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.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,246 Location: Belgium Thanks: 294 times Was thanked: 961 time(s) in 795 post(s)
|
Originally Posted by: Robert Grafe
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)
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Script to Look in a value of a shape fill and change it if is white.
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