[MtoA] What environment variables does MtoA use?


MtoA uses these environment variables:

  • ARNOLD_PLUGIN_PATH is for shaders.
    MtoA and kick use this environment variable. Arnold doesn’t (when you write Arnold code that loads an ASS file, Arnold doesn’t getenv ARNOLD_PLUGIN_PATH)
  • MTOA_TEMPLATES_PATH is for the Attribute Editor (AE) templates of Arnold shaders. For example, if you use the alShaders:
    set MTOA_TEMPLATES_PATH  C:\solidangle\alShaders\alShaders-win-1.0.0rc18-ai4.2.12.2\ae
  • MTOA_EXTENSIONS_PATH is for MtoA extensions like Yeti. By default, MTOA_EXTENSIONS_PATH points to the extensions folder in the MtoA installation.
  • MAYA_CUSTOM_TEMPLATE_PATH is for Node Editor templates for Arnold shaders. For example, if you use the alShaders:
    set MAYA_CUSTOM_TEMPLATE_PATH C:\solidangle\alShaders\alShaders-win-1.0.0rc18-ai4.2.12.2\aexml
  • My personal favorite, MTOA_STARTUP_LOG_VERBOSITY, sets the MtoA log verbosity during startup: 1 for Errors and Warnings, 2 for Errors, Warnings, and Info, and 3 for all. This can be handy for troubleshooting MtoA loading problems.
  • MTOA_LOG_PATH is the default location for Arnold log files.

These are not MtoA environment variables:

  • ARNOLD_PROCEDURAL_PATH is an HtoA environment variable. It’s not used by MtoA (or kick).
  • MTOA_PROCEDURAL_PATH doesn’t exist. No such environment variable is used or supported by MtoA.
  • [MtoA] Is there an ARNOLD_PROCEDURAL_PATH environment variable?


    No, there isn’t. HtoA recently added support for an ARNOLD_PROCEDURAL_PATH environment variable, but neither MtoA or Arnold itself support ARNOLD_PROCEDURAL_PATH.

    Here’s a few things you can do:

    • If you’re kicking ASS files, you can set the procedural search path on the kick command line. For example, assuming ARNOLD_PROCEDURAL_PATH is set in your environment, you could do this on Windows:
         kick -set options.procedural_search_path %ARNOLD_PROCEDURAL_PATH%

      Or this on Linux or OSX:

         kick -set options.procedural_search_path $ARNOLD_PROCEDURAL_PATH
    • You could add the procedural search path to the system path (PATH on Windows, LD_LIBRARY_PATH on Linux, DYLD_LIBRARY_PATH on OSX). Arnold will then find the procedural by searching through the system path.
    • Maya, you can put an environment variable in the Procedural Search Path text box. Note that you have to use square brackets, like this: [ARNOLD_PROCEDURAL_PATH].
      procedural_search_path

    [Arnold] [RLM] ARNOLD_LICENSE_HOST and ARNOLD_LICENSE_PORT no longer supported


    If you’re still using ARNOLD_LICENSE_HOST and ARNOLD_LICENSE_PORT, now’s the time to stop. As of Arnold 4.2.4.0, these deprecated environment variables are no longer supported.

    Instead, use solidangle_LICENSE.

    For example, if you currently have these environment variable settings:

    ARNOLD_LICENSE_HOST=lic_server
    ARNOLD_LICENSE_PORT=5055

    you can replace them with this:

    solidangle_LICENSE 5055@lic_server

    Note: solidangle_LICENSE was added in Arnold 4.0.4 (released back in 23-May-2012).

    Also new with Arnold 4.2.4.0 is the ability to use a .lic file instead of an environment variable. Just create a .lic file that looks like this:

    HOST lic_server 5055

    and put the .lic file in the same folder as Arnold (ai.dll, libai.so, or libai.dylib).

    If you want to put the .lic file somewhere else, then you need to set solidangle_LICENSE to point to the lic file.

    [RLM] [MacOSX] Setting solidangle_LICENSE on Yosemite


    In Yosemite, Apple removed support for environment variables in launchd.conf, so you need to find another way to set global, system-wide environment variables. For example, if you want solidangle_LICENSE to be automatically set, you could use a launchd plist.

    Here’s an example plist that uses launchctl to set the solidangle_LICENSE environment variable.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version="1.0">
     <dict>
            <key>Label</key>
            <string>com.solidangle.setenv</string>
            <key>ProgramArguments</key>
            <array>
            <string>/bin/launchctl</string>
            <string>setenv</string>
            <string>solidangle_LICENSE</string>
            <string>5053@replace-me</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
            <key>ServiceIPC</key>
            <false/>
     </dict>
     </plist>
    

    You’ll need to edit this plist and save it in /Library/LaunchDaemons. The file permissions and ownership should look like this:

    -rw-r--r--@ 1 root wheel 661 Oct 22 13:52 com.solidangle.setenv.plist

    Use sudo chmod to set the permissions, and sudo chown root:wheel to set the ownerships.
    Then load the plist:
    sudo launchctl load -w /Library/LaunchDaemons/com.solidangle.setenv.plist

    And then restart your machine.

    References:

    [MacOSX] Setting solidangle_LICENSE


    There are several ways you can do it.

    • You can use Maya.env to set the solidangle_LICENSE environment variable.

      In your Maya.env file, add this line:

      solidangle_LICENSE=XXXX@SERVER
      

      where XXXX is the port number, and SERVER is the name or IP address of the computer.

      Maya.env is located in your user Library. For example: /Users/steve/Library/Preferences/Autodesk/maya/2014.

      By default, the Library folder is a hidden folder, so you may need to un-hide the Library folder.

    • You can set solidangle_LICENSE as a system environment variable.
      1. Log in with an Administrator account and run this command to open a text editor.
        sudo nano /etc/launchd.conf
        
      2. Add this line to /etc/launchd.conf:
        setenv solidangle_LICENSE XXXX@SERVER
        
      3. Save the file and exit.
      4. Restart the Mac.

    If you don’t want to restart your Mac just yet, you can try setting the environment variable like this (it will last until you restart your machine):

    launchctl setenv solidangle_LICENSE XXXX@SERVER
    

    Using environment variables in Arnold search paths


    To use an environment variable in one of the Arnold search paths, you just have to put the environment variable in square brackets [ ].

    For example, [ARNOLD_PLUGINS_PATH] or [MY_TEXTURE_PATH].
    Maya-Arnold-SearchPaths

    A search path can include many paths; just use a semi-colon (;) to separate each path. For example, here’s a search path that includes three different locations:

    [ARNOLD_PLUGINS_PATH];[USERPROFILE]\Dev\shaders\bin\Release\x64;[MY_PLUGINS_PATH]