- Code: Select all
#!/bin/bash
if test -e /usr/share/blender/VERSION; then
# Seems some version of blender exists
BLENDER=`cat /usr/share/blender/VERSION`
# Only 2.49a and 2.49b works with MHX exporter, no
# need to do anything if none of those versions
# are installed.
VALID="n";
if test $BLENDER == "2.49a"; then
VALID="y";
fi
if test $BLENDER == "2.49b"; then
VALID="y"
fi
if test $VALID == "y"; then
# A valid version of blender is installed
if test -d ~/.blender; then
# Blender has been started once and has
# set up local files
if test -d ~/.blender/scripts; then
# Scripts dir is ready to be installed in
cd ~/.blender/scripts
if test -e ./mhx_export.py ; then
# Probably already installed
echo "MHX already installed"
else
# install MHX as symlinks
echo "Setting up MHX importer for blender"
ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_export.py
ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_import.py
ln -sf /usr/share/makehuman/importers/mhx/blender249/mhx_lipsync.py
ln -sf /usr/share/makehuman/importers/mhx/blender249/pydrivers.py
fi
fi
fi
fi
fi
cd /usr/share/makehuman
./makehuman
In summary, if a valid version of blender has been installed, symlinks to the MHX import/export modules will be placed in $HOME/.blender/scripts, and thus be available the next time the user starts blender.
So... Feedback on this? Is it a bad idea to automatically make the modules available to the user? Would it be better to require the users to take explicit action?