Buttons & values

Hi. I’m beginner and I need to create a network with diferent buttons. When I press each button i need to change the values of two parameters (I have this numeric values, and the values are the x and y rotate of a geo) . I’ve tried putting diferent things with constants an switchs but couldn’t get it. I appreciate any help. Thanks a lot

Hi @toupinha,

are these values predetermined or random or is it counting up? And I understand you correctly that one of the buttons would change the rx and the other the ry parameter of your Geometry COMP?

cheers
Markus

The values are determined (I have to move one box, each button have to show me a face of this cube, so I need 6 buttons and each button changes this values in geometry) I`ve tried with many chops but I can´t get it…
sorry for my english :pensive: and thanks a lot.

Hi @toupinha,

no worries - we can communicate in TouchDesigner :wink:
in the case of 6 buttons with 6 value pairs, one easy way to implement this is to see the buttons as a radio group.

For that put all buttons into a Container COMP and set the Button Type parameter of each Button COMP to Radio Down. Now the Container COMP will hold a Panel Value called radio which you can access via a Panel CHOP. This is a single value returning the index of which button you have selected.

Now for simplicity sake, you could create 6 Constant CHOPs with the 6 value pairs and feed that into a Switch CHOP. Append a Null CHOP to the switch and from there export the 2 channels to the Geo COMP’s rx and ry parameters.
The Switch CHOP’s Index parameter should be driven with the value you get from the Panel CHOP.

Always using Null operators as the last operator in a branch is good practice. When exporting to parameters especially, this would allow you to add in operators into the branch before the export without the need to remove exports and reexporting again.

To easily layout the 6 buttons in a Container COMP, navigate to the Children Page of the Container COMP’s parameters and select Left to Right under the Align parameter. You can use the Width and Height parameters on the Layout page of the Container to resize the container to your liking.

Maybe a last note: There are always multiple ways to do things in TouchDesigner. The one I described here is a very simple approach and hopefully serves your purpose but other usages might require a different approach.

Hope this helps
Best
Markus

radioAndSwitch.tox (2.4 KB)

1 Like

so…Radio Down is the key!! thanks a lot!!!