Category Archives: TD tutorials

Nov 13 2014

Filter CHOP tutorial.

The filter CHOP. TouchDesigner 088. 2014.
The Filter CHOP can help you smooth, affect, or otherwise adjust incoming channel data.

1
00:00:00,567 –> 00:00:03,900
Let’s take a look at the filter
CHOP.

2
00:00:03,900 –> 00:00:10,000
The filter CHOP can smooth, or
sharpen, the incoming chop data.

3
00:00:10,000 –> 00:00:22,533
This sample network merges
unfiltered and filtered CHOP
data, so you can easily
visualize a side-by-side
comparison.

4
00:00:22,533 –> 00:00:33,533
The filter CHOP has 2 very
important parameters, the
“Effect” and “Filter Width”
parameters.

5
00:00:33,533 –> 00:00:36,567
We start with a noise CHOP.

6
00:00:36,567 –> 00:00:44,533
We can create different types of
animating noise, and see the
effects of filtering.

7
00:00:44,533 –> 00:00:50,133
The merge CHOP combines the
filtered and unfiltered data.

8
00:00:50,133 –> 00:00:54,467
The yellow line is the raw data.

9
00:00:54,467 –> 00:01:03,500
I’ll right click on the merge
CHOP, and choose “View” from the
pop-up menu.

10
00:01:03,500 –> 00:01:14,533
This is one of several methods
you can use to simultaneously
monitor different regions of the
Touch Designer workspace.

11
00:01:14,533 –> 00:01:19,767
I’ll adjust some of the noise
CHOP’s parameters.

12
00:01:19,767 –> 00:01:29,533
There are 7 types of filters,
and it is worth investigating
the effects each has on incoming
data.

13
00:01:29,533 –> 00:01:36,967
Some filter and width
combinations introduce more
delay than others.

14
00:01:36,967 –> 00:01:43,967
An “Effect” setting of zero
eliminates filter processing
altogether.

15
00:01:43,967 –> 00:01:55,433
Increasing the “Filter Width”
parameter causes more of the
surrounding sample range to be
included in the filter
calculation.

16
00:01:55,433 –> 00:02:05,133
Each application of the filter
chop may require a different
fine tuning of filter types and
parameters.

17
00:02:05,133 –> 00:02:15,900
Some applications may be
extremely accuracy or time
sensitive, while others may not.

18
00:02:15,900 –> 00:02:23,767
You can sharpen incoming data
that may be too smooth, to
create a greater value range.

19
00:02:23,767 –> 00:02:30,467
You can also de-spike incoming
data such as harsh audio spikes.

20
00:02:30,467 –> 00:02:32,467
The filter CHOP is very
powerful, and almost always
requires fine tuning based on
the specific application.

Nov 13 2014

EXECUTE DATs tutorial.

The EXECUTE DATs. TouchDesigner 088. 2014.
The EXECUTE DATs are a family of Operators that can run scripts on TouchDesigner events. These are the most powerful group of DATs, and are used extensively in building interactive networks. This is a special tutorial covering 6 DATs.

1
00:00:00,333 –> 00:00:06,267
This tutorial will focus on the
family of execute DATs.

2
00:00:06,267 –> 00:00:13,267
6 DATs that run scripts when
specific events happen in Touch
Designer.

3
00:00:13,267 –> 00:00:20,300
I built 6 example networks,
let’s start with the execute
DAT.

4
00:00:20,300 –> 00:00:27,267
The execute DAT can respond to 6
possible events, or processes.

5
00:00:27,267 –> 00:00:42,900
In order to work, the execute
DAT must have a Python script,
or snippet, within the targeted
Python method, as well as its
corresponding toggle enabled in
the parameters panel.

6
00:00:42,900 –> 00:00:55,100
This example creates 3 actions,
1 on frame start, 1 on frame
end, and 1 when the play state
changes.

7
00:00:55,100 –> 00:00:59,300
I’ve inserted a line into the
“frameStart” method.

8
00:00:59,300 –> 00:01:06,400
It fills the cell in row index
1, and column index 1, with the
frame number.

9
00:01:06,400 –> 00:01:11,133
We fill the next cell with the
frame number on frame end.

10
00:01:11,133 –> 00:01:18,333
The “playState” method has some
simple logic that alerts us to
the play head state.

11
00:01:18,333 –> 00:01:34,833
The execute DAT is commonly used
to monitor Touch Designer
processes, or, by using the
“start” method, to create setup
routines that prepare a network
when the program is launched.

12
00:01:34,833 –> 00:01:42,867
I often use the “exit” method to
perform clean up when Touch
Designer exits.

13
00:01:42,867 –> 00:01:48,500
Next let’s look at the chop
execute DAT.

14
00:01:48,500 –> 00:01:53,133
This operator is extremely
powerful and useful.

15
00:01:53,133 –> 00:02:06,333
It provides a simple framework
for you to convert CHOP
processes, to analyze CHOP
behaviors, and to build logic
based on CHOP events.

16
00:02:06,333 –> 00:02:11,767
You must first provide the DAT
with a reference CHOP.

17
00:02:11,767 –> 00:02:14,567
This is the CHOP that will be
monitored.

18
00:02:14,567 –> 00:02:23,867
You can toggle the “Active”
parameter to start or stop the
DAT’s execution.

19
00:02:23,867 –> 00:02:29,500
There are 5 methods that
correspond to CHOP events.

20
00:02:29,500 –> 00:02:41,300
It’s very important to realize
that ON is defined as any value
greater than 0, and OFF is
defined as 0.

21
00:02:41,300 –> 00:03:01,000
I’ve built some Python snippets
to showcase some simple ON/OFF
state logic, and I’ve used the
“valueChange” method to fill a
table cell with the evaluation
of the beat CHOP’s first
channel.

22
00:03:01,000 –> 00:03:14,400
This setup can help you
visualize the nature of OFF/ON
state logic, and help you
understand the options you have
for designing CHOP execution
timing.

23
00:03:14,400 –> 00:03:18,033
Next we’ll look at the dat
execute DAT.

24
00:03:18,033 –> 00:03:24,967
This operator and workflow is
very similar to that of the CHOP
execute DAT.

25
00:03:24,967 –> 00:03:30,433
Here I’ve built a representation
of a common Touch Designer
network.

26
00:03:30,433 –> 00:03:37,167
The end result is a table that
changes dynamically based on
user input.

27
00:03:37,167 –> 00:03:46,200
The dat execute DAT monitors
this table, and outputs data
based on the table’s state.

28
00:03:46,200 –> 00:03:51,233
There are 5 possible methods, or
states, we can monitor.

29
00:03:51,233 –> 00:04:05,667
The size and shape of the table
will change based on user
activity, and we can use this
activity to trigger any other
sort of logic in Touch Designer.

30
00:04:05,667 –> 00:04:18,833
Touch Designer has several
powerful methods for each
operator, including the table
DAT, that can help you modify or
access information about that
DAT.

31
00:04:18,833 –> 00:04:30,667
Here, I’ve used the “numRows”
and “numCols” members of the
table DAT class, to report the
size and shape of the table.

32
00:04:30,667 –> 00:04:42,667
I designed this network as a way
to illustrate a technique for
changing a TOP into a CHOP, then
into a DAT.

33
00:04:42,667 –> 00:04:54,833
By using the button, we can add
a colored cell to the table, and
by using the sliders, we can
alter the shape of the table.

34
00:04:54,833 –> 00:05:03,433
Notice how the dat execute DAT
creates a response to the
table’s changing shape.

35
00:05:03,433 –> 00:05:19,967
Keep in mind, the logic I’ve
written for the changing cell
method does not report the cell
ID, but only keeps track of the
fact that an unknown cell has
changed.

36
00:05:19,967 –> 00:05:26,533
You can use this network as a
basis for creating more
sophisticated logic.

37
00:05:26,533 –> 00:05:41,233
For example, you could restrict
user input to certain
specifications, or create
triggers that execute other
behaviors based on certain
criteria.

38
00:05:41,233 –> 00:05:45,200
Let’s take a look at the op
execute DAT.

39
00:05:45,200 –> 00:05:51,833
This DAT is more generic than
the chop or dat execute DATs.

40
00:05:51,833 –> 00:05:56,467
It can monitor any operator,
including TOPs.

41
00:05:56,467 –> 00:06:02,667
It is a common practice to
change Touch Designer networks
dynamically.

42
00:06:02,667 –> 00:06:11,300
Using an op execute DAT is a
good way to keep track of
changes to Touch Designer
networks.

43
00:06:11,300 –> 00:06:19,067
I’m using an info CHOP to report
information about the blur TOP.

44
00:06:19,067 –> 00:06:23,633
The info CHOP is an extremely
important operator.

45
00:06:23,633 –> 00:06:33,000
It’s used very commonly in Touch
Designer, and it’s a great
companion to the op execute DAT.

46
00:06:33,000 –> 00:06:49,633
I’m using the info CHOP to
report the number of times the
blur TOP has cooked, and I’m
using the op execute DAT to
report when that state changes.

47
00:06:49,633 –> 00:06:53,867
The op execute DAT can monitor
flag states.

48
00:06:53,867 –> 00:06:58,733
Flags are the buttons running
down the left side of an
operator.

49
00:06:58,733 –> 00:07:06,233
Bypass is a commonly used flag;
it will stop an operator from
cooking.

50
00:07:06,233 –> 00:07:14,267
Remember, in order to work
properly, the op execute DAT
must have an operator to
monitor.

51
00:07:14,267 –> 00:07:26,133
In this case the blur TOP, and
the methods we wish to employ
must have their corresponding
toggle enabled in the parameters
panel.

52
00:07:26,133 –> 00:07:33,167
The “wireChange” method lets us
monitor the inputs and outputs
of any operator.

53
00:07:33,167 –> 00:07:42,333
When we change the blur TOP’s
input, we see the op execute DAT
can report this change.

54
00:07:42,333 –> 00:07:49,667
We see that still images don’t
cook unless forced to, and
movies cook every frame.

55
00:07:49,667 –> 00:07:55,067
We can also see the effect of
enabling the bypass flag.

56
00:07:55,067 –> 00:07:59,067
Now let’s look at the panel
execute DAT.

57
00:07:59,067 –> 00:08:06,433
The panel execute DAT is similar
to the chop execute DAT, but it
monitors panels.

58
00:08:06,433 –> 00:08:16,333
Panels are a special type of
component, they are used to
create customized interactive
controls.

59
00:08:16,333 –> 00:08:22,367
They are often used to create
user interface elements.

60
00:08:22,367 –> 00:08:31,867
Here, I’m monitoring a field
panel. A field panel allows
users to type text strings into
a field.

61
00:08:31,867 –> 00:08:37,267
The panel execute DAT has a
parameter named “Panel Value”.

62
00:08:37,267 –> 00:08:45,400
By clicking the arrow button to
the right, we can see a list of
all the available values the
panel offers.

63
00:08:45,400 –> 00:08:55,867
I’ve added a panel CHOP, which
also monitors the field panel,
to show you some of the values
that are interactively
monitored.

64
00:08:55,867 –> 00:09:02,800
Panels are accessed under the
components tab of the OP create
dialogue.

65
00:09:02,800 –> 00:09:16,500
Similar to the chop execute DAT,
the value of 0 or NULL equates
to OFF, and anything other than
0 equates to ON.

66
00:09:16,500 –> 00:09:23,533
I’m using using a special Python
snippet to reference the value
of the text string in the field.

67
00:09:23,533 –> 00:09:31,367
The operator it references is
the “out1” DAT, located inside
the field component.

68
00:09:31,367 –> 00:09:48,600
When I type new text into the
field, you’ll see the results
are monitored by the panel
execute DAT, and the changes are
processed by the various 5
methods employed by the DAT.

69
00:09:48,600 –> 00:09:58,200
If I change the value in text
field to 0, you’ll see that we
get a report that the field is
currently OFF.

70
00:09:58,200 –> 00:10:04,967
I change the value to 1, and the
field state is reported as ON.

71
00:10:04,967 –> 00:10:20,867
This technique is extremely
useful in building user
interfaces, where user actions
need to be closely monitored,
and can trigger resulting
animations or logic actions.

72
00:10:20,867 –> 00:10:27,400
The parameter execute DAT
monitors an operator’s
parameters.

73
00:10:27,400 –> 00:10:35,267
I’ve wired 2 constant CHOPs to a
switch CHOP, and we’ll monitor
the switch.

74
00:10:35,267 –> 00:10:46,400
The switch CHOP has 2 parameters
we are interested in monitoring:
the “index” parameter and the
“indexfirst” parameter.

75
00:10:46,400 –> 00:10:59,300
The parameters we wish to
monitor must be entered by name
in the parameter named
“Parameter” in the parameter
execute DAT.

76
00:10:59,300 –> 00:11:05,100
It’s a bit confusing, yes, but
very logical and powerful.

77
00:11:05,100 –> 00:11:16,633
You can always find the actual
name of the parameter by
hovering your mouse over the
entry in the parameter panel.

78
00:11:16,633 –> 00:11:30,633
The setup for this example is
similar to the previous
examples, but since we are
monitoring and accessing
parameters, pay attention to the
Python snippets I’ve used.

79
00:11:30,633 –> 00:11:40,533
The Python object named “par” is
used to access a parameter,
followed by the parameter’s
name.

80
00:11:40,533 –> 00:11:53,200
It’s important to understand the
underlying architecture and
difference between, a CHOP’s
parameters, and its channel
values.

81
00:11:53,200 –> 00:11:58,200
This example is designed to help
you see that difference.

82
00:11:58,200 –> 00:12:10,533
We can use Python expressions to
drive the “Index” parameter of
the switch CHOP, or we can use a
constant, which is an integer or
a float.

83
00:12:10,533 –> 00:12:21,200
The parameter execute DAT can
monitor the state of the “Index”
parameter, and tell us what
method we are currently using.

84
00:12:21,200 –> 00:12:34,900
If we are using expressions, we
can access the value of that
expression as an evaluation, or,
we can access the Python snippet
itself as a string.

85
00:12:34,900 –> 00:12:36,900
Since we are monitoring the
parameter named “inputfirst”, we
can also tell whether or not
that parameter is enabled.

Nov 12 2014

MULTI-IN TOPs tutorial.

The MULTI-IN TOPs. TouchDesigner 088. 2014.
This tutorial covers the main multi-in TOPs in TouchDesigner. These Operators allow you to combine 2D images in powerful yet standard methods. This is a special tutorial covering 12 TOPs.

1
00:00:00,233 –> 00:00:06,033
In this tutorial, we will
examine 12 multi in TOPs.

2
00:00:06,033 –> 00:00:19,667
These TOPs are commonly used to
combine, or blend, texture
operators together using a
variety of techniques and pixel
weighting calculations.

3
00:00:19,667 –> 00:00:22,467
Let’s look at the add TOP.

4
00:00:22,467 –> 00:00:35,833
We have 2 constant TOPs, 1 with
a resolution of 256 x 256, and
the 2nd with a resolution of 512
x 512.

5
00:00:35,833 –> 00:00:46,433
The add TOP, as with all of the
TOPs we’ll examine here, must
know which of the inputs to
consider as the fixed layer.

6
00:00:46,433 –> 00:00:55,700
If we set the “Fixed Layer” to
layer 2, the add TOP will be set
to the resolution of layer 2.

7
00:00:55,700 –> 00:01:08,633
With a “Pre-Fit Overlay” setting
of “Native Resolution”, the
non-fixed layer will be added to
the other layer at its native
resolution.

8
00:01:08,633 –> 00:01:14,467
It will not be stretched to fill
the fixed layer’s resolution.

9
00:01:14,467 –> 00:01:24,833
The “Extend Overlay” parameter
tells the add TOP if and how to
fill the unused space.

10
00:01:24,833 –> 00:01:36,233
By pressing the “Viewer Active”
tab, and right clicking on any
TOP, we can access the “Display
Pixel Values” option.

11
00:01:36,233 –> 00:01:50,433
When using TOPs like the add TOP
to combine images, sometimes we
need to examine exact pixel
values, in order to fine tune
our settings.

12
00:01:50,433 –> 00:02:03,867
We can see the result of the add
operation, so if we need to, we
can go back to our source inputs
and adjust them to create
desired output.

13
00:02:03,867 –> 00:02:07,800
Next we’ll examine the composite
TOP.

14
00:02:07,800 –> 00:02:18,400
The composite TOP can accept an
arbitrary amount of inputs, and
you can choose from 16 different
composite operation types.

15
00:02:18,400 –> 00:02:26,933
We are compositing 2 different
colorful ramp TOPs, using the
“Divide” operand.

16
00:02:26,933 –> 00:02:31,600
Let’s look at the effects of
some transformation settings.

17
00:02:31,600 –> 00:02:40,867
Remember, we always have 1 fixed
layer; the rest of the layers
are considered overlay layers.

18
00:02:40,867 –> 00:02:57,000
When I turn the “Extend Overlay”
to “Zero”, the composite TOP
draws an RGBA value of 0 in the
extra space created by
offsetting the overlay layer’s
transform.

19
00:02:57,000 –> 00:03:05,700
We must tell the composite TOP
what to do with the extra space
created by the offset.

20
00:03:05,700 –> 00:03:17,100
An extend condition of “Hold”
will repeat the first or last
rows or columns of pixels in the
overlay.

21
00:03:17,100 –> 00:03:31,400
As with other operators in Touch
Designer, we have the ability to
tile or loop out-of-range values
with a number of different
options.

22
00:03:31,400 –> 00:03:42,300
By experimenting with these
settings you can greatly extend
the basic functions of these
multi in TOPs.

23
00:03:42,300 –> 00:03:46,200
Here’s another example of the
composite TOP.

24
00:03:46,200 –> 00:03:55,133
This time we have 4 inputs;
there are 4 rectangle TOPs with
various color and shape
settings.

25
00:03:55,133 –> 00:04:01,167
I’m using the “Add” operand to
composite the images together.

26
00:04:01,167 –> 00:04:13,167
I have input 1 set as the fixed
layer, and when I adjust
transformation parameters, this
will affect all the other
inputs.

27
00:04:13,167 –> 00:04:28,233
Since the composite TOP can
accept any number of inputs, it
treats the 1st input as layer 1,
and the entire grouping of the
rest of the inputs as layer 2.

28
00:04:28,233 –> 00:04:37,867
When I change the fixed layer to
input 2, you’ll see that
transformations only affect the
1st input.

29
00:04:37,867 –> 00:04:50,400
There is a way to manipulate the
transforms of the individual
inputs in the 2nd layer; by
using the “Transform Step”
parameter.

30
00:04:50,400 –> 00:05:03,167
This value is an offset, and it
wont allow you to affect each
input individually with specific
transformation settings.

31
00:05:03,167 –> 00:05:11,433
Let’s take a look at how the
pivot point location will affect
rotation and scale
transformations.

32
00:05:11,433 –> 00:05:21,800
The UV space of the texture
operator is 0 to 1, left to
right, and bottom to top.

33
00:05:21,800 –> 00:05:29,133
So a pivot value of .5 equates
to the center of the UV space.

34
00:05:29,133 –> 00:05:44,467
When I change the pivot
location, the transformations
are offset from this new
location, affecting the entire
layer, which, in this case, is a
group of 3 inputs.

35
00:05:44,467 –> 00:05:56,767
By exploring the parameters in
the transform tab, you can
create complex designs and
animations from simple texture
inputs.

36
00:05:56,767 –> 00:06:00,700
Next, we’ll look at the cross
TOP.

37
00:06:00,700 –> 00:06:07,400
The cross TOP creates an evenly
weighted blend between the 2
inputs.

38
00:06:07,400 –> 00:06:18,167
You can selectively transform
the overlay input; the cross TOP
can be used to create specific
texture blend values.

39
00:06:18,167 –> 00:06:23,067
Next, let examine the difference
TOP.

40
00:06:23,067 –> 00:06:32,433
Difference blending will
subtract the pixel value in the
1st input, from the pixel value
in the 2nd input.

41
00:06:32,433 –> 00:06:38,867
This network has 2 inputs of the
same size and pixel format.

42
00:06:38,867 –> 00:06:49,133
Under the “Common” tab, we have
options for determining which
pixel values are included in the
difference calculation.

43
00:06:49,133 –> 00:06:53,367
This is the “Channel Mask”
parameter.

44
00:06:53,367 –> 00:07:01,333
When I click the “Alpha” button,
I eliminate the alpha channel
from the difference calculation.

45
00:07:01,333 –> 00:07:06,800
We’ll explore channel masking in
greater detail very soon.

46
00:07:06,800 –> 00:07:09,767
Let’s look at the inside TOP.

47
00:07:09,767 –> 00:07:20,667
The inside TOP uses the alpha
channel of input 2 to determine
what parts of input 1 will be
drawn.

48
00:07:20,667 –> 00:07:28,867
We have inputs of 2 different
resolutions, but they have
matching aspect ratios.

49
00:07:28,867 –> 00:07:43,133
When using multi in TOPs like
the inside TOP, it’s always
important to know how resolution
and aspect will affect the
alignment of the blended image.

50
00:07:43,133 –> 00:07:53,867
I’m changing the scale
transform, and you can see how
to changing which layer is fixed
will affect the blended image.

51
00:07:53,867 –> 00:08:03,767
The “Transform” tab in the
parameters panels will give you
the flexibility you need to make
fine tuned adjustments.

52
00:08:03,767 –> 00:08:16,333
You can use channel masking to
affect the final output, but you
can also use it to troubleshoot
or adjust your image
combinations.

53
00:08:16,333 –> 00:08:26,033
It can sometimes be difficult to
see the effect on all pixels, or
to determine where is specific
problem might be.

54
00:08:26,033 –> 00:08:32,000
Channel masking can help you
isolate compositing issues and
fix them.

55
00:08:32,000 –> 00:08:35,767
Now let’s examine the matte TOP.

56
00:08:35,767 –> 00:08:46,300
The matte TOP uses a 3rd input
to determine what parts of the
first 2 inputs can be seen.

57
00:08:46,300 –> 00:08:50,433
I’m using a noise TOP as the 3rd
input.

58
00:08:50,433 –> 00:09:02,033
I need to use the alpha channel
to create the matte, so I must
set the “Alpha” channel output
parameter to “Noise”.

59
00:09:02,033 –> 00:09:08,467
The matte TOP can use a variety
of the 3rd input’s channels as a
matte.

60
00:09:08,467 –> 00:09:15,867
Here, the noise TOP has no alpha
output, so I could use it’s
luminance instead.

61
00:09:15,867 –> 00:09:26,667
The matte TOP has a “Switch
Inputs” parameter; this allows
you to blend the first 2 inputs,
or to switch them completely.

62
00:09:26,667 –> 00:09:35,767
Switch values of 0 or 1 have the
same effect as re-wiring the
inputs.

63
00:09:35,767 –> 00:09:40,200
Next, we’ll examine the multiply
TOP.

64
00:09:40,200 –> 00:09:46,600
The multiply TOP multiplies the
2 input’s pixel values.

65
00:09:46,600 –> 00:09:53,933
We are using a rectangle TOP for
input 1, and a constant TOP for
input 2.

66
00:09:53,933 –> 00:10:02,667
I can adjust the rectangle TOP’s
“Background Alpha” value to
isolate features of this texture
operator.

67
00:10:02,667 –> 00:10:17,467
I can use the “Display Pixel
Values” option to accurately
gauge exact input settings, in
order to achieve an exact
multiplication settings.

68
00:10:17,467 –> 00:10:29,133
I’m satisfied with my
transformation, alignment, and
channel masking settings, so
I’ll focus on color and
luminance pixel adjustments.

69
00:10:29,133 –> 00:10:42,400
I’ll use the color picker to
adjust my incoming pixel values,
in order to create the exact
pixel values I need from the
multiplication blend.

70
00:10:42,400 –> 00:10:59,033
Most operations won’t require
this level of fine tuning, but
it’s very important to know that
you can access exact per pixel
values to fine tune your texture
networks.

71
00:10:59,033 –> 00:11:02,800
Now let’s look at the outside
TOP.

72
00:11:02,800 –> 00:11:11,633
In this example, I have 2 inputs
whose resolutions are close, but
not matched.

73
00:11:11,633 –> 00:11:20,033
There are several approaches I
can take, if I need to match the
2 resolutions.

74
00:11:20,033 –> 00:11:30,933
I can choose to make one of the
2 inputs the fixed layer, which
will determine the outside TOP’s
resolution.

75
00:11:30,933 –> 00:11:40,667
I can also choose if and how the
overlay layer will be scaled to
match the fixed layer.

76
00:11:40,667 –> 00:11:50,200
I can also use use channel
masking to see the areas the 2nd
input is removing from the 1st.

77
00:11:50,200 –> 00:11:57,900
These techniques combine to give
you many options for image
alignment.

78
00:11:57,900 –> 00:12:12,667
In many cases, a network such as
this is only part of a longer
chain, so it’s very important to
keep track of how you are
determining a master alignment
and resolution.

79
00:12:12,667 –> 00:12:15,933
Let’s take a look at the over
TOP.

80
00:12:15,933 –> 00:12:27,467
This is a very commonly used
TOP; you can use it to cascade a
series of TOPs, one after
another, each on TOP of the
last.

81
00:12:27,467 –> 00:12:33,967
I’ll set the 1st input as the
overlay, and set it to “Native
Resolution”.

82
00:12:33,967 –> 00:12:42,400
In this example, I want to use
the rectangle TOP as a button,
or user interface element.

83
00:12:42,400 –> 00:12:48,233
I need to scale and place it
precisely on the background.

84
00:12:48,233 –> 00:12:52,467
I can type in new values in the
parameter panel.

85
00:12:52,467 –> 00:13:00,100
When I middle mouse click on any
parameter in Touch Designer, the
value ladder will pop up.

86
00:13:00,100 –> 00:13:08,567
I can then drag left or right to
raise or lower the value.

87
00:13:08,567 –> 00:13:11,700
Now let’s examine the screen
TOP.

88
00:13:11,700 –> 00:13:19,900
I set up this network to
showcase the actual mathematical
formula being used by the screen
TOP.

89
00:13:19,900 –> 00:13:28,900
You can find information about
the blending algorithms used in
Touch Designer on the wiki, or
elsewhere on the Internet.

90
00:13:28,900 –> 00:13:33,800
It’s extremely helpful to
understand how these TOPs work.

91
00:13:33,800 –> 00:13:43,133
Advanced users can create their
own pixel operations, if the
available operators are not
flexible enough.

92
00:13:43,133 –> 00:13:52,533
Here, I started with a ramp TOP,
then scaled it down and rotated
it 180 degrees.

93
00:13:52,533 –> 00:14:06,700
You may expect a screen
operation to create a perfect
50% grey bar, but by examining
the math behind the screen
function, you’ll see that’s not
the case.

94
00:14:06,700 –> 00:14:20,867
At the midpoint of the
overlapped ramps, where both
inputs have a 50% grey value,
the screen function creates a
grey value of 75%.

95
00:14:20,867 –> 00:14:28,967
I’ve included a short Python
snippet that will help you
understand the math behind the
screen TOP.

96
00:14:28,967 –> 00:14:37,933
“a” is the pixel value of input
1, “b” is the pixel value of
input 2.

97
00:14:37,933 –> 00:14:44,867
This next sample is similar, but
the 2nd input is an un-rotated
ramp.

98
00:14:44,867 –> 00:14:57,933
In order to understand the math
behind TOP operations, its very
beneficial to set up
experimental networks and study
their results.

99
00:14:57,933 –> 00:15:01,100
Let’s look at the subtract TOP.

100
00:15:01,100 –> 00:15:09,367
The subtract TOP subtracts the
pixel value of input 2 from the
pixel value of input 1.

101
00:15:09,367 –> 00:15:17,333
Even very simple blending TOPs
like the subtract TOP can
sometimes give confusing
results.

102
00:15:17,333 –> 00:15:31,933
For example, if I include the
alpha channel in this operation,
I’ll see the result of the alpha
subtraction, even though I don’t
necessarily see the alpha
channels in the inputs.

103
00:15:31,933 –> 00:15:46,800
As I noted before, in most
cases, a simple network like
this is only part of a much
longer chain, and spotting
issues early can help you
troubleshoot later.

104
00:15:46,800 –> 00:15:50,033
Let’s examine the under TOP.

105
00:15:50,033 –> 00:16:01,867
I’ve built this network to show
you another method of achieving
the desired image and resolution
alignment in TOP networks.

106
00:16:01,867 –> 00:16:10,567
We use an info CHOP to expose
the resolution of the fixed
layer, which is input 1.

107
00:16:10,567 –> 00:16:18,500
The info CHOP gives you access
to a large amount of information
about operators in general.

108
00:16:18,500 –> 00:16:29,800
Here, I am interested in only
the movie in TOP’s resolution,
so I can set the scope to
monitor only those channels.

109
00:16:29,800 –> 00:16:38,833
I use a simple Python snippet to
reference the movie in TOP’s
resolution, thereby linking the
two.

110
00:16:38,833 –> 00:16:49,100
Now the “Pre-Fit Overlay”
settings on the under TOP have
no visible effect; the two
inputs are already matched.

111
00:16:49,100 –> 00:16:51,100
I hope you will will experiment
with these setups, and begin to
understand and build more
complex TOP networks.

Nov 12 2014

Cross CHOP tutorial.

The Cross CHOP. TouchDesigner 088. 2014.
The Cross CHOP is a multi-input Channel Operator that allows you to interpolate between input values.

1
00:00:00,200 –> 00:00:03,067
Let’s examine the cross CHOP.

2
00:00:03,067 –> 00:00:12,900
The cross CHOP allows you to
switch between multiple inputs,
but interpolate between the
incoming values.

3
00:00:12,900 –> 00:00:20,167
You can use integers as cross
values to simply switch between
inputs.

4
00:00:20,167 –> 00:00:31,133
I’ve created a box SOP with its
“sizex” parameter referencing
the cross CHOP channel named
“chan1”.

5
00:00:31,133 –> 00:00:35,733
This will help you visualize the
cross CHOPs’ effect.

6
00:00:35,733 –> 00:00:49,367
The interpolation is straight,
or linear, so a cross value of
.5 will blend the first 2 inputs
at 50% each.

7
00:00:49,367 –> 00:00:51,367
The cross CHOP is a commonly
used operator that can
compliment or replace standard
switching.

Nov 12 2014

Sequencer CHOP tutorial.

The Sequencer CHOP. TouchDesigner 088. 2014.
The Sequencer CHOP allows you to create complex animation sequences. This is a specialized Channel Operator, and it can be difficult to master.

1
00:00:00,833 –> 00:00:05,133
Let’s examine the sequencer
CHOP.

2
00:00:05,133 –> 00:00:16,067
The sequencer CHOP is an
operator that allows you to
create and control complex
animation sequences.

3
00:00:16,067 –> 00:00:24,400
The sequences are held in CHOPs,
and referenced by a table DAT.

4
00:00:24,400 –> 00:00:33,633
Each CHOP can represent a simple
animation state, or a complex
animation.

5
00:00:33,633 –> 00:00:43,467
In this network I’ve built a
series of 5 animations that
control a character.

6
00:00:43,467 –> 00:00:51,433
The character is a simple face
with 5 possible animatable
features.

7
00:00:51,433 –> 00:01:02,733
We can animate the eyes and the
mouth, with simple values for
rotation, position, and scale.

8
00:01:02,733 –> 00:01:12,567
Each of the 5 constant CHOPs
holds 5 animation states for
each facial feature.

9
00:01:12,567 –> 00:01:24,333
The sequencer CHOP gives us the
ability to dynamically choose
any state we want, and blend
them together over time.

10
00:01:24,333 –> 00:01:31,367
We can combine static, or still
states, with complex animations.

11
00:01:31,367 –> 00:01:41,033
The face character is a network
of TOPs and SOPs that lives
inside a container component.

12
00:01:41,033 –> 00:01:45,400
I’ve built a mouth from a line
SOP.

13
00:01:45,400 –> 00:01:55,967
We can animate the 3 points on
the line: 2 for the left and
right side, and 1 for the
middle.

14
00:01:55,967 –> 00:02:01,000
The eyes are constructed from a
rectangle TOP.

15
00:02:01,000 –> 00:02:11,067
We vary the rotation and scale
of the rectangle to create
expressive animations.

16
00:02:11,067 –> 00:02:18,633
I won’t go into detailed
explanation of this network, you
can explore it on your own.

17
00:02:18,633 –> 00:02:33,200
The most important note is that
I use Python expressions to
reference the values stored in
the constant CHOPs above this
container.

18
00:02:33,200 –> 00:02:46,100
These values are the rotation,
position, and scale values that
drive the facial animation.

19
00:02:46,100 –> 00:02:56,000
Now that we’ve seen how the face
is constructed, let’s look again
at the complete network.

20
00:02:56,000 –> 00:03:03,967
The sequencer CHOP is now
referencing the constant CHOP
named “BASE”.

21
00:03:03,967 –> 00:03:14,000
I can adjust the values of the
base animation state, and see
the results applied to the face
character.

22
00:03:14,000 –> 00:03:22,500
By doing this, you will realize
that to create a new animation
state is a simple matter.

23
00:03:22,500 –> 00:03:35,167
You can copy the “BASE”
operator, add it to the
sequence, and adjust the
parameters to create a new
facial expression.

24
00:03:35,167 –> 00:03:42,100
This is the method I used to
create the following 4 animation
states.

25
00:03:42,100 –> 00:03:54,067
The last animation is here to
showcase the ability of the
sequencer CHOP to combine static
states with complex animations.

26
00:03:54,067 –> 00:03:58,933
I created this animation from 5
noise CHOPs.

27
00:03:58,933 –> 00:04:07,167
Each will generate random
states, over time, for each of
the 5 facial features.

28
00:04:07,167 –> 00:04:19,233
For this, or any animation, to
work properly with the sequencer
CHOP, you need to pay close
attention to how your channels
are named.

29
00:04:19,233 –> 00:04:26,367
I’m using 2 Python scripts to
control the sequencer CHOP.

30
00:04:26,367 –> 00:04:40,767
The logic is simple: 1st, copy
the contents of the table DAT
named “felipeSequence” to the
DAT named “sequencer1_sequence”.

31
00:04:40,767 –> 00:04:51,333
The reason we use a custom table
to create our sequence will
become apparent in a moment.

32
00:04:51,333 –> 00:04:54,800
Next, we reset the sequencer
CHOP.

33
00:04:54,800 –> 00:05:06,800
This forces the sequencer to
load the 1st entry in the table
DAT, which in turn, points to
the 1st animation CHOP.

34
00:05:06,800 –> 00:05:10,833
Now, our sequence is loaded and
ready.

35
00:05:10,833 –> 00:05:17,567
This script simply tells the
sequencer CHOP to step to the
next sequence.

36
00:05:17,567 –> 00:05:20,533
Now let’s step through some
animations.

37
00:05:20,533 –> 00:05:24,167
Pay attention to the sequencer’s
table DAT.

38
00:05:24,167 –> 00:05:32,200
You’ll see that at the end of
each sequence, the row
containing that sequence is
deleted.

39
00:05:32,200 –> 00:05:36,533
The second row of the table DAT
is never deleted.

40
00:05:36,533 –> 00:05:41,833
That’s why I use it to store a
base animation state.

41
00:05:41,833 –> 00:05:46,267
Let’s step through the entire
process again.

42
00:05:46,267 –> 00:05:50,000
I run the “LOAD_SEQUENCE”
script.

43
00:05:50,000 –> 00:05:59,833
This fills the sequence table
with our custom contents, and
resets the sequencer so it’s
ready to play the next
animation.

44
00:05:59,833 –> 00:06:07,800
I’ll make an adjustment here:
the “blendtime” parameter
between the first and second
animations.

45
00:06:07,800 –> 00:06:17,633
I must reset the sequencer, and
you’ll see the change in blend
time when I step to the next
animation.

46
00:06:17,633 –> 00:06:25,100
The sequencer CHOP can play
animations independently of
Touch Designer’s master
timeline.

47
00:06:25,100 –> 00:06:35,133
Therefore, you can use it to
create animations that react to
user input or any other realtime
events.

48
00:06:35,133 –> 00:06:45,400
The sequencer CHOP is a very
powerful tool that requires a
very specific network design to
work properly.

49
00:06:45,400 –> 00:06:47,400
When you master the process of
building these networks, you can
begin to create very amazing
animation effects.