I have a custom node that uses cmds.setAttr() from within its compute function to update the attributes of two nodes that are connected to it (the purpose of the node is to sync two attribute without locking them). The node works as expected, syncing the values between a single ramp node color entry position and the translate of a pCube (ramp position is a single double which is converted to three doubles for the translate and vice versa).
The ramp node is mapped to a plane in the viewport. When I change the position of the ramp color entry in the attribute editor, the viewport shading updates as expected, and the pCube moves to the appropriate position. However, when I move the cube, the ramp position and thumbnail preview update properly in the AE, but the viewport shading on the plane does not update.
I know that this is happens because the outColor of the ramp does not change when the position the color entry is set with the command, so I would assume that I should be able to either set the outColor plug dirty or set the ramp entry position plug dirty since the outColor should be dependent on it. The problem is that when I try to do this from within the compute function using the maya.dgdirty() command, the viewport still does not update (and as fart as I can tell, the attribute is not reevaluated).
Strangely, when I use the same maya.dgdirty() command from the script editor, it causes the viewport to update as expected. Essentially, my question is: how can I get the outColor of ramp node to properly update (and thus cause the viewport shading to update) after the ramp entry postion has been set within my sync node's compute function?