vMix Forums
»
General
»
General Discussion
»
Comparing result from csv columns
Rank: Newbie
Groups: Registered
Joined: 5/18/2021(UTC) Posts: 3 Location: Pensacola Thanks: 1 times
|
Hi. My client and I want to change the color of an element depending on it's value. We are pulling the data from a one row csv file and have a column called Zone. Zone should have different color depending on its value from 1 to 5. I don't actually have vMix myself. My client does. I mostly code in php, javascript, Python. Hoping to be somewhat prepared before we get together and start working in vMix. I think that the comparison code will look something like Code:
<script type="text/vbscript">
zone=1
Select Case zone
Case 1
'Do something useful
document.write("Zone One")
Case 2
document.write("Zone Two")
Case 3
document.write("Zone Three")
Case 4
document.write("Zone Four")
Case 6
document.write("Zone Five")
End Select
</script>
I'm not sure what csv data is going to come in as, or how to access an element from it. An array? Thanks.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,225 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Quote:My client and I want to change the color of an element depending on it's value. What element ? Quote:We are pulling the data from a one row csv file How? Quote: I mostly code in php, javascript, Python. Than you are familiar with coding logic so vb.net won't be a big step from there Quote:I think that the comparison code will look something like Sounds like one of the options Quote:I'm not sure what csv data is going to come in as, or how to access an element from it. An array? ????? Depends: external app, data source within vMix , vMix script Suggest getting familiar with vMix in General, (GT-)titles, API XML ( and retrieving data from it) , vMix functions(shortcuts) and its various way to implement them, datasources , vb.net scripting (NOT VB ! )for vMix (or even as external app) and searching the forum. With all due respect, are you sure your up to the task to satisfy your "client" while apparently not knowing much about vMix ?
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/18/2021(UTC) Posts: 3 Location: Pensacola Thanks: 1 times
|
No offense taken at all, doggy. Thank you for the very useful questions. The client has been using vMix for a few months and I am encouraging him to begin making use of the scripting capabilities.
Will touch base with him and get a little more familiar with the docs myself, touch base with him and return, more informed.
Thanks again.
–Mike
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,225 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Originally Posted by: mikeill The client has been using vMix for a few months and I am encouraging him to begin making use of the scripting capabilities.
and shortcuts, and triggers ;-)
|
1 user thanked doggy for this useful post.
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 7/28/2019(UTC) Posts: 351 Location: Santa Rosa Thanks: 1 times Was thanked: 53 time(s) in 51 post(s)
|
Have you thought about using images instead? You can use the direct path to the images in your cells and change those in real time.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 5/18/2021(UTC) Posts: 3 Location: Pensacola Thanks: 1 times
|
Hi, @doggy. Originally Posted by: doggy Quote:My client and I want to change the color of an element depending on it's value. What element ? It’s a text element wrapped within an overlay generated via GT Designer. Originally Posted by: doggy Quote:We are pulling the data from a one row csv file How? From the Data Source of the vMix Title Editor. I will read up on vMix in General, (GT-)titles, API XML ( and retrieving data from it) , vMix functions(shortcuts) and its various way to implement them, datasources , vb.net scripting for vMix (or even as external app) and search the forum more thoroughly. The client's initial idea was to render the data (single integer) in one of 5 columns and layer five Text Headers over one another, only one of which would be populated at a time. This seems rather like an in-elegant error-prone approach to me, but perhaps it's fine. It does seem to "work". Any further wise questions or insights? Thank you.
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,225 Location: Belgium Thanks: 293 times Was thanked: 955 time(s) in 790 post(s)
|
Quote:The client's initial idea was to render the data (single integer) in one of 5 columns and layer five Text Headers over one another, only one of which would be populated at a time. This seems rather like an in-elegant error-prone approach to me, but perhaps it's fine. It does seem to "work". yeah that works so does going from Paris to London via Rome (if not in a hurry) ;-) So in short: you want the ability to change the color of text in a title based on a value (from 1 to 5) from a datasource ? There is a shortcut/function "SetTextColour" Simplest way: have a hidden textbox that is linked to the number from the data source (check out https://forums.vmix.com/...6-Scripting-for-Dummies)Have a continuous script that reads that value from that textbox Script does some decision making after a value change to specify the color based on that value and applies that color to the intended text with the SetTextColour function FYI a Select Case seems to have some issues in vMix scripting so a IF THEN ELSE will work
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Comparing result from csv columns
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