Replicator set custom parms error

Hello form, another newbie question

I am setting a replicator that copies a base OP which I have added custom params for.
on the replicator script, I want to set the value of these custom variables.
this is my scripy

def onReplicate(comp, allOps, newOps, template, master):
	for c in newOps:
		c.par.clone = comp.par.master
		c.par.Title = '123'

I also tried to do this

def onReplicate(comp, allOps, newOps, template, master):
	for c in newOps:
		c.par.clone = comp.par.master
		op('/mainComp/scene/InstanceCompName').par.Title = '123'

but I am always getting this result:

AttributeError: 'td.ParCollection' object has no attribute 'Title'

what am I doing wrong?

Thanks in advance

Without looking at your process it’s a little hard to tell, but I think this does work as expected. Take a look at this example to see it functioning as you describe:
base_replicator_example.tox (1.1 KB)

Thanks a lot for all your replies Matthew

your example is obviously working fine. but I am working off a file that someone else has created, and when I take your example and duplicate my structure it in it doesn’t work too.
see attached file
base_replicator_example.16.toe (3.88 KB)

Okay, looking more closely at your example here, I think part of what’s going on is the delay script. The replicator is attempting to set a custom parameter before the base component has been cloned, and that’s why you get an error - or, rather, I’m getting an error.

In my opinion, delay scripts should be a last resort - they’re tricky to work with, and can make all sorts of problems. If you have to use one, you can modify your call back to make this work with the following:

delay_title_par = "args[0].par.Title = args[1][args[0].digits, 0].val" run(delay_title_par, c, template, delayFrames = 3)

What’s going on here is that we’re constructing our function as a string with placeholders for the arguments we’re going to pass into the function. args is a list, and so specifying index ensures that we get the objects where they need to go.

Finally, we need to run that script, then delay it one frame longer than the previous operations.

Here’s a working file for reference:
base_replicator_example_mr_edits.toe (4.02 KB)

This is awesome… Thanks a lot, there was no way I could have figured that part on my own by just reading the document.
I don’t know why whoever did the original file use those delays… but anyway it’s all fine now.
if I ever meet you someday, I owe you a beer :slight_smile:

I was inspired to jot down some notes after our exchange - here’s a little more detail about how delays work, and why run() is a better approach for Python than using the Python time module. … y-scripts/