Sponsors
Sponsor Products
Disable Maya.env Files??
posted by Mike Moss  on April 18, 2018, 1:27 p.m. (8 months ago)
2 Responses     0 Plus One's     0 Comments  

Hi,

I just sent an email to Autodesk asking the same question, but though i might get a faster response here.

 

Do to our internal pipeline, etc the Maya.env files that are located in the "C:\Users\<USER>\Documents\maya\2018\maya.env" location cause problems for us. Usually if they are empty or do not exist then its fine, but obviously, if the file is deleted, then Maya re-creates it on next start up. Its sporadic, and at times, users decide to enter their own data in there - things that should not be, and wrecks havoc on our pipeline. We do not use this file AT ALL - so i was curious if there is a way to force Maya to ignore that file. We use other Windows Env Variables to enable/disable other features and settings. Does Maya have a Windows Env Variable that i can push out through GPO to disable maya.env file all together?

For example, right now via GPO i have this varible pushed out to all workstations:

 

MAYA_ENABLE_LEGACY_VIEWPORT = 1

 

Is there something i can do similarly to disable maya.env files? Something like:

 

MAYA_DISABLE_ENV = 1

 

Thanks,

Mike

 


Thread Tags:
  maya 

Response from Jesse Kretschmer @ April 30, 2018, noon
Hey Mike,The Maya.env file is evaluated before userSetup.py, so you can leverage that to detect, report and maybe even correct the value.

Use the GPO to append a something to the PYTHONPATH and install a userSetup.py that you control. I'm not sure when Maya evaluates theMAYA_ENABLE_LEGACY_VIEWPORT variable, but it might happen afterthe userSetup.py gets executed which could allow you to correct the variable before it's a problem.
Here's a quick example script that would help with detection:
import os
import sys
import pymel.versions

maya_ver_name = 
maya_env_path = os.path.expanduser(
    os.path.join("~", "maya", pymel.versions.installName(), "Maya.env"))

if os.path.exists(maya_env_path):
    with open(maya_env_path, 'r') as handle:
        lines = [_ for _ in handle.readlines() if _.strip()]
    if lines:
        sys.stdout.write(
            "WARNING: '%s' exists and is not blank!\n" % maya_env_path)




On Wed, Apr 18, 2018 at 7:27 PM, Mike Moss <content@studiosysadmins.com> wrote:

Hi,

I just sent an email to Autodesk asking the same question, but though i might get a faster response here.

Do to our internal pipeline, etc the Maya.env files that are located in the "C:\Users\<USER>\Documents\maya\2018\maya.env" location cause problems for us. Usually if they are empty or do not exist then its fine, but obviously, if the file is deleted, then Maya re-creates it on next start up. Its sporadic, and at times, users decide to enter their own data in there - things that should not be, and wrecks havoc on our pipeline. We do not use this file AT ALL - so i was curious if there is a way to force Maya to ignore that file. We use other Windows Env Variables to enable/disable other features and settings. Does Maya have a Windows Env Variable that i can push out through GPO to disable maya.env file all together?

For example, right now via GPO i have this varible pushed out to all workstations:

MAYA_ENABLE_LEGACY_VIEWPORT = 1

Is there something i can do similarly to disable maya.env files? Something like:

MAYA_DISABLE_ENV = 1

Thanks,

Mike


To unsubscribe from the list send a blank e-mail to mailto:studiosysadmins-discuss-request@studiosysadmins.com?subject=unsubscribe


0 Plus One's     0 Comments  
   

Response from Ben Tucker @ April 18, 2018, 1:31 p.m.

Would it be possible in your environment to have a GPO write out the default Maya.env on user login? That way even if a user changes settings which render your pipeline unproductive, when they log back in it gets written over? 


0 Plus One's     0 Comments