View Full Version : Mayabatch

03 March 2009, 03:49 PM

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?


03 March 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 March 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.