Skip to content

Commit ed29910

Browse files
author
AJubrey
committed
[CHANGED] the commands file now delays the hiding of the menu until after everything is loaded, such that it doesn't attempt to hide the menu before it exists
1 parent 099c81d commit ed29910

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Assets/Integrations/Autodesk/maya/scripts/unityCommands.mel

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ global string $UnityExportSet = "UnityFbxExportSet";
22
global string $UnityFbxFilePathAttr = "unityFbxFilePath";
33
global string $UnityFbxFileNameAttr = "unityFbxFileName";
44

5+
global proc removeNativeMenuOnLoad(){
6+
$removeSendToUnityMenu = `optionVar -q "UnityFbxForMaya_removeSendToUnityMenu"`;
7+
if($removeSendToUnityMenu && `menu -exists "sendToUnityMenu"`){
8+
//Remove the GamePipeline 'SendToUnity' button
9+
menu -e -visible false "sendToUnityMenu";
10+
}
11+
}
12+
513
// Load a specified settings file
614
proc int loadUnityFbxSettings(string $fileName, string $settingType){
715
// check if the file exists
@@ -49,7 +57,6 @@ proc int setExists(string $setName){
4957
return stringArrayContains($setName, `listSets -allSets`);
5058
}
5159

52-
5360
proc int loadUnityPlugin(string $plugin){
5461
if (`pluginInfo -q -loaded $plugin` == false){
5562
loadPlugin $plugin;
@@ -77,11 +84,7 @@ proc int loadUnityDependencies(){
7784
$result = $result && `loadUnityPlugin ($plugin + "." + $ext)`;
7885
}
7986

80-
$removeSendToUnityMenu = `optionVar -q "UnityFbxForMaya_removeSendToUnityMenu"`;
81-
if($removeSendToUnityMenu && `menu -exists "sendToUnityMenu"`){
82-
//Remove the GamePipeline 'SendToUnity' button
83-
menu -e -visible false "sendToUnityMenu";
84-
}
87+
evalDeferred -low "removeNativeMenuOnLoad";
8588

8689
return $result;
8790
}

0 commit comments

Comments
 (0)