how to pass arguments to maya.mel.eval()

5 views
Skip to first unread message

La...@frag-games.com

unread,
Feb 26, 2014, 6:38:03 AM2/26/14
to python_in...@googlegroups.com
userSetup.py file takes precedence over userSetup.mel
so, i wanted to add some paths to "MAYA_SCRIPT_PATH" via python
this example for getting variables works fine
Code:

import maya.mel as mel
import os.path
import maya.cmds as cmds
def printMayaPaths():
msp = mel.eval('getenv MAYA_SCRIPT_PATH')
msp = str(msp)
myList = msp.split(';')
for each in myList:
print each


but this one gives error
Code:
def addFolderToMayaPath(p):
msp = mel.eval('getenv MAYA_SCRIPT_PATH')
msp = str(msp)
myList = msp.split(';')
msp += ";" + p
type(msp)
mel.eval('putenv "MAYA_SCRIPT_PATH" ' + msp)
maya.cmds.rehash()


QUESTION:
how exactly to add python list or path to MAYA_SCRIPT_PATH via python
huge thanks in advance everyone for time and suggestions and solutions
regards,lala

Reply all
Reply to author
Forward
0 new messages