Hey guys, has anyone seen this weird issue, where when writing some python code in a python module such as:
import maya.cmds as cmds
print cmds.ls(sl=True)
returns this error:
Flag ‘sl’ must be passed a boolean argument
there appears to be something strange going on with the True keywork flag which I cannot seem to figure out… using 1 instead yields the same result
True False flags in python when running in maya
7099 3 2- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- awong
- Member
- 818 posts
- Joined: Sept. 2013
- Offline
Ah, another user actually reported the same issue. It took a while to hunt down the problem. That error message is actually not the real error, so it's misleading. The real problem comes from a limitation of Maya's cmd module. There are two workarounds. One is to simply use the mel equivalent.
The other workaround is to is disable asynchronous mode in the Maya plugin. I recently added a preference to specifically workaround this issue. However, by turning off asynchronous mode, you lose some nice features like progress bar and interrupts. :?
The other workaround is to is disable asynchronous mode in the Maya plugin. I recently added a preference to specifically workaround this issue. However, by turning off asynchronous mode, you lose some nice features like progress bar and interrupts. :?
Andrew / アンドリュー
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- awong
- Member
- 818 posts
- Joined: Sept. 2013
- Offline
-
- Quick Links