I'm trying to access a string attribute on an object via the python API in maya, but so far I'm not having any luck. I have a data handle for the attribute, and I'm using the asString() function to try to extract the string from it - since the python API doesn't have an MString class this should just return a python string, but it seems to be returning a PySwigObject instead. I tried coverting it to a string and this is what I get: _306429ab2a000000_p_MString. Not very helpful, and a bit worrying that MString is appearing in there when there are not supposed to be any MStrings in the python API!
Has anyone tried to use the MDataHandle.asString() function in python? Any suggestions would be welcome!
(I already tried posting this question in the API forum, but no answers so far!)