-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource_me_to_set_env.sh
69 lines (63 loc) · 2.1 KB
/
source_me_to_set_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#
# This script is meant to be sourced (aka the . command).
# This script:
# * checks folders
# * checks which configuration file is loadable
#
# * relies on PROJECT_NAME environment variable
#
# * sets the PYTHONPATH environment variable
# * sets the CONF_FILE environment variable
# * sets the edit_face alias
#
if test -z "$CONCEPT_DIR"; then
echo '$CONCEPT_DIR' not set, assuming '$PWD' "($PWD)"
CONCEPT_DIR=$PWD
fi
# override PROJECT_NAME if given an argument
if test $0 != './start_face.sh' && test -n "$1"; then
PROJECT_NAME=$1
fi
# test known errors 1st
if ! test -d "$CONCEPT_DIR/common"; then
echo "could not find directory $CONCEPT_DIR/common . Aborting ..."
elif test -z "$PROJECT_NAME"; then
echo "missing argument or "'$PROJECT_NAME'" not set: cannot continue."
else
echo "Setting environment for project: $PROJECT_NAME"
# Platform dependent paths (handles the famous nagger thanks to minGW)
case `uname -s` in
MINGW*)
MODULES_PATH="$CONCEPT_DIR/common;$CONCEPT_DIR/HRI"
PYTHONPATH="$MODULES_PATH"
;;
*)
MODULES_PATH="$CONCEPT_DIR/common:$CONCEPT_DIR/HRI"
# The following depends on the BGE python version (necessary for blender 2.4x)
BGE_PYTHON_PATH="/usr/lib/python$BGE_PYTHON_VERS/:/usr/lib/python$BGE_PYTHON_VERS/lib-dynload"
PYTHONPATH="$PYTHONPATH:$BGE_PYTHON_PATH:$MODULES_PATH"
;;
esac
export PYTHONPATH
# Load helper functions (calling python)
. $CONCEPT_DIR/common/source_me.sh
CONF_FILE=$(get_python_conf $PROJECT_NAME)
if test $? != 0 ; then
echo "$CONF_FILE"
unset CONF_FILE
else
if test -n "$CONF_FILE"; then
echo "found configuration file: " $CONF_FILE
export CONF_FILE
else
echo -n "WARNING: unable to find any of these files: "
echo `get_python_conf_candidates $PROJECT_NAME`
echo "Edit project_def.py or $PROJECT_NAME environment variable."
fi
MISSING= check_python_conf $PROJECT_NAME
if test -n "$MISSING"; then
echo "missing required entries in conf: $MISSING"
fi
fi
alias edit_face="blender $CONCEPT_DIR/HRI/face/blender/lightHead.blend"
fi