Dynamic Change Of Button Target

Moderator: Moderator Group

Dynamic Change Of Button Target

Postby ggooch » Thu Mar 24, 2011 11:46 pm

I am pretty sure the answer is no, but is there any way to change the target of a button by pressing another button. For example, I have one button for Play and by pressing another set of buttons I could change which layer this Play button effects?

Thanks,
Geoff
ggooch
 
Posts: 3
Joined: Wed Jul 30, 2008 3:33 pm

Re: Dynamic Change Of Button Target

Postby Daniel Kaminski » Fri Mar 25, 2011 1:38 am

Yes,
that is possible. You have to use variables.
Here are a few of the scripts that can be used.

VString,'Name','Value'
VInt,'Name','Value'
VInt,'Name','Value'
VGetFaderVal,'VarName','FaderID'

A variable can be used anywhere in a Script
e.g.
VInt,Sequenz,1
SeqGotoCue,Sequenz,1

instead of
SeqGotoCue,1,1

The value of a Variable can be changed from any button or Script and than be used in another Button.
If you have the WD Pro you can also use Nodes to change the values of buttons.
But be careful when using variables, depending on what you do, you might be able to create infinite loops or produce why to many GUI Changes in a very short time, so that WD will become unstable.

Daniel
--
Daniel Kaminski
Pandoras Box Expert
User avatar
Daniel Kaminski
 
Posts: 1072
Joined: Tue Jul 22, 2008 10:55 am
Location: Herten, Germany

Re: Dynamic Change Of Button Target

Postby ggooch » Fri Mar 25, 2011 2:50 am

Daniel,
Thanks for the answer. I see how that works to change the function of custom buttons. Can I use a variable to change the Device that a Media Panel is assigned to or the Device that a Fader is assigned to?

Thanks Again,
Geoff
ggooch
 
Posts: 3
Joined: Wed Jul 30, 2008 3:33 pm

Re: Dynamic Change Of Button Target

Postby Julia Foest » Fri Mar 25, 2011 10:10 am

Hi Geoff,

yes, you can do it!
But you have to use Variable of the type Double.

So, first create the variable with the script
VDouble,'Var_Name','Value'

For example:
VDouble,V_Devices,1.2

To assign the value of the variable as Device to the MediaPanel with the ID 1, use this script:
WDMediaPanelSetDevices,'PanelID','Devices'

For example:
WDMediaPanelSetDevices,1,V_Devices

Please note that after changing the value of the variable you have to use the script WDMediaPanelSetDevices again to assign the new value to the Media Panel. This is not updating automatically.

Best regards,
Julia
User avatar
Julia Foest
 
Posts: 521
Joined: Tue Nov 18, 2008 2:44 pm
Location: Berlin, Germany

Re: Dynamic Change Of Button Target

Postby ggooch » Fri Mar 25, 2011 6:45 pm

Ok we are making good progress here. Two more questions now.

-Can a variable change the target of a fader?

-Can I stack together multiple variablew from multiple buttons? For example, pressing button one sets the variable to 1.1 pressing button two sets the variable to 1.2 pressing button one followed by button two sets the variable to 1.1, 1.2?

Thanks,
Geoff
ggooch
 
Posts: 3
Joined: Wed Jul 30, 2008 3:33 pm

Re: Dynamic Change Of Button Target

Postby Julia Foest » Mon Mar 28, 2011 11:00 am

Hi Geoff,

this is a bit more complicated:

-Can a variable change the target of a fader?

You can't do it directly by changing the device inside the fader. But you could do it this way:
Creating a fader and an according fader inout node. Connect this fader input node to a PB Device Output Node.
If you want to change the target of the device output node, use this script twice (once for the Site ID and once for the Layer ID):
WDNodeSetParam,'NodeID','ParamID','Value'.

Example:
If you want to set the output to the Device 1.3 (=Site1, Layer3) and the device output node has the ID 10:
WDNodeSetParam,10,1,1
WDNodeSetParam,10,2,3
So the first parameter in the node points to the site ID, the second one to the layer ID.

-Can I stack together multiple variablew from multiple buttons? For example, pressing button one sets the variable to 1.1 pressing button two sets the variable to 1.2 pressing button one followed by button two sets the variable to 1.1, 1.2?


You can do this using several nodes.
Here my ideas to this.
Create your 2 buttons (in this case I describe please use Fullsize/Halfsize or Quartersize Buttons instead of CustomScript Buttons).
Create 2 Button Input Nodes and assign Button1 to the Node1, Button2 to the Node2.
Create a Variable eg. called V_1 with the value 0 (via script).
Connect the variable input node and the Button Input Node 1 with an ADD-Filter Node: add both values inside the node.
Create three script output nodes: two connected to the ADD filter node, one connected directly to the Button Input Node 2 ( see picture).

example.jpg


So let's go through the routine:
the variable v_1 is 0. If you now press the button 1, the ADD-result gets the value 1. Set the first script output node connected to the ADD filter node to this:
If Add-result = 1: and now you can set another variable to any value via script (eg. setting a variable called "v_device" to the value 1.1).
In the Script output node connected to Button Input Node 2 enter this:
If button input = 1: set the variable v_1 to the value of eg. 10 and set your other variable "v_device" eg. to the value 1.2.

If you now press button 1 again, the add-result gets the value 11. So the second script output could be set up like this:
If add-result = 11, set your variable eg. to "1.1 1.2" and you may reset the v_1 variable from 10 to 0 again.

So on the next press of button 1 the add-result will be 1 again and the first script output node will be executed again.

Please note: if you want to assign eg. a fader or Media panel to several devices at once, dont use a "," between the devices, just enter 1.1 1.2 with a space character in between.

I hope this helps and you get an idea of how to get what you want to have.

Best regards,
Julia
You do not have the required permissions to view the files attached to this post.
User avatar
Julia Foest
 
Posts: 521
Joined: Tue Nov 18, 2008 2:44 pm
Location: Berlin, Germany


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 3 guests