Home Website Youtube GitHub

[PyMaya] Inconsistent .listAttr behavior

Hi Miquel,
As a user with several mgear modifications and post-scripts set up over the years, I have needed to expand the new bundled pymaya framework a bit to get it to interface more like pymel. So far it has been fairly straightforward but I’ve come across an issue which turns into a maze at its source, in pymaya.cmd.

The listAttr node method is inconsistent in its return values, even with identical signatures. Given any pynode “ctrl”, if I call:

ctrl.listAttr(userDefined=True, keyable=True)

The return values can vary wildly. Once, it was a list of strings - attribute names of attrs both keyable and not, user defined and not. Then, if I prod the node for another minute or so, then call the exact same command, it will return a the same list of attributes (both keyable and not, user-defined and not, so ignoring the args), but this time as pymaya objects, instead of strings. Then again, I poke the node a few more times and run the exact same listAttr method again, and it returns an empty list.

I’m probably going to end up just defining listAttr locally as a cmds wrapper, like so many of these other methods do. I’m mostly curious why it’s set up the way it is, as such a unique case with __SCOPE_ATTR_FUNCS and all that?

Hi @clamdragon

Thanks for the feedback! Can you create a github ticket with this information? I would like to review this and see if I can improve the current situation

:grinning_face_with_smiling_eyes: