Skip to content

Commit 26b5a3f

Browse files
committed
code review fix
-update install_maya_plugin.sh -add check that optionVar exists
1 parent ebc0a51 commit 26b5a3f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Assets/Integrations/Autodesk/maya/scripts/install_maya_plugin.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ else
5858
# Configure Maya Integration
5959
TEMP_SAVE_PATH="_safe_to_delete"
6060
EXPORT_SETTINGS_PATH="Integrations/Autodesk/maya/scripts/unityFbxExportSettings.mel"
61+
MAYA_INSTRUCTION_PATH="_safe_to_delete/_temp.txt"
6162
HEADLESS=1
6263

6364
# NOTE: we need start Maya in UI mode so that we can correctly configure the auto-load of the plugin.
64-
"${MAYA_PATH}" -command "configureUnityOneClick \"${PROJECT_PATH}\" \"${UNITY_EDITOR_PATH}\" \"${TEMP_SAVE_PATH}\" \"${EXPORT_SETTINGS_PATH}\" ${HEADLESS}; scriptJob -idleEvent quit;"
65+
"${MAYA_PATH}" -command "configureUnityOneClick \"${PROJECT_PATH}\" \"${UNITY_EDITOR_PATH}\" \"${TEMP_SAVE_PATH}\" \"${EXPORT_SETTINGS_PATH}\" \"${MAYA_INSTRUCTION_PATH}\" ${HEADLESS}; scriptJob -idleEvent quit;"
6566
fi
6667

6768
exit 0

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ def doIt(self, args):
270270
unityProjectPath = maya.cmds.optionVar(q='UnityProject')
271271
unityTempSavePath = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityTempSavePath'))
272272
unityCommand = "FbxExporters.Review.TurnTable.LastSavedModel"
273-
instructionFile = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityInstructionPath'))
273+
if maya.cmds.optionVar(exists='UnityInstructionPath'):
274+
instructionFile = os.path.join(unityProjectPath, "Assets", maya.cmds.optionVar(q='UnityInstructionPath'))
275+
else:
276+
self.displayError("Missing Unity instruction file path, please re-install integration.")
277+
return
274278

275279
if not self.loadUnityFbxExportSettings():
276280
return

0 commit comments

Comments
 (0)