Maya doesn't recognize boolean in python

Hey guys,

just a short question. I’m working on a pipelinetool for Maya that is written using the PyGTK-toolkit. I encounter the problem that when I’m doing something like

maya.cmds.select( shape, add= True )

in the script, I receive the error:

Flag 'add' must be passed a boolean argument

I have tried to pass 0 and 1 instead of False and True and even wrapped everything into an exec-statement 'cause I thought that might help but the problem stays the same. Any idea? Works fine with strings and I haven’t tried ints yet.

An additional info that might be useful: I’m running the script in a new thread so Maya doesn’t get locked…

Thx,

Matti.

.

is shape a reference to a maya object? that could be one issue.

I’ve ran into that if you’re trying to run the maya instance from a thread inside of your main application, it doesn’t like that, I had to convert those cases into mel.eval()

Hey guys,

thx for your replies.

@ djTomServo: Yes it is :wink:
@ lkruel: That solved the boolean-issue. Have some random maya-crashes now bit will have a look what the cause might be… Thanks bro :slight_smile:

edit: Concerning the crashes. What I’m doing is trying to save a uv-snapshot and Maya always crashes with signal 11. My code works fine from the scripteditor but doesn’t from the script that runs in an other thread. Have you encountered that before and have a solution for this issue as well? Thanks in advance! The mel.eval( 'select -add ’ + shape ) works fine now. :slight_smile:

Are you in 2008 and batching over multiple files? there’s a memory leak in 2008 that will always end up crashing, supposedly that’s fixed in 2009 but we’re still in 2008 so I haven’t tested it yet

Thx for your reply, lkruel.

No, it’s Maya 2010. I didn’t have a chance to check that yet but I’m pretty sure that it’s another threading thing and that the module maya.utils will do the trick. Obviously it’s possible to execute commands deferred that way. I’ll post if it works when I had the time to test it.

Grtz,

Matti