I have developed custom MPxNode that uses setDependentsDirty to trigger compute of dynamic attributes created by registered command. Command argument specifies source node.attribute (plug) to connect to dynamic attribute created on registered node. When source attribute changes, connection triggers setDependentsDirty, where code then appends affectedPlugs to another dynamic attribute in custom node for subsequent compute.
So my problem is that setDependentsDirty doesn’t always get called when I expect it should.
Specifically if more than 1 custom node exists and connected source attributes are user-defined, then setDependentsDirty is only called initially. After one or two updates on source attribute, setDependentsDirty doesn’t get called again, unless I force a call by disconnecting and re-connecting those attributes. (Clearly user shouldn’t have to disconnect/reconnect for updates to be triggered)
This behavior DOES NOT HAPPEN if there is only one custom node in scene. In that case I can continually change connected source plug and custom node dynamic attributes get updated as intended via setDependentsDirty and compute. Updates also work properly if connected source plugs are static attributes (ie translateX). Our application depends on user defined attributes more often than not.
Another perplexing symptom is that attribute editor does not display dynamic attributes for custom node; but again, this symptom only occurs if there is more than one custom node in scene and connected source attribute is user-defined. Otherwise attribute editor is good.
Any ideas regarding what’s causing this and how to fix would be much appreciated. Thanks !!