State Switching with CHOPs

Curriculum Navigator:

If you’re viewing this page from the TouchDesigner curriculum explorer, you can use the buttons below to interact with this topic.

Overview:

There are many ways we can think about ‘state’ when it comes to interactive systems. One way of thinking about state is as a snapshot of the parameters that control your TouchDesigner network, e.g. is a toggle on or off and what characteristics are associated with that on or off input. These examples are a starting point to explore possible ways to build a simple state machine in TouchDesigner using CHOPs. 

A Button Component is one of the simplest ways to determine and drive state. By toggling a button on or off, we can change other elements in our network to correspond accordingly. We can take this a step further to see how a button can be used to increment a counter — where the value of our counter is an indicator of which state we are in. 

When building multi-chapter experiences (an interactive kiosk or a live show), we often need to rely on concepts like ‘index’ to understand which section we are currently in, what comes next, and where we can go back to. 

The idea of index is often crucial when moving between states, and it’s often valuable to separate those concerns (index and state). Breaking state into an index and a collection of values makes it easier to move between states, or rearrange them independently.


References:
Scroll to Top