Great question — no, you absolutely do not need Python for this to work! You can build this whole “stable parameter” setup using just bindings and parameter references, without writing a single line of Python.
Let me walk you through it again, super clean, no code unless you want it.
Right now you are:
- Binding a UI Toggle directly to a Switch CHOP’s index or input (like
MANUAL_CIRCLE_RADIUS)
- But when the UI updates or reloads, the toggle gets rebuilt, and the bind breaks
Make a base somewhere in your project. Call it something like /control_state.
Inside that base:
- Right-click → Customize Component
- Add custom parameters, like:
CircleRadiusSource (Menu: Manual / MIDI / Audio)
MoveRadiusSource
- etc.
This is now your permanent state holder.
In your NETWORK_CONTROLLER UI panel:
-
For your toggle or menu (e.g., “RADIUS SOURCE”), instead of binding directly to the Switch CHOP, bind it to /control_state like this:
- Click the toggle’s
Value parameter
- Use
Bind → Point it to:
op('/control_state').par.Circleradiussource
Now: the UI toggle sets the parameter in /control_state.
On the logic side (e.g., MANUAL_CIRCLE_RADIUS, Switch CHOP, etc.):
-
Instead of binding from the UI, just reference /control_state:
- In a
Switch CHOP, set the Index parameter to:
op('/control_state').par.Circleradiussource
(This works if the param is a menu with values 0, 1, 2…)
If your menu uses names (like “Manual”, “MIDI”, etc.), then set the menu to return indices. You can do this in the parameter customization dialog.
| UI Toggles/Dropdowns | /control_state (Stable Params) | Logic Components |
|---|
| Bind here → | Holds the “true” values | Read from here |
- No more broken bindings
- UI can reload, replicate, or change — logic stays solid
- Still 100% visual workflow — no scripting needed
Want me to quickly mock up a .tox with this structure to get you started?Great question! Vector-based movement is super fun and powerful in TouchDesigner, especially when you want objects to move with direction and speed like in particle systems, simulations, or interactive installations.
At its core, it’s about this:
position += velocity * deltaTime
You treat movement as applying a velocity vector to a position vector every frame.
This is good for controlling a single object (like a circle moving around).
- Create a Constant CHOP called
velocity with two channels: vx, vy.
- Create a Speed CHOP, and connect the
velocity to it.
- This gives you the position over time.
- Use a Trail CHOP to visualize the path, or export position to move a 2D shape’s
tx, ty.
NOTE: Speed CHOP handles deltaTime internally, so it gives you proper frame-rate-independent integration.
For more complex behavior, like steering, forces, or boundaries, go with a CHOP Execute DAT and store position/velocity as state.
# Assume these are references to CHOPs or Parameters
dt = me.time.rate # frame rate for time step
px, py = pos['x'][0], pos['y'][0]
vx, vy = vel['x'][0], vel['y'][0]
op('pos')['x'][0] = new_px
op('pos')['y'][0] = new_py
Or, you could use storage on an operator like this:
base.store('pos', [x, y])
Then update and retrieve that in your logic each frame.
If you want to move many points or particles:
- Use Point SOP and modify positions using CHOP channels.
- Or better: Use a CHOP to SOP flow, where each point is updated from CHOP channels containing position data over time (maybe generated using logic similar to above).
- For more advanced stuff, consider using Feedback loops with TOPs and GLSL for GPU-based particle systems.
| Use Case | Approach |
|---|
| Move a single object | CHOP + Speed CHOP |
| Want interactivity, custom logic | Python + storage or CHOP Execute |
| Particles or multiple points | SOP + CHOP / Feedback / GLSL |
| Realistic physics/forces | Combine CHOP + Python logic |
Want me to mock up a simple example of vector movement (like a circle that moves with arrow keys or bounces off edges)?