Skip to content

Commit edcd868

Browse files
author
Benoit Hudson
committed
Update docs and make the script work again.
1 parent f0135bc commit edcd868

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,17 @@ public static int ConfigureMaya(MayaVersion version)
368368
return ExitCode;
369369
}
370370

371-
public static bool InstallMaya(MayaVersion version, bool verbose = true)
371+
public static bool InstallMaya(MayaVersion version = null, bool verbose = false)
372372
{
373373
// What's happening here is that we copy the module template to
374374
// the module path, basically:
375375
// - copy the template to the user Maya module path
376376
// - search-and-replace its tags
377377
// - done.
378378
// But it's complicated because we can't trust any files actually exist.
379+
if (version == null) {
380+
version = new MayaVersion();
381+
}
379382

380383
string moduleTemplatePath = GetModuleTemplatePath(version.Version);
381384
if (!System.IO.File.Exists(moduleTemplatePath))

Assets/FbxExporters/README.txt

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,26 @@ Requirements
1111

1212
* [FBX SDK C# Bindings](https://github.com/Unity-Technologies/FbxSharp)
1313

14-
Command-line Installing Maya2017 Integration
14+
Installing Maya Integration
1515
--------------------------------------------
1616

17-
You can install the package and integrations from the command-line using the following script:
17+
The easy way to install the Maya integration is with the
18+
FbxExporters -> Install Maya Integration
19+
menu option in Unity.
20+
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.
23+
24+
25+
Alternately, you can install the package and integrations from the command-line
26+
using the following script:
27+
1828

1929
MacOS:
2030

2131
# Configure where Unity is installed
22-
if [ ! -f "${UNITY3D_PATH}" ]; then
23-
UNITY3D_PATH="/Applications/Unity/Unity.app/Contents/MacOS/Unity"
32+
if [ ! -d "${UNITY3D_PATH}" ]; then
33+
UNITY3D_PATH="/Applications/Unity/Unity.app"
2434
fi
2535

2636
# Configure which Unity project to install package
@@ -33,23 +43,24 @@ if [ ! -f "${PACKAGE_PATH}" ]; then
3343
PACKAGE_PATH=`ls -t ${PROJECT_PATH}/FbxExporters_*.unitypackage | head -1`
3444
fi
3545

36-
if [ ! -f "${UNITY3D_PATH}" ]; then
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
3753
echo "Unity is not installed"
54+
elif [ ! -d "${MAYA_LOCATION}" ] ; then
55+
echo "Maya is not installed"
3856
else
3957
# Install FbxExporters package
40-
"${UNITY3D_PATH}" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
41-
42-
# Install Maya2017 Integration
43-
"${UNITY3D_PATH}" -batchMode -projectPath "${PROJECT_PATH}" -executeMethod FbxExporters.Integrations.InstallMaya2017 -quit
58+
"${UNITY3D_PATH}/Contents/MacOS/Unity" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
4459

45-
# Configuring Maya2017 to auto-load integration
46-
MAYA_PATH=/Applications/Autodesk/maya2017/Maya.app/Contents/bin/maya
60+
# Install Maya Integration. Requires MAYA_LOCATION.
61+
"${UNITY3D_PATH}/Contents/MacOS/Unity" -batchMode -projectPath "${PROJECT_PATH}" -executeMethod FbxExporters.Integrations.InstallMaya -quit
4762

48-
if [ ! -f "${MAYA_PATH}" ]; then
49-
echo "Maya2017 not installed"
50-
else
51-
# To configure without user interface change the last argument to 1 instead of 0
52-
"${MAYA_PATH}" -command "configureUnityOneClick \"${PROJECT_PATH}\" \"${UNITY3D_PATH}\" 0; scriptJob -idleEvent quit;"
53-
fi
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;"
5465
fi
5566

0 commit comments

Comments
 (0)