How To Upgrade Shave To A New Version Of Maya

Contents

WARNING!!! This document is out of date. Use with caution.

Linux

Preparation

These instructions assume that you are using a 64-bit Fedora Core or CentOS system as your build machine.

Install the new version of Maya. If the installation comes in multiple parts, or has optional parts which can be selected, be sure to install both the devkit and the documentation.

Determine The OS Version Required

The versions of Linux supported by each release of Maya can be found here. Look for the Fedora Core/CentOS version and make note of it. If it matches the version you are using on your build machine, then you're safe. If not then you may be able to get away with building on whatever version of Fedora Core/CentOS you have. We'll start by trying that.

Get The Right Compiler

Find out what version of gcc the new version of Maya requires. In recent versions this information has been found in the docs under Maya Developer Help -> Setting up your build environment -> Linux environment -> Linux compiler requirement. However, if you are building from a Beta version of Maya often that section is empty or still refers to the previous version of Maya. If that is the case then post on the Beta forum a request for the Linux compiler requirement and gcc build info.

Check to see if you already have the necessary compiler. Type the following command:

	gcc -v

The last line of that should look something like this:

	gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)

This indicates that your default version of gcc is 4.1.1. If that matches Maya's requirement, then you're all set. If not, then do the following command:

	ls -d1 /opt/gcc*

Note that that is the digit one after -d.

That should give you a listing something like this:

	/opt/gcc402
	/opt/gcc412
	/opt/gcc421

That means that you also have versions 4.0.2, 4.1.2 and 4.2.1 of gcc installed as options. If one of those matches Maya's compiler requirment then you're all set. If not then you will have to download the source code for the appropriate version of gcc and build and install it on your system. The Linux compiler requirement page in the docs gives instructions on how to do this. Again, if you are working from Beta docs the information may be missing or out of date so ask for it on the Beta forum.

In some cases it is possible to build a plugin using a different version of gcc than Autodesk has recommended. For example, we were able to successfully build the plugins for Maya 2008 using gcc 4.0.2 even though the recommended version was 4.1.2. You can try this if you feel lucky, but if you subsequently start seeing odd problem reports, keep in mind that it might be due to using the wrong version of gcc.

Update mayaVersions.linux

This file contains a description of the Linux configuration required for each version of Maya. It is broken up into three sections. The first contains descriptions of the official configurations supported by Autodesk. The second are the list of actual build configurations which we use for Shave. The third are a list of "unsafe" configurations which are added to match whatever weird configurations Shave development team members have available to them and can get to work.

At the end of the first section, add a line for the new Maya version, using the officially supported version of Fedora Core. If you will be building using that exact configuration (i.e. same compiler and same version of Fedora Core) then the last field on the line should be y, otherwise it should be n.

If you are building using something other than the supported configuration, then add a line to the end of the second section describing the build configuration that you will be using. Be sure to set the final field of this line to y.

Build It

That's it, you're done. Try doing a build.

MacOS

Preparation

Install the new version of Maya for MacOS. If the installation comes in multiple parts, or has optional parts which can be selected, be sure to install both the devkit and the documentation.

Upgrade Your MacOS Version If Necessary

The versions of MacOS supported by each release of Maya can be found here. If your build system's version of MacOS is on the list then you're safe. If not then you can try building Shave with the version you have, though that hasn't worked very often in the past. Failing that, you must upgrade your build system to the new version of MacOS.

Upgrade Your MacOS DevKit If Necessary

If you upgraded your version MacOS in the previous step, then you will need to upgrade your DevKit as well. Often the MacOS upgrade utility does not do this automatically so you may need to install the new DevKit explicitly.

Update mkosx.csh

At the top of mkosx.csh there is a line setting the defaultVersions variable to the list of Maya versions currently supported by Shave on MacOS. E.g:
	set defaultVersions=(2017 2018)
Add the new Maya version to the end of this list. E.g:
	set defaultVersions=(2017 2018 2019)

Build It

That's it, you're done. Try doing a build

Microsoft Windows

Preparation, Build Machine

Install the required version of Maya onto the build system. If the install consists of multiple parts, or has optional parts which can be selected, be sure to include the development kit. The Maya documentation is not necessary though obviously could be useful if you run into problems.

Set up an environment variable called AUTODESK_LOCATION which points to the root directory under which the different versions of Maya are installed. E.g. C:\Program Files\Autodesk.

Log out of your Windows account and back in for the environment variable to take effect.

Create New Project Configurations

Separate Visual Studio solution and project files are kept for each version of Visual Studio used to build Shave. These are tagged with Visual Studio's major version number in their names. E.g:

Note that the tags use Visual Studio's internal version number (i.e. the one from its 'about' information) not the year for which the Visual Studio version is named. For example, Visual Studio 2015 has internal version number 14.xx so its project files are tagged with 'vs14'.

If project files already exist for the required version of Visual Studio then add new debug and release project configurations for the new version of Maya by copying configurations from the previous version of Maya and modifying any properties which explicitly reference the Maya version (e.g. additional compiler include paths and additional linker library paths).

If the new version of Maya uses a new version of Visual Studio then you will need to create new solution and project files, named with the appropriate version tag. The simplest way to do this is as follows:

  1. Copy the previous version's solution and project files, using the new version tag for the new files. For example, if the new version of Visual Studio has an internal major version number of '15' then you would copy 'shaveHaircut-vs14.sln' to 'shaveHaircut-vs15.sln', and 'libShaveAPI-vs14.vcxproj' to 'libShaveAPI-vs15.vcxproj'.
  2. Using a text editor, modify the new solution file so that it references the new 'vs15' projects instead of the old 'vs14' ones.
  3. Start up the new version of Visual Studio and load the new solution into it. When VS offers to convert it for you, say yes and save out the converted files.
  4. Add new debug and release project configurations for the new version of Maya, as described above, and remove project configurations for the older versions of Maya.

Update The Build Scripts

mkwinall.bat

This file determines which versions of Maya should be built. There is a block of code for each version of Maya which looks something like this:
        if exist "%AUTODESK_LOCATION%\Maya2018\include\maya\MTypes.h" (
             if %errorlevel%==0 call mkwinversion 2018 Release %reuseLibexe%
             set reuseLibexe=y
        ) else (
             echo Maya 2018 not installed. Skipping build for Maya 2018
        )

Make a copy of the code for the most recent version of Maya, replacing all occurrences of the old version number with the new one, and paste it at the end of the code blocks.

mkwinVVVV.bat

For convenience there is a batch file for each version of Maya which can be used to build the plugin simply by double-clicking on it from Windows Explorer. The file is named mkwinVVVV.bat where 'VVVV' is the Maya version number (e.g. mkwin2018.bat). Make a copy of the most recent version of the file and rename it to use the new version number (e.g. mkwin2019.bat). Edit the new file and change all occurrances of the old version number to the new one.

Build It

That's it, you're done. Try doing a build.