Shape Widget as toggle?

How to make a shape widget as a on/off (or bypass) toggle?
I think this it the type of thing where a second widget with alpha set to “0” is used?
In Perform mode and Edit Mode, If the Plugin toggle is clicked, the (1) GP Shape widget does follow it.(turns dark as bypassed)
In Perform mode If the Shape widget is clicked, it does not toggle.

  1. shape widget mapped to bypass but it does not yet toggle
  2. plugin bypass toggle

A Shape widget is not designed for that.

Here is a workaround
Use a Text Label Widget and a normal Button Widget.
Map the Button widget and move the Text Label Widget over the Button Widget


Now when you click on the Text Label Widget the Button Widget is triggered also.

TextLabel.gig (49.4 KB)

And with this little rackspace script you can set the color of the text label

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   KNOPF : Widget
   TET   : Widget
//$</AutoDeclare>


// Called when a single widget value has changed
On WidgetValueChanged(newValue : double) from KNOPF

 if newValue == 1.0 then
  SetWidgetFillColor(TET,4294967119)
 else 
  SetWidgetFillColor(TET,4294907973)
 end 

End
1 Like

This looks like it will work but lost on step #3.
1)Use a Text Label Widget and a normal Button Widget.
2) Map the Button widget and move the Text Label Widget over the Button Widget
3) ..what?
Are these numbers a RGB+Alpha color? “429 496 711 9” “4294907973”
RGB CHART

Meh - you don’t need GP Script for this.

Put a shape on top of a widget — set the Alpha full on (so it’s not transparent), right click on the shape and select “Bring to Front”

That puts the shape in front of the widget, thereby hiding the widget, but clicking on the shape will still trigger the widget.

The script is to change the color of the shape, so you know the value of the button widget.

Sorry - I didn’t see your original post — but a piece was left out – depending on the order in which the widgets were inserted, you may still have to move the button BEHIND the shape.

When you set the backgroundcolor and transparency of the shape widget you see the hex value representing that color.
The values used in the script are the decimal values of that hex values.

GOAL
Performance Mode -Shape color to fade / dim when bypassed
Performance Mode - perform a toggle function

When the shape is mapped to “bypass” and is pressed on the plugin, it dims. What causes that?
I want it to do that from Performance mode using the widget not the plugin itself.
GP5_Shape

Why would you map a shape to bypass?

because there are many features i’ve never even tried and don’t know any better not to.
In this example logically it would seem the Shape would not do anything, so when it is attached to bypass (rightly or wrongly) what’s causing it to change color?

Shape widgets behave a bit special! :wink:
So what you see is not a change of the color of the widget, it is rather the opacity/transparency value which is affected.This can be used for some visual effects…

You can try yourself (best overlap another widget with a shape widget to better see the effect):
If you assign a plugin parameter (any) to a shape widget, the shape widget will change its transparency according to the parameter value (0= near transparent / 127 = fully opaque).
An even easier test-setup for this would be to put the shape and a knob into the same widget link group… then you can control the transparency of the shape with the knob.

In your special case, the bypass-parameter will have only two states ON/OFF so the shape will only get switched between transparant or fully opaque.

1 Like

The alpha channel is driven by the current value of whatever parameter to which the shame widget is mapped

1 Like

@pianopaul has the right idea, I’m just not getting the results shown in the example script. I still require some 1,2,3, type exact instructions.

@ schamass “transparency” is the word I was looking for, ~ thanks

also, just realized there is no way to copy the FFFFFFFF RGB color directly in GP5?

If you copy the entire widget, then you can right-click another widget > Paste Special > Paste color attributes. Not exactly what you’re looking for but it might be helpful.

1 Like

Copy color works as expected, but even if the decimal color code is placed in the script, after clicking the shape widget, color doesn’t stay.

REFERENCE

YELLOW = FFFF4F = 16777039
RED = FF0000 = 16711680
4294967119
4294907973

You also need alpha value

pure red (with no transparency) = FFFF0000, decimal 4294901760

pure blue (with no transparency) = FF0000FF, decimal 4278190335

1 Like