LumaPictures / pymel

Python in Maya Done Right
Other
478 stars 130 forks source link

Fix problems with ProxyUni in Python 3 caused by __iter__ #454

Open bryab opened 2 years ago

bryab commented 2 years ago

I encountered an issue using the force parameter for pymel.core.setAttr. I was getting this error:

Invalid arguments for flag 'ln'. Expected string, got ( str, str, str, str, str, str, str )

Long story short, the string is being misinterpreted as a sequence.

I tracked this down to pymel.core.util.isIterable which checks if the object is iterable by running iter on it. Removing the __iter__ method from ProxyUni fixed this error. A strange solution but it was the simplest one, as it makes ProxyUni behave, in Python 3, more like how it does in Python 2.