In TouchDesigner, exposing certain parameters so that they can be adjusted in Perform Mode involves creating a user interface (UI) with control components such as sliders, buttons, and other interactive elements. Here’s how you can set this up:
-
Create a Control Panel:
- Use containers (
containerCOMP) to create a control panel.
- Add UI elements like sliders, buttons, and toggles inside this container.
-
Bind UI Elements to Parameters:
- Use expressions or bindings to link the UI elements to the parameters you want to control.
- Ensure the control panel is accessible in Perform Mode.
-
Add a Container COMP:
- Add a
containerCOMP to your network. This will serve as the control panel.
- Name it
controlPanel or something similar.
-
Add UI Elements:
- Inside the
controlPanel, add UI components like sliders, buttons, etc. You can find these in the UI section of the Op Create Dialog.
-
Add a Slider:
- Add a
sliderCOMP inside the controlPanel.
- Name it appropriately (e.g.,
slider1).
-
Bind the Slider to a Parameter:
- Select the parameter you want to control (e.g., the
Translate X parameter of a transformTOP).
- Right-click on the parameter and choose
Bind Parameter....
- Drag the slider’s value parameter (
slider1/Value) into the binding dialog.
-
Repeat for Other Controls:
- Add more UI elements and bind them to other parameters you need to control in Perform Mode.
If you need to perform more complex actions based on UI elements, you can use a CHOP Execute DAT.
-
Add a CHOP Execute DAT:
- Connect it to the output of a control CHOP (e.g., the slider value).
-
Edit the Script:
- Open the CHOP Execute DAT and write a script to handle the value change.
def valueChange(channel, sampleIndex, val, prev):
# Example: Adjust the Translate X parameter of a transformTOP
transform = op('path/to/your/transformTOP')
-
Set Perform Window:
- Go to
Dialogs > Window Placement....
- Add a new window and set its operator to the
controlPanel container.
- Configure the window settings as needed (e.g., size, borders, etc.).
-
Enable Perform Mode:
- Press
F1 to enter Perform Mode (or go to Dialogs > Perform Mode).
Here’s a more concrete example for controlling the Translate X parameter of a transformTOP:
-
Add a containerCOMP:
-
Add a sliderCOMP to controlPanel:
-
Bind the Slider to the Parameter:
- Select the
Translate X parameter of your transformTOP.
- Right-click and choose
Bind Parameter....
- Drag the
slider1 value parameter into the binding dialog.
-
Set Up Perform Window:
- Go to
Dialogs > Window Placement....
- Add a new window with the operator set to
controlPanel.
By following these steps, you’ll have a control panel that you can use to adjust parameters while in Perform Mode. This approach allows you to create an intuitive interface for real-time adjustments during performances.