Skip to content

Instantly share code, notes, and snippets.

@stenstorp
Last active September 8, 2017 19:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stenstorp/5d54f698b087800a3765fd0b69358fa6 to your computer and use it in GitHub Desktop.
Save stenstorp/5d54f698b087800a3765fd0b69358fa6 to your computer and use it in GitHub Desktop.
Install Autodesk Maya 2016 and Mentalray on Ubuntu 16.04
#!/bin/bash
#Props to https://gist.github.com/MichaelLawton for original script
#Download Maya from here: http://download.autodesk.com/us/support/files/maya_2016_service_pack_6/Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz
#Download Mentalray from here: http://download.autodesk.com/us/support/files/maya_2016_service_pack_6/mentalray_Plugin_for_Maya_2016_SP6_EN_Linux_64bit.tgz
#Get a student License from: http://www.autodesk.com/education/free-software/maya
#Log in and select maya 2016, your language and an OS. Either should work.
# !!!!!! IMPORTANT !!!!!!
# BEFORE RUNNING, REPLACE "USER" AND "HOME" AT THE BOTTOM OF THIS SCRIPT WITH YOUR USERNAME AND HOME FOLDER
# OTHERWISE, BAD THINGS WILL HAPPEN!
# !!!!!! IMPORTANT !!!!!!
if [ "$(id -u)" != "0" ]; then
echo "Please run as root or via sudo."
exit 1
fi
mkdir maya2016_setup
mv Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz maya2016_setup/
cd maya2016_setup
echo "Extracting files..."
tar xf Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz
export RPM_INSTALL_PREFIX=/usr
export LD_LIBRARY_PATH=/opt/Autodesk/Adlm/R11/lib64/
export LIBCRYPTO="/lib/x86_64-linux-gnu/libcrypto.so.1.0.0"
export LIBSSL="/lib/x86_64-linux-gnu/libssl.so.1.0.0"
echo "Installing dependencies..."
apt install -qq libssl-dev libjpeg62 alien csh tcsh libaudiofile-dev libglw1-mesa elfutils libglw1-mesa-dev mesa-utils xfstt ttf-liberation xfonts-100dpi xfonts-75dpi ttf-mscorefonts-installer libfam0 libfam-dev libgstreamer-plugins-base0.10-0
wget -q http://mirrors.kernel.org/ubuntu/pool/main/libx/libxp/libxp6_1.0.2-1ubuntu1_amd64.deb
ar x libxp6_1.0.2-1ubuntu1_amd64.deb
tar xf data.tar.xz
echo "Turning rpms into debs. This may take a while"
for i in *.rpm; do
alien -c $i;
done
echo "Installing debs"
dpkg -i *.deb
mkdir /usr/tmp
chmod 777 /usr/tmp
xset +fp /usr/share/fonts/X11/100dpi/
xset +fp /usr/share/fonts/X11/75dpi/
cp usr/lib/x86_64-linux-gnu/libXp.so.6 /usr/autodesk/maya2016/lib/
cp /usr/lib/x86_64-linux-gnu/libcrypto.so /usr/autodesk/maya2016/lib/libcrypto.so.10
cp /usr/lib/x86_64-linux-gnu/libssl.so /usr/autodesk/maya2016/lib/libssl.so.10
cp /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 /usr/autodesk/maya2016/lib/libtiff.so.3
cp /usr/lib/x86_64-linux-gnu/libjpeg.so.62 /usr/autodesk/maya2016/lib/libjpeg.so.62
rm /usr/lib/libfam.so.0
ln -s /usr/lib/libfam.so.0.0.0 /usr/lib/libfam.so.0
sh -c "echo 'setenv LC_ALL en_US.UTF-8' >> /usr/autodesk/maya2016/bin/maya2016"
export MAYA_LOCATION=/usr/autodesk/maya2016/
echo "Making sure Maya can't use rpm"
echo "int main (void) {return 0;}" > notrpm.c
gcc notrpm.c -o notrpm
mv /usr/bin/rpm /usr/bin/rpm_backup
cp notrpm /usr/bin/rpm
chmod +x ./setup
./setup
rm /usr/bin/rpm
mv /usr/bin/rpm_backup /usr/bin/rpm
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
echo "Making sure Maya will run"
sed -n '/LIBQUICKTIME_PLUGIN_DIR/ i setenv LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjpeg.so.62' /usr/autodesk/maya2016/bin/maya
sed -i '/Exec/c\Exec=xterm -e \"export MAYA_DISABLE_CIP=1 && maya\"' /usr/autodesk/maya2016/desktop/Autodesk-Maya.desktop
rm /usr/share/applications/Autodesk-Maya2016.desktop
cp /usr/autodesk/maya2016/desktop/Autodesk-Maya.desktop /usr/share/applications/Autodesk-Maya2016.desktop
export MAYA_DISABLE_CIP=1 && maya
echo "Removing setup folder"
mv Autodesk_Maya_2016_SP6_EN_Linux_64bit.tgz ..
cd ..
rm -rf maya2016_setup
echo "Extracting Mentalray"
mkdir mentalray_setup
mv mentalray_Plugin_for_Maya_2016_SP6_EN_Linux_64bit.tgz mentalray_setup/
cd mentalray_setup
tar xf mentalray_Plugin_for_Maya_2016_SP6_EN_Linux_64bit.tgz
echo "Turning rpm into deb. This may take a while"
alien -c mentalrayForMaya2016_0-2016.0-2775.x86_64.rpm
echo "Installing Mentalray"
dpkg -i mentalrayformaya2016-0_2016.0-2776_amd64.deb
echo "Making sure Mentalray can't use rpm"
echo "int main (void) {return 0;}" > notrpm.c
gcc notrpm.c -o notrpm
mv /usr/bin/rpm /usr/bin/rpm_backup
cp notrpm /usr/bin/rpm
chmod +x ./setup
./setup
rm /usr/bin/rpm
mv /usr/bin/rpm_backup /usr/bin/rpm
echo "Making sure Mentalray will run"
sed -i '/MENTALRAY_LOCATION/c\MENTALRAY_LOCATION:=/usr/autodesk/mentalrayForMaya2016\' /usr/autodesk/modules/maya/2016/mentalray.mod
echo "Removing setup folder"
mv mentalray_Plugin_for_Maya_2016_SP6_EN_Linux_64bit.tgz ../
cd ..
rm -rf mentalray_setup
echo "repairing permissions..."
chown -R USER HOME
echo "Maya is now ready to use!"
echo " "
echo "To disable the shortcuts overlay when holding the super key,"
echo "install compizconfig-settings-manager using:"
echo "sudo apt install compizconfig-settings-manager"
echo "Run ccsm and go to Ubuntu unity plugin and disable"
echo "Enable Shortcut Hints Overlay"
echo " "
echo "To enable mentalray, open maya and go to:"
echo "Windows -> Settings/Preferences -> Plug-in Manager"
echo "Scroll down to /usr/autodesk/mentalrayForMaya2016/plug-ins"
echo "And check 'Loaded' and 'Auto load'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment