@@ -12,6 +12,7 @@ global string $unityImportLabel = "Import FBX file from Unity Project and auto-c
12
12
global string $unityExportLabel = "Export Model to Unity";
13
13
14
14
global string $unityCommandsFile = "unityCommands.mel";
15
+ global string $unityLoadCommandFiles;
15
16
global string $unityImportMenuName = "Import";
16
17
global string $unityExportMenuName = "Export";
17
18
global string $unityImportCommand = "unityImport";
@@ -23,17 +24,21 @@ global proc string unityWhatsNewVersion(){
23
24
}
24
25
25
26
global proc unitySetupUI(){
27
+ global string $unityLoadCommandFiles;
28
+ global string $unityCommandsFile;
26
29
27
30
$isHeadless = `optionVar -q "UnityFbxForMaya_Headless"`;
28
31
if($isHeadless){
29
32
// headless install, don't add UI
30
33
return;
31
34
}
32
-
35
+
36
+ $unityLoadCommandFiles = ("source " + $unityCommandsFile);
37
+
33
38
evalDeferred -lowestPriority "buildFileMenu; \
34
39
$parentMenu = $gMainFileMenu; \
35
40
$pluginVersion = unityWhatsNewVersion(); \
36
- source $unityCommandsFile ; \
41
+ eval ($unityLoadCommandFiles) ; \
37
42
menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider; \
38
43
menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName; \
39
44
menuItem -parent $unityMenuName -label $unityImportMenuName -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command $unityImportCommand; \
0 commit comments