Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
initial (horrible) commit
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpneumann committed Apr 11, 2015
0 parents commit abbcc56
Show file tree
Hide file tree
Showing 22 changed files with 1,680 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Licensing:
Copyright (c) 2008-2010, John P. Neumann
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the AnimateShmanimate.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Portable Maya Prefs

## What?
These scripts take your user preferences, including all of your scripts and shelves and either copies them to another drive or loads them from a drive you have them backed up to.

## Why?
While I was attending college I got tired of having to manually go into the folders and copy my preferences over every time that I sat at a computer at school. So I took 20 minutes out of my class time and wrote these scripts and have been using them ever since. Then I realized that while I was at home working on my Mac that I needed the same thing. So I rewrote it as a bash script for OSX.

## What version should I use?
Well, you should use the version of maya that you're going to use. :) If you move from computer to computer and work on multiple versions of maya, you can use the any_version of the script. This version allows the user to type in the version of maya that they're using and it retrieves or sets the preferences based on that input. While it should work for any version of maya, I have only tested it down to 2008 and up to 2011. (*Note to windows users* I haven't had the chance to test it on a windows machine, so if it doesn't work file an issue. Also to note, if you're using the 64 bit version, you will need to specify the version with a -x64 at the end {eg. 2011-x64 or 2010-x64}.)

## Windows

### get_userPrefs.bat
This script retrieves your user preferences from the computer your working on. It uses the current user login to retrieve the scripts. When you run it, it will create a directory based on the version number of maya that you're using within the directory that you run the script from.

### set_userPrefs.bat
This script sets your user preferences from the directory that you run the script from (so make sure your preferences are backed up to the same location that you run this script from). When you run it, it will overwrite the preferences on the computer that you're on based on the current user login.

## OSX
### getPrefs.sh.command
This script retrieves your user preferences from the computer your working on. It uses the current user login to retrieve the scripts. When you run it, it will create a directory based on the version number of maya that you're using and create a directory called prefsBackup in the root of the drive that you specified.

### setPrefs.sh.command
This script sets your user preferences from the directory that you choose while the script is running. When you run it, it will overwrite the preferences on the computer that you're on based on the current user login.
73 changes: 73 additions & 0 deletions osx/2009/getPrefs.sh.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/sh
# Script courtesy of John P. Neumann
# john@animateshmanimate.com

# Put in an error checking function
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
# make script exit with correct error code
exit ${1}
fi
}

# Now move to the /Volumes directory and list out all the available volumes for you
# to move to so the user can choose where to create their files
cd /Volumes
IFS='
'
array=(`ls`)

len=${#array[*]}

i=0
while [ $i -lt $len ]; do
echo "$i: ${array[$i]}"
let i++
done

# Here we finally prompt the user for the appropriate volume and move to the volume
echo "\n"
echo "Which drive do you want to store your preferences on?\n"
echo "*******************"
echo "IMPORTANT!!!"
echo "*******************"
echo "Use the name of the drive and hit enter (do not put the number)"
read drive

vol=$drive
cd $vol
check_errs $? "Drive ${1} not found on your system. Please try again"

# Check if directory exists. If it doesn't create it. If it does just move to it.
DIR=prefsBackup
if [ -d "$DIR" ]
then
echo "prefsBackup directory already exists. Continuing happily..."
sleep 3
cd $DIR
else
echo "prefsBackup directory does not exist. Creating directory..."
mkdir $DIR
check_errs $? "Unable to create directory ${1}. Please check your permissions."
echo "Directory created. Continuing happily..."
sleep 3
cd $DIR
fi

# Now begin normal file operations including diff'ing the files to make sure changes don't exist
echo "Copying prefs folder..."
cp -v -r ~/Library/Preferences/Autodesk/maya/2009/ ./2009
check_errs $? "File ${1} not found. Please contact john@animateshmanimate.com and report this error"
echo "Comparing prefs directory to original directory..."
diff -qr ~/Library/Preferences/Autodesk/maya/2009/ ./2009/
check_errs $? "Error finding file ${1}. Please contact john@animateshmanimate.com and report this error. If the error was about .ds_store files or other . files, it is safe to ignore."
echo "\n"
echo "*******************"
echo "New versions of this script can be downloaded from http://animateshmanimate.com"
echo "Any issues please email john@animateshmanimate.com with the details"
echo "This work is licensed under the 3-clause BSD (\"New BSD License\") license."
echo "Full license information can be attained at:"
echo "http://animateshmanimate.com/rigs_n_scripts/script-licensing/"
echo "*******************"
70 changes: 70 additions & 0 deletions osx/2009/setPrefs.sh.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh
# Script courtesy of John P. Neumann
# john@animateshmanimate.com

# Put in an error checking function
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
# make script exit with correct error code
exit ${1}
fi
}

# Now move to the /Volumes directory and list out all the available volumes for you
# to move to so the user can choose where to create their files
cd /Volumes
IFS='
'
array=(`ls`)

len=${#array[*]}

i=0
while [ $i -lt $len ]; do
echo "$i: ${array[$i]}"
let i++
done

# Here we finally prompt the user for the appropriate volume and move to the volume
echo "\n"
echo "Which drive is your prefsBackup folder located on?\n"
echo "*******************"
echo "IMPORTANT!!!"
echo "*******************"
echo "Use the name of the drive and hit enter (do not put the number)"
read drive

vol=$drive
cd $vol
check_errs $? "Drive ${1} not found on your system. Please try again"

# Check if directory exists. If it doesn't create it. If it does just move to it.
DIR=prefsBackup
if [ -d "$DIR" ]
then
echo "prefsBackup directory already exists. Continuing happily..."
sleep 2
cd $DIR
else
echo "prefsBackup directory does not exist! Exiting"
sleep 2
exit;
fi

# Now begin normal file operations including diff'ing the files to make sure changes don't exist
echo "Copying prefs folder..."
cp -v -r ./2009 ~/Library/Preferences/Autodesk/maya/
check_errs $? "File ${1} not found. Please contact john@animateshmanimate.com and report this error"
echo "Comparing prefs directory to original directory..."
diff -qr ./2009/ ~/Library/Preferences/Autodesk/maya/2009/
check_errs $? "Error finding file ${1}. Please contact john@animateshmanimate.com and report this error. If the error was about .ds_store files or other . files, it is safe to ignore."
echo "\n"
echo "*******************"
echo "New versions of this script can be downloaded from http://animateshmanimate.com"
echo "Any issues please email john@animateshmanimate.com with the details"
echo "This work is licensed under the 3-clause BSD (\"New BSD License\") license."
echo "Full license information can be attained at:"
echo "http://animateshmanimate.com/rigs_n_scripts/script-licensing/"
echo "*******************"
73 changes: 73 additions & 0 deletions osx/2010/getPrefs.sh.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/sh
# Script courtesy of John P. Neumann
# john@animateshmanimate.com

# Put in an error checking function
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
# make script exit with correct error code
exit ${1}
fi
}

# Now move to the /Volumes directory and list out all the available volumes for you
# to move to so the user can choose where to create their files
cd /Volumes
IFS='
'
array=(`ls`)

len=${#array[*]}

i=0
while [ $i -lt $len ]; do
echo "$i: ${array[$i]}"
let i++
done

# Here we finally prompt the user for the appropriate volume and move to the volume
echo "\n"
echo "Which drive do you want to store your preferences on?\n"
echo "*******************"
echo "IMPORTANT!!!"
echo "*******************"
echo "Use the name of the drive and hit enter (do not put the number)"
read drive

vol=$drive
cd $vol
check_errs $? "Drive ${1} not found on your system. Please try again"

# Check if directory exists. If it doesn't create it. If it does just move to it.
DIR=prefsBackup
if [ -d "$DIR" ]
then
echo "prefsBackup directory already exists. Continuing happily..."
sleep 3
cd $DIR
else
echo "prefsBackup directory does not exist. Creating directory..."
mkdir $DIR
check_errs $? "Unable to create directory ${1}. Please check your permissions."
echo "Directory created. Continuing happily..."
sleep 3
cd $DIR
fi

# Now begin normal file operations including diff'ing the files to make sure changes don't exist
echo "Copying prefs folder..."
cp -v -r ~/Library/Preferences/Autodesk/maya/2010/ ./2010
check_errs $? "File ${1} not found. Please contact john@animateshmanimate.com and report this error"
echo "Comparing prefs directory to original directory..."
diff -qr ~/Library/Preferences/Autodesk/maya/2010/ ./2010/
check_errs $? "Error finding file ${1}. Please contact john@animateshmanimate.com and report this error. If the error was about .ds_store files or other . files, it is safe to ignore."
echo "\n"
echo "*******************"
echo "New versions of this script can be downloaded from http://animateshmanimate.com"
echo "Any issues please email john@animateshmanimate.com with the details"
echo "This work is licensed under the 3-clause BSD (\"New BSD License\") license."
echo "Full license information can be attained at:"
echo "http://animateshmanimate.com/rigs_n_scripts/script-licensing/"
echo "*******************"
70 changes: 70 additions & 0 deletions osx/2010/setPrefs.sh.command
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/sh
# Script courtesy of John P. Neumann
# john@animateshmanimate.com

# Put in an error checking function
check_errs()
{
if [ "${1}" -ne "0" ]; then
echo "ERROR # ${1} : ${2}"
# make script exit with correct error code
exit ${1}
fi
}

# Now move to the /Volumes directory and list out all the available volumes for you
# to move to so the user can choose where to create their files
cd /Volumes
IFS='
'
array=(`ls`)

len=${#array[*]}

i=0
while [ $i -lt $len ]; do
echo "$i: ${array[$i]}"
let i++
done

# Here we finally prompt the user for the appropriate volume and move to the volume
echo "\n"
echo "Which drive is your prefsBackup folder located on?\n"
echo "*******************"
echo "IMPORTANT!!!"
echo "*******************"
echo "Use the name of the drive and hit enter (do not put the number)"
read drive

vol=$drive
cd $vol
check_errs $? "Drive ${1} not found on your system. Please try again"

# Check if directory exists. If it doesn't create it. If it does just move to it.
DIR=prefsBackup
if [ -d "$DIR" ]
then
echo "prefsBackup directory already exists. Continuing happily..."
sleep 2
cd $DIR
else
echo "prefsBackup directory does not exist! Exiting"
sleep 2
exit;
fi

# Now begin normal file operations including diff'ing the files to make sure changes don't exist
echo "Copying prefs folder..."
cp -v -r ./2010 ~/Library/Preferences/Autodesk/maya/
check_errs $? "File ${1} not found. Please contact john@animateshmanimate.com and report this error"
echo "Comparing prefs directory to original directory..."
diff -qr ./2010/ ~/Library/Preferences/Autodesk/maya/2010/
check_errs $? "Error finding file ${1}. Please contact john@animateshmanimate.com and report this error. If the error was about .ds_store files or other . files, it is safe to ignore."
echo "\n"
echo "*******************"
echo "New versions of this script can be downloaded from http://animateshmanimate.com"
echo "Any issues please email john@animateshmanimate.com with the details"
echo "This work is licensed under the 3-clause BSD (\"New BSD License\") license."
echo "Full license information can be attained at:"
echo "http://animateshmanimate.com/rigs_n_scripts/script-licensing/"
echo "*******************"
Loading

0 comments on commit abbcc56

Please sign in to comment.