MAYA Python API Plugin Arrays

hey,

i’m trying to simply convert an existing cpp plugin i wrote to python. just for the reason of learning the python api for prototyping.

i am however running into an issue with input and out arrays. in my cpp all is working well. in python i get an error.
here’s the code snippet of the compute

hInputMatrices = data.inputArrayValue(testOp.aInputMatrices)
hOutputMatrices = data.outputArrayValue(testOp.aOutputMatrices)
outputBuilder = hOutputMatrices.builder()

for i in range(hInputMatrices.elementCount()):
    inMatrix = hInputMatrices.inputValue().asMatrix()
    outHandle = outputBuilder.addElement(i)
    outHandle.setMMatrix(inMatrix)
    hInputMatrices.next()

hOutputMatrices.set(outputBuilder)
hOutputMatrices.setAllClean()

data.setClean(plug)

All seems straight forward but it errors out with (kFailure): Unexpected Internal Failure

Any hints or second pair of eyes are greatly appreciated. thanks

found my error.


hInputMatrices.next()

needs to become


hInputMatrices.jumpToElement(i)

and needs to move up. the .next was from a while loop i tried before