Skip to content

Commit 45846c6

Browse files
committed
code review fixes
-use os.path.join -remove commented out code -added comment to function
1 parent 9767db8 commit 45846c6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ private static string GetSceneFilePath ()
5959
return System.IO.Path.Combine (DefaultScenesPath, DefaultSceneName + ".unity");
6060
}
6161

62+
/// <summary>
63+
/// Gets the last saved file path as a Unity-style (only forward slashes)
64+
/// absolute path.
65+
/// </summary>
66+
/// <returns>The last saved file path.</returns>
6267
private static string GetLastSavedFilePath ()
6368
{
6469
string modelPath = Application.dataPath + "/" + TempSavePath;

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def loadUnityFbxExportSettings(self):
6565
Load the Export Settings from file
6666
"""
6767
projectPath = maya.cmds.optionVar(q="UnityProject")
68-
fileName = "{0}/Assets/{1}".format(projectPath, maya.cmds.optionVar(q="UnityFbxExportSettings"))
68+
fileName = os.path.join(projectPath,"Assets", maya.cmds.optionVar(q="UnityFbxExportSettings"))
6969
if not os.path.isfile(fileName):
7070
maya.cmds.error("Failed to find Unity Fbx Export Settings at: {0}".format(fileName))
7171
return False
@@ -231,7 +231,7 @@ def doIt(self, args):
231231

232232
unityAppPath = maya.cmds.optionVar(q='UnityApp')
233233
unityProjectPath = maya.cmds.optionVar(q='UnityProject')
234-
unityTempSavePath = "{0}/Assets/{1}".format(unityProjectPath, maya.cmds.optionVar(q='UnityTempSavePath'))
234+
unityTempSavePath = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityTempSavePath'))
235235
unityCommand = "FbxExporters.Review.TurnTable.LastSavedModel"
236236

237237
if not self.loadUnityFbxExportSettings():
@@ -249,8 +249,10 @@ def doIt(self, args):
249249
# save fbx to Assets/_safe_to_delete/
250250
savePath = unityTempSavePath
251251
maya.cmds.sysFile(savePath, makeDir=True)
252-
savePath = savePath + "/TurnTableModel.fbx"
253-
maya.mel.eval(r'file -force -options "" -typ "FBX export" -pr -es "{0}"'.format(savePath));
252+
savePath = os.path.join(savePath, "TurnTableModel.fbx")
253+
savePath = os.path.abspath(savePath)
254+
255+
maya.cmds.file(savePath, force=True, options="", typ="FBX export", pr=True, es=True)
254256

255257
if maya.cmds.about(macOS=True):
256258
# Use 'open -a' to bring app to front if it has already been started.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def installMenu():
5959
maya.cmds.menuItem(parent=kMainWndMenuName, label=commands.importCmd.kShortLabel, command=commands.importCmd.kScriptCommand) # @UndefinedVariable
6060
maya.cmds.menuItem(parent=kMainWndMenuName, label=commands.reviewCmd.kShortLabel, command=commands.reviewCmd.kScriptCommand) # @UndefinedVariable
6161
maya.cmds.menuItem(parent=kMainWndMenuName, label=commands.publishCmd.kShortLabel, command=commands.publishCmd.kScriptCommand) # @UndefinedVariable
62-
#maya.cmds.menuItem(parent=kMainWndMenuName, label=commands.configureCmd.kShortLabel, command=commands.configureCmd.kScriptCommand) # @UndefinedVariable
6362

6463
def uninstallMenu():
6564
"""

0 commit comments

Comments
 (0)