Getting array values from an MPxNode plug ...

by SplineO posted 8 days ago

Hi there!

It has gotten quiet around here. Too bad! Anyway, I'll try my luck! I have written a small Node to blend multiple Poses for my facial rig. As I have not yet gotten around to learning how to do it in C++, I built it in phyton.

It works, but it is super slow. So I am trying to optimize. One thing I'd like to try is to not iterate through every plug, but instead read the whole attr as a list in one go. is that even possible?

Here is an example: cls.poseWeight = nAttr.create("poseWeight", "pw", OpenMaya.MFnNumericData.kFloat, 0.0) nAttr.setStorable (1) nAttr.setCached (1) nAttr.setKeyable(1) nAttr.setArray(1) nAttr.setUsesArrayDataBuilder(1) cls.addAttribute(cls.poseWeight)

where I want an array of all the poseWeights.

Any help would be appreciated!

Cheers,

Alex