-
Notifications
You must be signed in to change notification settings - Fork 3
/
linkPlugin
executable file
·45 lines (40 loc) · 996 Bytes
/
linkPlugin
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
#!/bin/sh
if [ -d "$HOME/.config/blender" ]; then
BLENDERVERPATH="$HOME/.config/blender"
else
BLENDERVERPATH="$HOME/.blender"
fi
help() {
echo "Radix Map Editor Blender Linker"
echo ""
echo ""
echo "Links Radix Map Editor module to blender for development."
echo ""
echo "Don't forget to activate the module in Blender"
echo ""
echo "Usage: $0 -b blender_version"
echo "Available Blender versions: "
ls "$BLENDERVERPATH"
}
getopts "h?vb:" opt
case "$opt" in
h|\?)
help
exit 0
;;
b)
if [ -d "$BLENDERVERPATH/$OPTARG" ]; then
ADDONSPATH="$BLENDERVERPATH/$OPTARG/scripts/addons"
mkdir -p "$ADDONSPATH"
DIR=$(CDPATH= cd "$(dirname "$0")" && pwd)
ln -fs "$DIR/addon/" "$ADDONSPATH/RadixMapEditor"
else
echo "No blender installation found."
exit 0
fi
;;
*)
help
exit 0
;;
esac