# Overview

TouchDesigner is a program that uses node-based programming and Python scripting.

## Operators (Nodes)

Each operator or node is like a [function](../glossary/functions-and-methods). Many will have input notches, parameters (values within the operator), and an output (similar to a return) that can go into another node.

## Types of Operators

In node-based programming, output data types have to match the input of the next node. In TouchDesigner, instead of multiple output types on one node, operators are separated by their own type:

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK5qGKAA9JmpoV0Ry0G%2F-MK5qrGeu3UOaTXoeJLE%2Fimage.png?alt=media\&token=a781d8de-3e67-4611-8aaf-ab94117a0df0)

### **COMP (Components)**

These are operators that handle things like user interface, lighting, etc.

### TOP (Texture Operators)

These operators handle 2D images, animations, and video effects. Think of these like Photoshop and AfterEffects.

### CHOP (Channel Operators)

These operators deal with numbers, booleans (on/off or true/false), and audio. Each value is often displayed as a "channel."

{% hint style="info" %}
Numbers over time and some arrays of numbers will appear as a line graph. To change this into a value that "slices" through the line graph values, use the Time Slice CHOP or the Time Slice parameter under the Common tab.
{% endhint %}

### SOP (Surface Operators)

These operators handle 3D shapes and objects. Think of these like Maya, Blender, etc.

### MAT (Materials)

These operators handle materials, textures, and shaders.

### DAT (Data)

These operators handle Python and other types of scripting as well as tables.

## Inputs

Input notches are on the **left side** of the operators.

_Example of an operator that has one input:_

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK18N5atEk-IVYicOWQ%2Fimage.png?alt=media\&token=36036d3d-e787-40e7-870a-fdc755aabafb)

_Example of an operator that has three outputs:_

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK18ls2yYGmUIwOUnpM%2Fimage.png?alt=media\&token=f39f1a3f-f542-4034-9b3c-62283c56c38a)

_Example of an operator that takes in multiple inputs to create a list or something like an array:_

![Notice that this input is larger than the others.](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK198KxG_cbrrFQk4b7%2Fimage.png?alt=media\&token=1e04c3d2-b01f-4f76-9b22-415e8ec8304f)

_Example of an operator that has no inputs:_

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK180apr3RoHApbOo0E%2Fimage.png?alt=media\&token=9447efa0-6b82-47f3-8596-bc55391f8a44)

### How to see what input is wanted

Hover your mouse over the input notch - a description will come up with the input number and description.

Examples:

![ ](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK19ozDzTEDsGJJl4v7%2Fimage.png?alt=media\&token=f4146363-d69f-4920-899e-2a2a9996973d)

Here, the operator is looking for a connected operator to provide an audio/video source as an input.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK1A6kaZ4UzJ_TmnowT%2Fimage.png?alt=media\&token=187ccaa1-c54a-48b3-bc88-d44d8f065cf9)

Here, the operator is looking for an operator with at least one channel connected to the first input to see if changes warrant a count change.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK1AZPmyEj70uqrDTes%2Fimage.png?alt=media\&token=a6f6ec17-994a-473d-8a98-63d9f59bbecf)

Here, the operator is looking for an operator connected to the second input that will fire "true" when the count should reset, if wanted.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK16QoZXknNWghqMpK3%2F-MK1B5Cob325MBTX5-dY%2Fimage.png?alt=media\&token=36a4c55e-ef9f-4a23-81f5-7dfe905d9b23)

Here, the operator is looking for an operator connected to the third input that will provide the increment value if different than the default. Note: this value can be negative!

## Parameters

Each operator will have a related parameters window appear when the operator is selected.

{% hint style="info" %}
If you do not see the Parameters window, this can be toggled on and off with the P key.
{% endhint %}

Example of a Parameters window:

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1BmFpCDAg5HL84y-C%2F-MK1COFjxhvYj9Qrg6PS%2Fimage.png?alt=media\&token=c8d05fed-63a1-4031-8f7f-fe6f056bde71)

Things to notice:

On the top left, the **type of operator** is shown (Movie File In).

Followed by the **name of the operator** that you can update. This will update the name that appears at the bottom of the operator node. (moviefilein1)

The next line has **icons for help** on the left and **advanced features** like tags, comments, language, and views on the right.

To save space, most Parameter windows will have **tabs** - here, they are Play, Image, Trim, Tune, and Common. These will change depending on the operator.

The rest are parameters - like in a function - that are values that change how something in a node looks, sounds, acts, etc.

### Common Parameters

For TOPs (purple texture operators), the **Common** tab is where you can update the resolution and aspect of the output image. It usually defaults to "Use Input," but can be changed. Free versions are limited, though.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1BmFpCDAg5HL84y-C%2F-MK1E5mpRprog9UAVfE4%2Fimage.png?alt=media\&token=c6bd0a2e-e81b-4213-81ad-e939dd4172d2)

For CHOPs (green channel operators), the **Common** tab is where you can change how a node appears (line graph vs. moving bar graph, called a "Time Slice").

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1BmFpCDAg5HL84y-C%2F-MK1EnAXL099KBcPpCIZ%2Fimage.png?alt=media\&token=826461ef-994f-4123-8313-c4ab310ddd1d)

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1BmFpCDAg5HL84y-C%2F-MK1EsHQD5x0CF-g6TYN%2Fimage.png?alt=media\&token=3b32a5a9-5b3e-4555-b6ec-1c69fea4ba66)

### Referencing Other Operators in Parameters

There are times when you want a value from an operator that isn't connected into the input. You can reference it instead!

There are two ways to do this.

First, expand the parameter you want to have the value in by pressing the plus sign that appears next to it when you hover over the name of the parameter:

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1HA1zBjj1conCfqXl%2Fimage.png?alt=media\&token=b8db3b8f-8831-44c9-baa7-1bff717dfba0)

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1HETnjj9dPxZI236x%2Fimage.png?alt=media\&token=1edd1783-4c6c-424c-aae2-e0cb47a1b90d)

This will show the variable name of the parameter.&#x20;

The colored squares next to the value mean:

**Gray** - Value typed in

**Cyan** - An "expression" using Python to reference an operator or variable like absTime.seconds

**Green** - An exported value (references through file organization)

**Lavender** - Bind....this is new, so I have no idea.

We will use the Cyan expression option, so click on the cyan square.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1I7FyiuyAYHo9m3f_%2Fimage.png?alt=media\&token=27b46813-2bf1-4c28-a11e-fc7ac2e27258)

It defaults to whatever the current type value was.

The syntaxes to reference operator values is:

```python
op('operatorname')['channelname']
```

or

```python
op('operatorname')[index]
```

or (for parameter values)

```python
op('operatorname').par.parametername
```

In this example, I want this count CHOP value to be the seed value of my noise CHOP

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1J9G5qeXQkpvQOAgs%2Fimage.png?alt=media\&token=9938aeb5-0adc-4999-ab24-225f147e8d9d)

So here are my options:

#### Option 1: Typing in an expression

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1JOFiefV_tDE61jT6%2Fimage.png?alt=media\&token=160e9daf-3891-4a18-baa4-07e6c2763786)

or

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1JTFVYBWA9YBHSBU0%2Fimage.png?alt=media\&token=6a9439a0-68de-45dd-842e-280e1d5b5438)

Let's say instead of this output value, I want the Reset Value parameter of the count CHOP instead:

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1K28xl1VhFqraFZn4%2Fimage.png?alt=media\&token=bf174586-d7a5-471b-bbc9-b2c71fac9d21)

I could use the following expression:

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1KBzuLi2QhYD0HMMf%2Fimage.png?alt=media\&token=4cad2a1f-0af4-41f8-8707-3a4efbb4d2a3)

#### Option 2: Click and Drag Output Values

Toggle the Viewer Active option on the bottom right of the channel operator.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1KvG21tYan4zxptjC%2Fimage.png?alt=media\&token=3307799c-e479-4c7b-9990-903e5be7f64b)

This will fill the operator with the output value.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1L1H40N2-wnPzuUJQ%2Fimage.png?alt=media\&token=a0449bb8-331a-4d83-84ff-028fbb7df358)

Select your target operator to bring up its parameters.

Click and drag from your source operator to the field for your target parameter and choose **CHOP Reference**.

![](https://4077345522-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFloEXqUun2rk6R28rU%2F-MK1F1YyF-21Y50lf2OC%2F-MK1M90THaZjaoOcFHam%2Ftdref.gif?alt=media\&token=d49ad5f7-3150-4ee5-94a8-3f46ef6997cd)

## Output

The output notch is on the right side of the operator.
