Opfind dirty COMPs

Using these lines

def onInitGetColumnNames(dat):
	return ['dirty']

def onFindOPGetValues(dat, curOp, row):
	return [curOp.dirty]

in the opfindDAT to find all COMPs with a certain tag that are dirty. Is there a trick to have the opfind update anytime an OP becomes dirty ?

Thanks in advance

1 Like

Some additional info. The goal is to create a widget that lists all external tox files that have been modified. And then offer a way to save those to disc. Works perfectly except for the refresh issue.

I would use the onFindOPGetValues callback to add the OP-Objects into a list-attribute, creating a comprehensions to get the dirty-states, checking if they are the same as the cached list and adjusting an output-table if needed.
Python can be pretty fast in this kind of things and cook-time-usage should be minimal.

I’m not sure I understand correctly, but I don’t see how your suggestion would fix the issue of having to manual refresh the opfind DAT.

Here’s my testcase. If you change anything inside testTox, it tags that OP dirty. But you have to pulse the “Active Cook” in order for the opfind to catch (new) dirty OPs

dirty.toe (9.3 KB) testTox.tox (590 Bytes) (save the tox in the same folder)

If I set the cook mode to always it works, but in my production file it eats way to many ms

Maybe I have a wrong understanding but from your post it seems like there is a defined set of components findable by tags.
What I suggest is to, instead of having the OPFind-dialog evaluate if a comp is dirty, to do it seperately in pure python on every frame and only use opFind to find the comps with the given tag and add them to the list of observed Comps.
privateInvestigator.tox (2.3 KB)

See if this implementation works in the production file. I just had a quick test with 100 observed COMPs and runs pretty fine.

Thanks! Now I understand your initial post:)

@alphamoonbase thx again. Implemented it into my workflow and it indeed works nicely. No more need for that mysterious externalToxModifiedInProject :wink: