Skip to content

Commit ed81925

Browse files
authored
Merge pull request #87 from Unity-Technologies/UNI-23241-publish-to-temp-location
Uni 23241 review command publishes to temp location
2 parents 4283df6 + 3117fe3 commit ed81925

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-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 {0}{1}{0} {0}{2}{0} {0}{3}{0} {4}; scriptJob -idleEvent quit;",
29+
ESCAPED_QUOTE, GetProjectPath(), GetAppPath(), GetTempSavePath(), (IsHeadlessInstall()?1:0));
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+
public static string GetTempSavePath()
115+
{
116+
return System.IO.Path.Combine(Application.dataPath, FbxExporters.Review.TurnTable.TempSavePath).Replace("\\", "/");
117+
}
118+
114119
private static string GetPackageVersion()
115120
{
116121
string result = null;

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class TurnTable
1212
const string ScenesPath = "Assets";
1313
const string SceneName = "FbxExporters_TurnTableReview";
1414

15+
public const string TempSavePath = "_safe_to_delete";
16+
1517
static string LastFilePath = null;
1618
static Object LastModel = null;
1719

@@ -50,7 +52,7 @@ private static string GetSceneFilePath ()
5052

5153
private static string GetLastSavedFilePath ()
5254
{
53-
string modelPath = FbxExporters.EditorTools.ExportSettings.GetAbsoluteSavePath ();
55+
string modelPath = FbxExporters.Integrations.GetTempSavePath ();
5456
System.IO.FileInfo fileInfo = GetLastSavedFile (modelPath);
5557

5658
return (fileInfo != null) ? fileInfo.FullName : 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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,17 @@ 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

135+
# make sure the GamePipeline and fbxmaya plugins are loaded
136+
if self.loadDependencies() and self.loadPlugin('fbxmaya.mll'):
137+
# save fbx to Assets/_safe_to_delete/
138+
savePath = unityTempSavePath
139+
maya.cmds.sysFile(savePath, makeDir=True)
140+
savePath = savePath + "/TurnTableModel.fbx"
141+
maya.mel.eval(r'file -force -options "" -typ "FBX export" -pr -es "{0}"'.format(savePath));
142+
134143
if maya.cmds.about(macOS=True):
135144
# Use 'open -a' to bring app to front if it has already been started.
136145
# Note that the unity command will not get called.

0 commit comments

Comments
 (0)