@@ -12,7 +12,6 @@ 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;
16
15
global string $unityImportMenuName = "Import";
17
16
global string $unityExportMenuName = "Export";
18
17
global string $unityImportCommand = "unityImport";
@@ -24,23 +23,43 @@ global proc string unityWhatsNewVersion(){
24
23
}
25
24
26
25
global proc unitySetupUI(){
27
- global string $unityLoadCommandFiles;
28
- global string $unityCommandsFile;
29
-
30
26
$isHeadless = `optionVar -q "UnityFbxForMaya_Headless"`;
31
27
if($isHeadless){
32
28
// headless install, don't add UI
33
29
return;
34
30
}
35
31
36
- $unityLoadCommandFiles = ("source " + $unityCommandsFile);
32
+ evalDeferred -lowestPriority "unityInstallUI";
33
+ }
34
+
35
+ global proc unityInstallUI(){
36
+ global string $unityMenuName;
37
+ global string $unityMenuDivider;
38
+ global string $unityMenuLabel;
39
+ global string $unityMenuInsertAfter;
40
+
41
+ global string $unityImportIconPath;
42
+ global string $unityExportIconPath;
43
+ global string $unityIconPath;
44
+
45
+ global string $unityFamilyLabel;
46
+ global string $unityImportLabel;
47
+ global string $unityExportLabel;
48
+
49
+ global string $unityCommandsFile;
50
+ global string $unityImportMenuName;
51
+ global string $unityExportMenuName;
52
+ global string $unityImportCommand;
53
+ global string $unityExportCommand;
37
54
38
- evalDeferred -lowestPriority "buildFileMenu; \
39
- $parentMenu = $gMainFileMenu; \
40
- $pluginVersion = unityWhatsNewVersion(); \
41
- eval ($unityLoadCommandFiles); \
42
- menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider; \
43
- menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName; \
44
- menuItem -parent $unityMenuName -label $unityImportMenuName -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command $unityImportCommand; \
45
- menuItem -parent $unityMenuName -label $unityExportMenuName -version $pluginVersion -image $unityExportIconPath -annotation $unityExportLabel -command $unityExportCommand;";
55
+ global string $gMainFileMenu;
56
+
57
+ buildFileMenu;
58
+ $parentMenu = $gMainFileMenu;
59
+ $pluginVersion = unityWhatsNewVersion();
60
+ eval ("source " + $unityCommandsFile);
61
+ menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider;
62
+ menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName;
63
+ menuItem -parent $unityMenuName -label $unityImportMenuName -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command $unityImportCommand;
64
+ menuItem -parent $unityMenuName -label $unityExportMenuName -version $pluginVersion -image $unityExportIconPath -annotation $unityExportLabel -command $unityExportCommand;
46
65
}
0 commit comments