Input kDoubleArray not updating with MFnDoubleArrayData


#1

I’m writing two nodes. The first node(nodeA) has a kDoubleArray output and the other(nodeB) has a kDoubleArray input. Each output/input use MFnDoubleArrayData to work with the plug.

The problem is that when I connect nodeA to nodeB, nodeB gets and stores the array at the time of the connection but it won’t update after that. Even if nodeA is changing the array, nodeB plugs are marked dirty as expected, the deform method runs but the MDouble Array doesn’t change from its initial state.

NodeA is working as expected. Here is the code for setting the output plug.

outMapData = dataBlock.outputValue(ProximityMap.outputMap)
outDblFn = OpenMaya.MFnDoubleArrayData()
outDblObj = outDblFn.create(outputMap)
outMapData.setMObject(outDblObj)
outMapData.setClean()

If I tell nodeA to print an array version of ‘outDblObj’ before setting it clean it updates as expected.

NodeB is not working as expected but does not give me any errors. Here is the code for getting the input plug.

mapHandle = dataBlock.inputValue(MapToPP.inputMap)
inArrFn = OpenMaya.MFnDoubleArrayData(mapHandle.data())
currMap = inArrFn.array()
print(currMap)

When I make the connection between the nodes, nodeB updates properly. After that, nodeB updates but ‘currMap’ remains the same as it was when it first updated.

Has anybody else seen this happen? According to documentation this should all be written correctly and I’ve run out of things to try. Any suggestions would be appreciated.

Thanks