PDA

View Full Version : Mayabatch


beuzel
03-09-2009, 03:49 PM
Hello,

I have a problem with python.
A script works fine in latest maya.exe, but not when start it with mayabatch.exe
The line

import maya.cmds as mc

throws an error, it complains about not knowing maya.cmds. how can this be?
can somebody help?

thanks
chris

cbamber85
03-14-2009, 01:14 PM
I'm pretty sure the mayabatch.exe doesn't support the built-in interpreter, so you have to add the line:

import maya.standalone maya.standalone.initialize( name='python' )

Then it can load the Maya Python libraries from outside Maya's main program. There's a page about it in the helpfile.

Hope this helps.

CGTalk Moderation
03-14-2009, 01:14 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.