Is there a way I can show/hide Global rackspace controls (panel) based on the individual rackspace? Now it’s just show/hide for all the rackspaces.
There is at least a GP-Script function which can do this:
ShowGlobalRackspace : Show or hide the global rackspace front panel
- Declaration: function ShowGlobalRackspace (show : boolean)
- Category: Actions
Parameters * show : boolean
Thank you. I’ll try your solution.
Great! If you have questions, just ask right away.
How do you make this into a script?
Thanks
Let’s assume you want to trigger the intended script via a button or LED widget from a local rackspace.
That way you are able to
a) learn the widget with any midi message coming from your controller
b) use variations to show/hide the Global Rackspace (if needed)
The widget needs a “name” first, so that it can be accessed by the script - to “name” a widget for scripting, you will find a data field in the “Advanced” tab of the widget properties called “OSC/GPScript Name” - there you can enter a name of your choice (be aware that GP-script is case-sensitive, so remember well how you wrote the name!).
Let’s say, the the widget to show and hide the Global Rackspace panel shall have the name btnShowGlobal (i use to use small abreviations to instantly notice what kind of widget it is - that’s the “btn” for "button. For the rest of the name i always use meaningful words… not too long not too short)
Now that the button on the local panel has a scripting name, open the local script window.
The script would be as follows:
// first declare the used elements as variables
var
btnShowGlobal : widget // we use a widget that has the name btnShowGlobal (case sensitive!!!)
//This is the "callback" that gets triggered every time the widget changes its state
//means: it is a piece of code that is executed each time our button chnges from ON to OFF and vice versa
//this state is represented by the value of that widget, which is held in its own variable (the held value is of the "double" type and ranges between 0.0 and 1.0, where 0.0 means OFF and 1.0 means ON)
//The variable can be named at will, but its use within the callback code must be consistent!
On WidgetValueChanged (bVal : double) from btnShowGlobal
if bVal>0.6 then //if the widget's value is greater than 0.6 means, if it is ON for sure (everything greater than 0.5) then
ShowGlobalRackspace(true) // use the script function to show the Global Rackspace (set it "true")
else
ShowGlobalRackspace(false) // use the script function to hide the Global Rackspace (set it "false")
end
End
That’d be it!
Don’t forget to press the “Compile!” button after you have finished, else the script won’t work!
(This has to be done only once after any changes)
Good luck!
Hey thanks