Skip to content

Commit 0fab88e

Browse files
authored
Merge pull request #143 from Unity-Technologies/Uni-25369-cmdline-installer
Uni-25369-update-cmdline-installation-instructions
2 parents 79daa78 + 0645aed commit 0fab88e

File tree

4 files changed

+76
-46
lines changed

4 files changed

+76
-46
lines changed

Assets/FbxExporters/README.txt

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,53 +14,14 @@ Requirements
1414
Installing Maya Integration
1515
--------------------------------------------
1616

17-
The easy way to install the Maya integration is with the
18-
FbxExporters -> Install Maya Integration
19-
menu option in Unity.
17+
The easiest way to install the Maya integration is from the menu option in Unity.
2018

21-
It uses the most recent version of Maya it can find. Set your MAYA_LOCATION
22-
environment before running Unity if you want to specify a particular version of Maya.
19+
FbxExporters -> Install Maya Integration
2320

21+
This menu item locates and uses the most recent version of Maya installed. If you want
22+
to specify a custom version or location then set your MAYA_LOCATION environment
23+
before running Unity.
2424

2525
Alternately, you can install the package and integrations from the command-line
26-
using the following script:
27-
28-
29-
MacOS:
30-
31-
# Configure where Unity is installed
32-
if [ ! -d "${UNITY3D_PATH}" ]; then
33-
UNITY3D_PATH="/Applications/Unity/Unity.app"
34-
fi
35-
36-
# Configure which Unity project to install package
37-
if [ ! -d "${PROJECT_PATH}" ]; then
38-
PROJECT_PATH=~/Development/FbxExporters
39-
fi
40-
41-
# Configure where unitypackage is located
42-
if [ ! -f "${PACKAGE_PATH}" ]; then
43-
PACKAGE_PATH=`ls -t ${PROJECT_PATH}/FbxExporters_*.unitypackage | head -1`
44-
fi
45-
46-
# Configuring Maya2017 to auto-load integration
47-
if [ ! -d "${MAYA_LOCATION}" ] ; then
48-
MAYA_LOCATION=/Applications/Autodesk/maya2017/Maya.app
49-
fi
50-
export MAYA_LOCATION
51-
52-
if [ ! -d "${UNITY3D_PATH}" ]; then
53-
echo "Unity is not installed"
54-
elif [ ! -d "${MAYA_LOCATION}" ] ; then
55-
echo "Maya is not installed"
56-
else
57-
# Install FbxExporters package
58-
"${UNITY3D_PATH}/Contents/MacOS/Unity" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
59-
60-
# Install Maya Integration. Requires MAYA_LOCATION.
61-
"${UNITY3D_PATH}/Contents/MacOS/Unity" -batchMode -projectPath "${PROJECT_PATH}" -executeMethod FbxExporters.Integrations.InstallMaya -quit
62-
63-
# To configure without user interface change the last argument to 1 instead of 0
64-
"${MAYA_LOCATION}/Contents/MacOS/Maya" -command "configureUnityOneClick \"${PROJECT_PATH}\" \"${UNITY3D_PATH}\" 0; scriptJob -idleEvent quit;"
65-
fi
66-
26+
using a script, an example of which can be found in the scripts folder of the
27+
Maya integration. The version for OSX is called install_maya_plugin.sh.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#! /bin/sh
2+
########################################################################
3+
# Copyright (c) 2017 Unity Technologies. All rights reserved.
4+
# NOTICE: All information contained herein is, and remains
5+
# the property of Unity Technologies Aps. and its suppliers,
6+
# if any. The intellectual and technical concepts contained
7+
# herein are proprietary to Unity Technologies Aps. and its
8+
# suppliers and may be covered by Canadian, U.S. and/or
9+
# Foreign Patents, patents in process, and are protected
10+
# by trade secret or copyright law. Dissemination of this
11+
# information or reproduction of this material is strictly
12+
# forbidden unless prior written permission is obtained from
13+
# Unity Technologies Aps.
14+
#
15+
########################################################################
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

Assets/Integrations/Autodesk/maya/scripts/unityOneClick/commands.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class BaseCommand(OpenMayaMPx.MPxCommand, LoggerMixin):
3939
Base class for UnityOneClick Plugin Commands.
4040
"""
4141
kDefaultIcon = 'unity_100.png'
42+
kFamilyLabel = "The UnityOneClick plugin allows you to reliably exchange and review your work between Maya and Unity."
4243

4344
def __init__(self):
4445
OpenMayaMPx.MPxCommand.__init__(self)

Assets/Integrations/Autodesk/maya/scripts/unityOneClick/ui.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def installMenu():
8585
image=commands.importCmd.familyIconPath(),
8686
subMenu=True,
8787
label=kMenuLabel,
88+
annotation=commands.importCmd.kFamilyLabel,
8889
tearOff=True,
8990
version=whatsNewVersion())
9091

0 commit comments

Comments
 (0)