[MtoA] Switching between multiple versions of MtoA


start_menu_mtoa

If, like me, you need to switch between different versions of MtoA, here’s a recipe for setting that up.

First, you have to install multiple versions. As you probably already know, the MtoA installer always wants to uninstall first. I take care of that by zapping the Uninstall registry entry with this command:

reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\MtoA2016" /f

Then I run the MtoA installer and install in a folder with the version name, like this:
C:\solidangle\mtoadeploy\2016-1.2.7.3

I start Maya with a batch file that creates a symbolic link named “C:\solidangle\mtoadeploy\2016” that links to the version of MtoA I want to use:

rmdir C:\solidangle\mtoadeploy\2016
mklink /D C:\solidangle\mtoadeploy\2016 C:\solidangle\mtoadeploy\2016-1.2.7.3
rem mklink /D C:\solidangle\mtoadeploy\2016 C:\solidangle\mtoadeploy\2016-1.2.2.0

set RLM_DEBUG=arnold
start "" "C:\Program Files\Autodesk\Maya2016\bin\maya.exe" %* -log %TEMP%\maya.log

My batch file also adds the location of my custom mtoa.mod to MAYA_MODULE_PATH. My custom mtoa.mod points to “C:\solidangle\mtoadeploy\2016”, and handles all versions of Maya:

+ MAYAVERSION:2018 mtoa any C:\solidangle\mtoadeploy\2018
PATH +:= bin
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/mtoa/ui/templates
MAYA_SCRIPT_PATH +:= scripts/mtoa/mel
MAYA_RENDER_DESC_PATH +:= 
+ MAYAVERSION:2017 mtoa any C:\solidangle\mtoadeploy\2017
PATH +:= bin
MAYA_RENDER_DESC_PATH +:=
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/mtoa/ui/templates
MAYA_SCRIPT_PATH +:= scripts/mtoa/mel
+ MAYAVERSION:2016 mtoa any C:\solidangle\mtoadeploy\2016
PATH +:= bin
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/mtoa/ui/templates
+ MAYAVERSION:2015 mtoa any C:\solidangle\mtoadeploy\2015
PATH +:= bin
MAYA_CUSTOM_TEMPLATE_PATH +:= scripts/mtoa/ui/templates
+ MAYAVERSION:2014 mtoa any C:\solidangle\mtoadeploy\2014
PATH +:= bin
+ MAYAVERSION:2013 mtoa any C:\solidangle\mtoadeploy\2013
PATH +:= bin

 

[MtoA] Pimping your Yeti module file


Here’s a variation of the Yeti module file that adds the bin folder to the PATH, and plug-ins to MTOA_EXTENSIONS_PATH:

+ pgYetiMaya any C:\solidangle\yeti\Yeti-v1.3.14_Maya2014-windows64
PATH +:= bin
MTOA_EXTENSIONS_PATH +:= plug-ins

MtoA uses MTOA_EXTENSIONS_PATH to find the Yeti extension for MtoA, and Arnold uses PATH to find the Yeti procedural.

[MtoA] One mtoa.mod to rule them all


After a few tries, I got one mtoa.mod file that works for multiple Maya versions:

+ MAYAVERSION:2015 mtoa any C:\solidangle\mtoadeploy\2015
PATH +:= bin
+ MAYAVERSION:2014 mtoa any C:\solidangle\mtoadeploy\2014
PATH +:= bin
+ MAYAVERSION:2013 mtoa any C:\solidangle\mtoadeploy\2013
PATH +:= bin

I had to repeat the PATH line for each module, otherwise the bin folder wasn’t added to the PATH.

I just had to set MAYA_MODULE_PATH to point to this mtoa.mod file, and then I could load MtoA in Maya 2013, 2014, and 2015.

This could be useful if you have multiple users sharing a single machine, because with this mtoa.mod, you don’t have to worry about putting version-specific mtoa.mod files in every user’s Maya folder (by default, the MtoA installer puts mtoa.mod in the user’s $MAYA_APP_DIR\\modules\\<version> folders).

Another way to do it would to be put the mtoa.mod files in the default shared modules folders. For example, on Windows:

C:\Program Files\Common Files\Autodesk Shared\Modules\Maya\2013
C:\Program Files\Common Files\Autodesk Shared\Modules\Maya\2014
C:\Program Files\Common Files\Autodesk Shared\Modules\Maya\2015

On Linux:

/usr/autodesk/modules/maya/<version>

On Mac OS X:

/Users/Shared/Autodesk/maya/<version> for MacOS