Whenever the user checks the display flag on one of those instances, I want to print the name of the instance with the display flag just checked.
To implement this, I've inserted a python sop just before the output of the digital asset, with the following code:
node = hou.pwd() geo = node.geometry() OTLinstance = node.parent() def flag_changed(node, event_type, **kwargs): if OTLinstance.isGenericFlagSet(hou.nodeFlag.Display) == 1: print(OTLinstance.name(), " has the Display Flag on") OTLinstance.addEventCallback((hou.nodeEventType.FlagChanged,), flag_changed)
It kind of works, but every time the Display Flag changes, the Python Sop returns TWICE the text.
So I guess it's making unnecessary cycles.
1) Why does this happen?
2) Do you know a better method to implement this behavior in a Digital Asset?
Thanks for any help!
I've attached a file example with the above code