-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·66 lines (60 loc) · 1.76 KB
/
install.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
#!/usr/bin/env bash
read -p "Enter Blender version e.g. 3.3 > " VER
# Determine the user's directory based on the operating system
case "$(uname -sr)" in
Darwin*)
# macOS
read -p "Enter your username > " USER
USER_PATH="/Users/${USER}/Library/Application Support/Blender/${VER}"
;;
Linux*Microsoft*)
# WSL
USER_PATH="${APPDATA}/Blender Foundation/Blender/${VER}"
;;
Linux*)
# Linux
USER_PATH="${HOME}/.config/blender/${VER}"
;;
CYGWIN* | MINGW* | MINGW32* | MSYS*)
# MS Windows
USER_PATH="${APPDATA}/Blender Foundation/Blender/${VER}"
;;
*)
# Unsupported operating system
echo "Install not supported on this OS"
exit 1
;;
esac
if [ ! -d "$USER_PATH" ]; then
echo "User Path: ${USER_PATH} doesn't exist, exiting."
exit 1
fi
# Install Extern addons
# USDZ
if [ -d "$USER_PATH/scripts/addons/io_scene_usdz" ]; then
rm -r "$USER_PATH/scripts/addons/io_scene_usdz"
fi
cp -r ./addons-extern/BlenderUSDZ/io_scene_usdz "$USER_PATH/scripts/addons"
# Install Intern addons
# remove previous heavypoly
if [ -d "$USER_PATH/scripts/addons/heavypoly" ]; then
rm -r "$USER_PATH/scripts/addons/heavypoly"
fi
# remove previous reload_addons
if [ -d "$USER_PATH/scripts/addons/reload_addons" ]; then
rm -r "$USER_PATH/scripts/addons/reload_addons"
fi
# remove legacy folder
if [ -d "$USER_PATH/scripts/addons/reload-addons" ]; then
rm -r "$USER_PATH/scripts/addons/reload-addons"
fi
### remove previous am_blender
if [ -d "$USER_PATH/scripts/addons/am_blender" ]; then
rm -r "$USER_PATH/scripts/addons/am_blender"
fi
# remove legacy folder
if [ -d "$USER_PATH/scripts/addons/am-blender" ]; then
rm -r "$USER_PATH/scripts/addons/am-blender"
fi
cp -r ./addons "$USER_PATH/scripts"
echo "Install complete @ ${USER_PATH}"