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
mikeill  
#1 Posted : Tuesday, May 18, 2021 5:39:27 AM(UTC)
mikeill

Rank: Newbie

Groups: Registered
Joined: 5/18/2021(UTC)
Posts: 3
United States
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.
doggy  
#2 Posted : Tuesday, May 18, 2021 6:23:42 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,219
Belgium
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 ?
mikeill  
#3 Posted : Tuesday, May 18, 2021 6:33:59 AM(UTC)
mikeill

Rank: Newbie

Groups: Registered
Joined: 5/18/2021(UTC)
Posts: 3
United States
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
doggy  
#4 Posted : Tuesday, May 18, 2021 6:43:06 AM(UTC)
doggy

Rank: Advanced Member

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

Thanks: 293 times
Was thanked: 955 time(s) in 790 post(s)
Originally Posted by: mikeill Go to Quoted Post
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 ;-)

thanks 1 user thanked doggy for this useful post.
mikeill on 5/18/2021(UTC)
Vince Beck  
#5 Posted : Tuesday, May 18, 2021 8:17:01 AM(UTC)
Vince Beck

Rank: Advanced Member

Groups: Registered
Joined: 7/28/2019(UTC)
Posts: 351
United States
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.
mikeill  
#6 Posted : Wednesday, May 19, 2021 6:03:44 AM(UTC)
mikeill

Rank: Newbie

Groups: Registered
Joined: 5/18/2021(UTC)
Posts: 3
United States
Location: Pensacola

Thanks: 1 times
Hi, @doggy.

Originally Posted by: doggy Go to Quoted Post

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 Go to Quoted Post



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.

doggy  
#7 Posted : Wednesday, May 19, 2021 5:02:43 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,219
Belgium
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
Users browsing this topic
Guest (4)
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.