(Nested) DependDict: any val changed notifier?


I’m looking for an effective way to run a script whenever any value in a big (and possibly nested) DependDict is modified. I don’t care about which val changed, just that anything changed.

Any ideas ?

Hi Achim

We are developing proper callbacks for the dependencies, but for now you can try this hack:

Create an evalDAT with the Expression looking at your DependDict (top level). Then set up a datexecDAT looking at that evalDAT and reacting to any changes.

Does that make sense?

Ah one more thing I forgot. When you put the Expression in evalDAT, use str(expression_to_DependDict) so that the contents of the dictionary are visible in the table. Once you have the dict showing there, turn off the viewer so TD doesn’t have to draw the text of it.

Of course let me know if you have any troubles with this technique, or just email me an example file.

Makes sense. I’ll try tomorrow. Thanks !

Is using the Python parameter type useful here (which would contain the disctionary)? The benefit is, whenever anything in it changes, a Parameter Execute DAT can be called.

These seem to work, but both are rather expensive.

Do you guys think it is possible to subclass DependDict and somehow whenever an item ist set fire my callback ?

And would subclassing have a (big) performance impact? In that context I should mention that almost all entries in those nested dependdicts are bind masters for custom parameters

I don’t think you’ll be able to fix this by subclassing. We are adding C++ features to dependency objects in 30k that are required to make this work.

Regarding performance impact of subclassing, I don’t think the subclassing itself would be a hit. Nested dependencies of bind masters might be… not sure.