Reputation: 111
In Maya, how can I use Python to achieve the same functionality as the MEL commands getenv
and putenv
? i've tried to import maya.mel but it doesn't have a getenv or putenv argument:
import maya.mel as mel mel.getenv('ARNOLD_PLUGIN_PATH')
ie returns
Upvotes: 0
Views: 199
Reputation: 111
problem solved using the maya.mel.eval command:
import maya.mel as mel
X3_PATH="G:/Mon Drive/EDDY ALL WORK/3.0/Eddy3ree/Eddy3ree_01"
path=mel.eval('getenv ARNOLD_PLUGIN_PATH')+';'+X3_PATH # get path
mel.eval(('putenv ARNOLD_PLUGIN_PATH \"'+path+'\"')) # set path
print(mel.eval('getenv ARNOLD_PLUGIN_PATH')) # print path
Upvotes: 0