editting Maya.env file

editting Maya.env file

jwlove
Advocate Advocate
2,044 Views
3 Replies
Message 1 of 4

editting Maya.env file

jwlove
Advocate
Advocate

Is it safe to edit the Maya.env file while maya is open?

 

I'm using it to set some os.environ variables for a few project settings (like an asset name to use in some scripts, for example), and I would like to edit the file with scripts from within maya so I don't have to hand edit that file every time I need to adjust the settings (this way I can open maya back up and have all the os.environ settings ready to go from my last maya session).

 

I just want to make sure it won't freak Maya out if that file changes while it's open.

 

Thanks!

0 Likes
Accepted solutions (1)
2,045 Views
3 Replies
Replies (3)
Message 2 of 4

zhong_wu
Autodesk Support
Autodesk Support
Accepted solution

The maya.env file is only read while Maya is starting up, if my understanding is correct, it should be fine to edit maya.env file while Maya is open, but the setting will not take effect until Maya is running next time, please check if this is an issue of your usage. 

 

 Also,  another way people usually do is to set the maya.env file before maya starts up with a batch script, this may not be suitable for your case, just for your reference. 

 

 


John Wu
Developer Technical Services
Autodesk Developer Network


Message 3 of 4

jwlove
Advocate
Advocate

Sorry to get back so late... I've had some computer issues...

 

Anyway, I gave it a try and haven't seen any issues, so I think it's safe.  An external tool that would set the env file before launching Maya would be cool too, but this will allow me to get by until I have time to figure out how to make that.

 

Thanks!

0 Likes
Message 4 of 4

malcomarmstrong
Advocate
Advocate

As a rule, I always restart Maya if I edit any supporting files. Perhaps not neccessary, but I have not had any issues doing that. Its a bit of a pain to restart sometimes, but whatever works I guess.

0 Likes