Skip to content

Commit 9c2ca8c

Browse files
committed
pass save path to Maya
1 parent 465ef8d commit 9c2ca8c

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Integrations
2525
#endif
2626

2727
private static string MAYA_COMMANDS { get {
28-
return string.Format("configureUnityOneClick {3}{0}{3} {3}{1}{3} {2}; scriptJob -idleEvent quit;",
29-
GetProjectPath(), GetAppPath(), (IsHeadlessInstall()?1:0), ESCAPED_QUOTE);
28+
return string.Format("configureUnityOneClick {4}{0}{4} {4}{1}{4} {4}{2}{4} {3}; scriptJob -idleEvent quit;",
29+
GetProjectPath(), GetAppPath(), GetTempSavePath(), (IsHeadlessInstall()?1:0), ESCAPED_QUOTE);
3030
}}
3131
private static Char[] FIELD_SEPARATORS = new Char[] {':'};
3232

@@ -111,6 +111,11 @@ private static string GetPackagePath()
111111
return System.IO.Path.Combine(Application.dataPath, PACKAGE_NAME);
112112
}
113113

114+
private static string GetTempSavePath()
115+
{
116+
return Application.dataPath + "/" + FbxExporters.Review.TurnTable.TempSavePath;
117+
}
118+
114119
private static string GetPackageVersion()
115120
{
116121
string result = null;

Assets/Integrations/Autodesk/maya2017/scripts/configureUnityOneClick.mel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
global proc configureUnityOneClick(string $unityProject, string $unityApp, int $headless)
1+
global proc configureUnityOneClick(string $unityProject, string $unityApp, string $unityTempSavePath, int $headless)
22
{
33
// configure plugin settings
44
optionVar -stringValue "UnityApp" $unityApp;
55
optionVar -stringValue "UnityProject" $unityProject;
6+
optionVar -stringValue "UnityTempSavePath" $unityTempSavePath;
67
optionVar -intValue "UnityOneClick_Headless" $headless;
78

89
// configure auto load of plugin

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ def doIt(self, args):
129129

130130
unityAppPath = maya.cmds.optionVar(q='UnityApp')
131131
unityProjectPath = maya.cmds.optionVar(q='UnityProject')
132+
unityTempSavePath = maya.cmds.optionVar(q='UnityTempSavePath')
132133
unityCommand = "FbxExporters.Review.TurnTable.LastSavedModel"
133134

134135
# make sure the GamePipeline and fbxmaya plugins are loaded
135136
if self.loadDependencies() and self.loadPlugin('fbxmaya.mll'):
136137
# save fbx to Assets/_safe_to_delete/
137-
savePath = "{0}/Assets/_safe_to_delete".format(unityProjectPath)
138+
savePath = unityTempSavePath
138139
maya.cmds.sysFile(savePath, makeDir=True)
139140
savePath = savePath + "/TurnTableModel.fbx"
140141
maya.mel.eval(r'file -force -options "" -typ "FBX export" -pr -es "{0}"'.format(savePath));

0 commit comments

Comments
 (0)