Hi, I am new here, so first of all thank you for all your great contribute to the maya API scene.
It's a while now I am trying to learn how to write maya plugins, and now I would like to write a basic feather system, just for fun and to improve my understanding of maya api.
For now I wrote my own scatter node, which generates patterns also in a poisson disc style.
So I am trying to start writing something similar to your awesome arrayToDynArray, to have some feedback with the current maya instancer (even if I would like to replace it eventually).
With MFnArrayAttrsData function set I read the list of arrays included in the attribute "myInstancer.inputPositions".
Now the problem is that I really didn't understood pretty well what kind of attribute I should declare as output attr in the initializer method.
So, my code looks like this now:
def nodeScatterToInstancerInitializer():
typedAttr = OpenMaya.MFnTypedAttribute()
# INPUT Attrs
scatterToInstancer.inputPositionPP = typedAttr.create("inPositionPP", "inPos", OpenMaya.MFnVectorArrayData.kVectorArray)
typedAttr.setHidden(False)
typedAttr.setKeyable(True)
typedAttr.setInternal(True)
scatterToInstancer.addAttribute(scatterToInstancer.inputPositionPP)
# OUTPUT Attrs
scatterToInstancer.outputValue = typedAttr.create("outValue", "out", OpenMaya.MFnArrayAttrsData.kDynArrayAttrsData )
typedAttr.setKeyable(False)
typedAttr.setStorable(False)
typedAttr.setHidden(False)
typedAttr.setReadable(True)
scatterToInstancer.addAttribute(scatterToInstancer.outputValue)
# ATTRIBUTE AFFECTS
scatterToInstancer.attributeAffects(scatterToInstancer.inputPositionPP,scatterToInstancer.outputValue)
... but my outputValue doesn't succeed to initialize. So, what kind of output attribute I should declare if I am going to handle it with MFnArrayAttrsData?
Thank you for all the help you could give me.