Use Clone Master of COMP Operators— Tip in TouchDesigner#3

Partical Weng
Partical.grt
Published in
4 min readApr 23, 2020

Use Clone Master Function.

Sometimes, you used a lot of buttons, sliders or any other COMPs which have the completely same attributions. Maybe you just want to change the button display texts, but you have to do it each one of them.

Your layout probably like this,

Or this,

Even this!!

Umm.. I know it’s almost impossible.

Alright,

If we would like to use and edit multiple exactly same COMPs, what should we do?

Let’s dive into “Clone Master”.

Official Introduction of Clone Master

According to

We got these informations:

Common within all Clones : What a clone has in common with its master:

  • All clones will be forced to contain the same operators (nodes).
  • The wiring between the nodes and the layout of the nodes in the network will be the same.
  • The parameters of the nodes INSIDE the clone are forced to be the same.
  • The flags of the nodes, like bypass and viewer state, will be forced to be the same.

Unique to each Clone : However clones can be made to cook and output differently:

  • component inputs — Operators like CHOPs and SOPs that feed into the clone via the inputs may have differing data. Therefore the data output from nodes in the clone will often be different, as will the data output from the clone itself.
  • variables — Variables in nodes inside the clone that use $OPN (operator parent's name) and $OPD (digits in operator's parent's name) can be used to differentiate between clones. For example, the clone's name's digits can be used to look up values in tables externally (tab("tabpath", $OPD, "value")). Therefore parameters may have the same expressions, but the expressions may evaluate to different values.
  • immune nodes — Nodes that are inside the clone and are set to be “immune” are untouchable and unique. Nodes that have their immune flag set are not forced to match the master of the clones. For example, you may put an immune Table DAT inside a clone that makes it unique, encapsulated and portable.
  • component parameters — Parameters of the clone component (its dimensions, background, override, transform, …) may be set differently. These are not the parameters of nodes inside the clone, just parameters of the clone itself.

Oh… too much stuff?

Okay, you’ll understand all very soon.

Setup Clone Master

First, let’s create 4 “Button” operators in the COMP.

Right click select all buttons.

Open the panel to find ‘Common -> Clone Master’.

Drag ‘button1’ to the field of Clone Master.

Let’s go!! We finished!!

It’s super easy, right?

But it’s super powerful.

Using Example

Inside ‘button1’, try to add the operators, and you’ll find other buttons also got the same things.

You can also use ‘me.digits’.

Or use ‘me.digits’ and outer table.

op('../table1')[me.parent().digits - 1, 1]

But, when you directly manipulate attributions of button, it WON’T be cloned to others.

--

--