0

I am having a bizarre issue where the compute function of my node is printing out debug information in reverse order.

I am trying to make a custom sync node that will allow me to synchronize the attributes of two input nodes without locking those attributes. My node has four generic input attributes that take the raw input of the two attributes to sync, as well as the converted version of each attribute to allow for syncing of attributes of different types (rawInputA, rawInputB, convertedInputA, convertedInputB). The node has two outputs affected by each of the corresponding inputs:

outputA affected by: rawInputA, convertedInputA outputB affected by: rawInputB, convertedInputB

The outputs are connected to a dummy locator since they are really only used to trigger the compute function of the node which then sets the correct attribute values of the input nodes themselves (this is done to avoid circular dependencies and attributes being locked).

If the inputA attribute is changed, this causes the sync node to compute and set the attribute value of the other inputB node, which causes the sync node to compute again (although it wont set any values this time since they are already correct). I have added debug print statements to the compute function at the start and finish, as well as in the middle. On the first compute call, they print in the correct order, but on the second call, they are printed in reverse order, which is really strange...

One possible problem that I think might be related is that after the sync node has computed, one of the rawInput attribute plugs is left dirty (not every time, and it seems to have something to do with which input attribute, A or B, is changed).

I should note that the attributes are correctly updated, so the node appears to be working as desired, but I am trying to work out some other bugs with updating a viewport preview and the attribute editor for the synced attributes which is how I came across this strange issue.

Update - Here is an example of node setup connecting the position of a ramp node color entry and a piece of geometry.

Test Node Setup

Changing the color entry position by setting the value in the attribute editor yields the following output in the script editor:

setAttr "ramp1.colorEntryList[0].position" 0.5;
SyncNode compute called!
    Plug = aOutputA
    Value changed
        set source plug with 3 double
SyncNode compute finished!

SyncNode compute finished!
    Plug = aOutputB
SyncNode compute called!

TL;DR - Is there anything that would cause debug statements in a dependency node's compute function to be printed in reverse order in the script editor output?

0 Answers0