1
+ ########################################################################
2
+ # Copyright (c) 2017 Unity Technologies. All rights reserved.
3
+ # NOTICE: All information contained herein is, and remains
4
+ # the property of Unity Technologies Aps. and its suppliers,
5
+ # if any. The intellectual and technical concepts contained
6
+ # herein are proprietary to Unity Technologies Aps. and its
7
+ # suppliers and may be covered by Canadian, U.S. and/or
8
+ # Foreign Patents, patents in process, and are protected
9
+ # by trade secret or copyright law. Dissemination of this
10
+ # information or reproduction of this material is strictly
11
+ # forbidden unless prior written permission is obtained from
12
+ # Unity Technologies Aps.
13
+ #
14
+ ########################################################################
15
+ #!/bin/bash
16
+
17
+ # Configure where Unity is installed
18
+ if [ ! -f "${UNITY_EDITOR_PATH}" ]; then
19
+ UNITY_EDITOR_PATH="/Applications/Unity/Unity.app/Contents/MacOS/Unity"
20
+ fi
21
+ echo "Using UNITY_EDITOR_PATH=${UNITY_EDITOR_PATH}"
22
+
23
+ # Configure which Unity project to install package
24
+ if [ ! -d "${PROJECT_PATH}" ]; then
25
+ PROJECT_PATH=~/Development/FbxExporters
26
+ fi
27
+ echo "Using PROJECT_PATH=${PROJECT_PATH}"
28
+
29
+ # Configure where unitypackage is located
30
+ if [ ! -f "${PACKAGE_PATH}" ]; then
31
+ PACKAGE_PATH=`ls -t ${PROJECT_PATH}/FbxExporters_*.unitypackage | head -1`
32
+ fi
33
+ echo "Using PACKAGE_PATH=${PACKAGE_PATH}"
34
+
35
+ # Configure where Maya is installed
36
+ if [ ! -d "${MAYA_LOCATION}" ]; then
37
+ MAYA_LOCATION=/Applications/Autodesk/maya2017/Maya.app
38
+ fi
39
+ echo "Using MAYA_LOCATION=${MAYA_LOCATION}"
40
+
41
+ if [ ! -f "${UNITY_EDITOR_PATH}" ]; then
42
+ echo "Unity is not installed in default location"
43
+ exit -1
44
+ fi
45
+
46
+ # Install FbxExporters package
47
+ "${UNITY_EDITOR_PATH}" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
48
+
49
+ # Install Maya Integration
50
+ "${UNITY_EDITOR_PATH}" -batchMode -projectPath "${PROJECT_PATH}" -executeMethod FbxExporters.Integrations.InstallMaya -quit
51
+
52
+ # Configuring Maya2017 to auto-load integration
53
+ MAYA_PATH=${MAYA_LOCATION}/Contents/bin/maya
54
+
55
+ if [ ! -f "${MAYA_PATH}" ]; then
56
+ echo "Maya not installed at ${MAYA_PATH}"
57
+ else
58
+ # Configure Maya Integration
59
+ TEMP_SAVE_PATH="_safe_to_delete"
60
+ EXPORT_SETTINGS_PATH="Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel"
61
+ HEADLESS=1
62
+
63
+ # NOTE: we need start Maya in UI mode so that we can correctly configure the auto-load of the plugin.
64
+ "${MAYA_PATH}" -command "configureUnityOneClick \"${PROJECT_PATH}\" \"${UNITY_EDITOR_PATH}\" \"${TEMP_SAVE_PATH}\" \"${EXPORT_SETTINGS_PATH}\" ${HEADLESS}; scriptJob -idleEvent quit;"
65
+ fi
66
+
67
+ exit 0
0 commit comments