companion icon indicating copy to clipboard operation
companion copied to clipboard

[v3] Ability to set ALL button properties using a variable

Open MeestorX opened this issue 1 year ago • 11 comments

Is this a feature relevant to companion itself, and not a module?

  • [X] I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the feature

Currently, the only parameter that can be set on a button using a variable is it's text (AFAIK). I would like to set it's colour using a variable as well, but I can see that really all parameters should be settable via variable values - png image, fonts, etc.

Usecases

The most obvious use-case for color would be to have a button match the color of a channel strip on a mixer. png images changing depending on a variable value would also make sense like channel icons and other things. Many uses for this.

MeestorX avatar Mar 12 '23 16:03 MeestorX

I see this as mainly a gui challenge to present this in a friendly way. I think the backend changes will be fairly straightforward

Julusian avatar Mar 12 '23 16:03 Julusian

Easiest way to transition would be to start with changing/adding internal actions to change the properties that support variables. e.g. you already have an internal action to change a button color, it just doesn't have the ability to use a variable to set the color. However, in adding internal actions, I would suggest instead of an action for each parameter, have just one action called "set button parameter", then a drop-down for "text color", "background color", "text", "png", etc. Or use a multi-select like feedback does, but again, with the ability to use variables for the value.

MeestorX avatar Mar 12 '23 16:03 MeestorX

Having multiple new internal actions, one for each parameter would be messy, IMHO

MeestorX avatar Mar 12 '23 16:03 MeestorX

If all button parameters had internal actions to set them, then maybe eventually PER-BUTTON feedbacks could go away and just be replaced by (the much more powerful) triggers (still using feedback as a trigger condition)?

MeestorX avatar Mar 12 '23 16:03 MeestorX

Easiest way to transition would be to start with changing/adding internal actions to change the properties that support variables.

Yeah that could be a way to start along this/

However, in adding internal actions, I would suggest instead of an action for each parameter, have just one action called "set button parameter", then a drop-down for "text color", "background color", "text", "png", etc. Or use a multi-select like feedback does, but again, with the ability to use variables for the value.

yeah that would be reasonable, and not too hard to achieve using the isVisible property. I have already been trying to condense the list of internal actions a bit for 3.0.
Make that be Set button parameters (plural) and the dropdown can be a multi-select so you can change multiple properties with the one action. Like how the boolean feedbacks work.

Having multiple new internal actions, one for each parameter would be messy, IMHO

I agree

If all button parameters had internal actions to set them, then maybe eventually feedbacks could go away and just be replaced by (the much more powerful) triggers?

I don't think this is something we will do, for a few reasons. For all of this, lets assume we have conditional actions by the time it is done, otherwise it becomes a lot more painful to write the triggers to do anything complex.

  1. 'advanced' feedbacks don't really fit into the model and some can't be replaced by triggers as they generate an image to be layered into the button rendering.
  2. Some users are already saying that their list of triggers is too long to manage and needs grouping in some way. If we force everyone to define button styles there, that will easily add hundreds more triggers that will make it even harder to find the right trigger.
  3. While triggers are more powerful, they are also harder to use. I don't think it will be very user friendly to have to go to the triggers tab to dynamically change how a button looks, and it will definitely slow down configuration from having to keep switching between the button properties and the corresponding styling trigger(s) for that button. By similar logic we should consider removing all actions from buttons too. They can be defined in triggers from the button press events, and once we have conditional actions steps could be implemented purely with triggers and custom variables.
  4. That would essentially change the button style from being state based to command based, which will make it a lot harder to program complex situations correctly. With conditional actions it doesnt actually sound too bad to make a trigger to do this in most cases. But for example, if we want to have to have white text on black by default, white on red when A=1 black text when B=1. When A=1 and B=1, both should apply, with properties set by B=1 winning. I know these colours are stupid, but perhaps its a transparent png instead of text colour. With feedbacks, this is straightforward, this is how the stacking of feedbacks works today. With triggers, that will need to be a trigger which is either going to do something like if A=1 and B=1 ... else if A=1 ... else if B=1 ... else ... or it could be done as set white on black; if A=1 ....; if B=1 ....;. Companion doesnt currently batch those operations, resulting in it flashing through each of those states. It will also be a bit error prone as you will have to make sure that the correct button is selected in each action. And you will need to make sure to consider what happens when going between each combination of states, to make sure no property gets stuck.

So while triggers are more powerful, I think it better to keep the more user friendly but less powerful existing functionality on the buttons themselves, and let users who want to do complex things do it with triggers.

Julusian avatar Mar 12 '23 17:03 Julusian

All makes sense. You always have a better idea of the "big picture". :-) If you're able to do this, I look forward finally getting rid the hack I have to use to set button colours based on channel strip colours currently. :-)

MeestorX avatar Mar 12 '23 17:03 MeestorX

I came across this thread while looking for a way to dynamically change the PNG assigned to a button - Is there really no way to do that right now? I've looked through all of the actions / triggers and there doesn't seem to be any way to hook into that. Thank you!

alomanto avatar Apr 05 '23 19:04 alomanto

I have a button that mutes/unmutes a specific channel on multiple busses. I'd like to set this channel using a custom variable so that I have a single value to change when I use a different channel.

Sable147 avatar Jul 05 '23 23:07 Sable147

@Sable147 I don't think your comment is related to this issue. I don't know what module you're referring to in your post, but if it's a Yamaha module, what you're looking to do is already possible. Please click on the "bug" icon beside the module name in question to contact myself or the correct person to help you with this.

MeestorX avatar Jul 05 '23 23:07 MeestorX

I came across this thread while looking for a way to dynamically change the PNG assigned to a button - Is there really no way to do that right now? I've looked through all of the actions / triggers and there doesn't seem to be any way to hook into that. Thank you!

I have the same issue. Here's what I'm trying to accomplish.

  • Livestreaming setting. At the beginning we have a list of names of people who will be on stage.
  • We use different presets for PTZ cameras based on the heights of the people on stage.
  • We want to have a set of 4-5 buttons with the people's faces.
  • When their button is pressed, it sets variables pointing to the presets for the height of that person. (This is all set up already)
  • The only piece missing is being able to set the image for the person's face on the button. This has to be dynamic, as it changes frequently and new people come in from time to time.
  • We can't just use their name either because their names are in Korean (not supported in the text field). If we were just to put their name, it would have to also be as a PNG generated from the text of their name (external script).

Basically, I'm looking for a way to dynamically set the PNG for a button from either an action, or an external script via the HTTP API.

scientastic avatar Jun 25 '24 13:06 scientastic

@scientastic The official HTTP API supports PNG being changed, see here

EricAndrechek avatar Jun 27 '24 17:06 EricAndrechek