Thank Sudeepth I still get an error that its not valid win32 application. But look like we got the environment right, i will go around and find out about this :D
On Tue, Dec 4, 2012 at 11:46 AM, Sudeepth Patinjarayil <[email protected]>wrote: > Hi, > > The below code is for maya standalone to external python. This is working > for me on 2011 (32-bit) Maya. change the paths to 2012 and give a try > > # Maya Standalone to external python > import os > import sys > #====================================================================# > #THESE ARE THE MISSING STUFF WHEN RUNNING python.exe compared with > mayapy.exe > #====================================================================# > os.environ['MAYA_LOCATION'] = r'C:\Program Files (x86)\Autodesk\Maya2011' > os.environ['PYTHONHOME'] = r'C:\Program Files > (x86)\Autodesk\Maya2011\Python' > os.environ['PATH'] = r'C:\Program Files (x86)\Autodesk\Maya2011\bin;' + > os.environ['PATH'] > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\site-packages\setuptools-0.6c9-py2.6.egg') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\site-packages\pymel-1.0.0-py2.6.egg') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\site-packages\ipython-0.10.1-py2.6.egg') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\site-packages\ply-3.3-py2.6.egg') > > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\bin\python26.zip') > sys.path.append(r'C:\Program Files (x86)\Autodesk\Maya2011\Python\DLLs') > sys.path.append(r'C:\Program Files (x86)\Autodesk\Maya2011\Python\lib') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\plat-win') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\lib-tk') > sys.path.append(r'C:\Program Files (x86)\Autodesk\Maya2011\bin') > sys.path.append(r'C:\Program Files (x86)\Autodesk\Maya2011\Python') > sys.path.append(r'C:\Program Files > (x86)\Autodesk\Maya2011\Python\lib\site-packages') > > import maya.standalone > maya.standalone.initialize(name='python') > from maya import cmds > cmds.sphere() > cmds.file(rename=r'D:\cubetemp.ma') > cmds.file(save=True) > # code compleation > > Thanks and Regards, > Sudeepth Patinjarayil. > > > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
