Skip to content

Commit 3ce2291

Browse files
committed
Uni-21772 configure unity project location
1 parent 1888b33 commit 3ce2291

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static string GetModuleTemplatePath(string version)
5050
return result.Replace(VERSION_TAG,version);
5151
}
5252

53-
private static string GetProjectPath()
53+
public static string GetProjectPath()
5454
{
5555
return System.IO.Directory.GetParent(Application.dataPath).FullName;
5656
}
@@ -299,7 +299,8 @@ public static void OnMenuItem ()
299299
if (Integrations.InstallMaya(Integrations.MAYA_VERSION, true, false))
300300
{
301301
string title = string.Format("Completed installation of Maya {0} Integration.", Integrations.MAYA_VERSION);
302-
string message = "Please run the following MEL commands to configure auto-loading of the plugin in Maya.\n\nloadPlugin unityOneClickPlugin; pluginInfo -edit -autoload true unityOneClickPlugin;\n";
302+
string commands = string.Format("optionVar -stringValue \"UnityProject\" \"{0}\"; loadPlugin unityOneClickPlugin; pluginInfo -edit -autoload true unityOneClickPlugin;",Integrations.GetProjectPath());
303+
string message = string.Format("Please run the following MEL commands to configure auto-loading of the plugin in Maya.\n\n{0}\n", commands);
303304

304305
EditorUtility.DisplayDialog (title, message, "Ok");
305306
Debug.Log(message);

Assets/FbxExporters/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ else
3636
"${UNITY3D_PATH}" -projectPath "${PROJECT_PATH}" -importPackage ${PACKAGE_PATH} -quit
3737

3838
# Install Maya2017 Integration
39-
# Use "InstallMaya2017CommandsOnly" to install without UI
4039
"${UNITY3D_PATH}" -batchMode -projectPath "${PROJECT_PATH}" -executeMethod FbxExporters.Integrations.InstallMaya2017 -quit
4140

4241
# Configuring Maya2017 to auto-load integration
@@ -45,7 +44,8 @@ else
4544
if [ ! -f "${MAYA_PATH}" ]; then
4645
echo "Maya2017 not installed"
4746
else
48-
"${MAYA_PATH}" -command "loadPlugin unityOneClickPlugin; pluginInfo -edit -autoload true unityOneClickPlugin; quit;"
47+
# To configure without user interface prepend the following command: optionVar -intValue \"UnityOneClick_Headless\" 1;
48+
"${MAYA_PATH}" -command "optionVar -stringValue \"UnityProject\" \"${PROJECT_PATH}\"; loadPlugin unityOneClickPlugin; pluginInfo -edit -autoload true unityOneClickPlugin; quit;"
4949
fi
5050
fi
5151

0 commit comments

Comments
 (0)