Execute DAT not always run

Perhaps I am misunderstanding how the Execute DAT works but I have one execute DAT inside a Base that is replicated (with a replicator). The Execute DAT has Frame Start and Frame End turned on. However those scripts don’t appear to always run. For example I have one of them check the value of a DAT input and if it is equal to a certain value it sets a value in a table to 0. Sometimes it will successfully set it to 0 other times it does not. However, I can get it to run if I open the Base by zooming “into” the Base.

Any work around ideas would be appreciated as I need this working Monday!

Thanks,
Matt

Any chance you can post an example? Should be easy to fix with one.

Hey Matt -

I would definitely warn against frame start and end scripts - in many ways they defy the TouchDesigner pull based paradigm, and often have unintended consequences.

That aside, just guessing here, I’d bet that your ops aren’t initialized / cooked when they’re created. Adding a line to your callbacks to force cook your execute DAT should get you there:

[code] def onReplicate(comp, allOps, newOps, template, master):

for c in newOps:
	#c.display = True
	#c.render = True
	#c.par.display = 1
	#c.par.clone = comp.par.master
	c.op('execute1').cook(force=True)
	pass

return[/code]

Here’s an example for reference:
base_cook_frame_start_and_end.tox (1.1 KB)

I fixed the issue temporarily by just having one Execute DAT outside of the Replicator that loops over all the replicated nodes. It works fine for now but feels unorganized.

@malcolm I can send you directly the toe I was using or I can try and make a more simple test case I can post here that will demonstrate the issue. Could be difficult to replicate given the intermittent nature of the issue.

@raganmd I suppose a better solution would be to try to restructure it so that the code that actually fills in the DAT input (a UDP In DAT) does the necessary operations when a special value is read? That just seems so unorganized, but I can see the performance advantages. Any way you can think of structuring this task (Read UDP packets → parse to table → handle special values) in a way that keeps things more modular and performs well? Perhaps there is a way to call a python function when a value is changed in a table?

PS I turned on post notifications but I’m not getting any emails from responses… any ideas on that?

Thanks for the help guys!

You have a few options I think. The UDP In DAT runs callbacks when values are read. One option would be to use this feature to do your parsing and value setting when the message arrives.

Another option would be to use the DAT Execute. This can run on table change, column change, row change, or cell change. If you want to minimize your calls so your updates only occur when values in a specific column, row, or set of cells change this would be an option.

Does that help?

What exactly are you up to? That might also make a difference in the approach to use here.