hi folks, For optimisation purpose, I'm trying to write/read some stringArray attributes. Never had any issue to do that in cpp, and it works fine in python as well for reading, but I can't figure out how to write this attribute with python, since it doesn't include any MStringArray (unlike MPointArray or other type of maya arrays). Right now, I have : # create a dummy stringArray plug sph = cmds.polySphere(ch=0)[0] cmds.addAttr(sph, ln='foo', dt='stringArray') strplug = '.'.join((sph, 'foo')) # get the function set sel=MGlobal.getSelectionListByName(strplug) hPlug=sel.getPlug(0).asMDataHandle() fn=MFnStringArrayData(hPlug.data()) # fail to do anything with it.... also, noticed that by default it seems to error instead of returning an empty array.. fn.set('bar')
anyone has done that before ? What am I missing ? Thanks a lot -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2b4778e0-2a4c-483c-abb6-6097d6413ed9%40googlegroups.com.