replicator and automatic connection

Hello,

I wonder if there is any way to automate the connection for node created with a replicator.
I replicate a select chop and I want them connected with a merge chop.
Even if the master node is connected , “Children” are not connected, I need to do it manually.

Thanks

Xavier

You could enter the Python script in the Script parameter of the replicator, and you’d use the connector class:

derivative.ca/wiki088/index. … ctor_Class

Are you familiar with Python and scripting in TouchDesigner? If not, upload your file and I can show you.

Thanks Elburz.

I get it working with node but I get stuck with component.

I have a container with a few chop + out inside , which I replicate and I want then to connect to a merge chop.
So I tried :
me.curItem.outputCOMPConnectors[0].connect(op(“merge1”))

It works with .outputConnectors.

xavier

The outputCOMPconnectors are the vertical comp-to-comp connectors.
You’re correct to use .outputConnectors which are the CHOP/SOP/MAT/DAT outputs in the component.
Cheers

After a bit of confusion, I figured out how to do this with the new Replicator Callback DAT. “me.curItem” notation is out, but the following worked out great :smiley:

[code]def replicate(comp, allops, newops, template, master):

for c in newops:
	c.par.display = 1
	c.outputConnectors[0].connect(op("switch1"))
return

[/code]

1 Like

Say, I replicated 10 different TOPs. I which to use the 1st to the 4th operator to connect to 1 composition TOP and not all of the cloned (replicated) TOPs.

How do I achieve this in the replicator_callback code using output.Connectors?

Hi ,
you can add a counter in the loop that you can use as a conditional .
like

[code]def replicate(comp, allops, newops, template, master):

i = 0
for c in newops:
	i+=1
	c.par.display = 1
	if i <= 4 : 
		c.outputConnectors[0].connect(op("switch1"))
return

[/code]