Skip to content

Commit bf43ff2

Browse files
committed
use eval to run "source"
- can't pass source a variable, have to call it with eval
1 parent 07073b8 commit bf43ff2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ global string $unityImportLabel = "Import FBX file from Unity Project and auto-c
1212
global string $unityExportLabel = "Export Model to Unity";
1313

1414
global string $unityCommandsFile = "unityCommands.mel";
15+
global string $unityLoadCommandFiles;
1516
global string $unityImportMenuName = "Import";
1617
global string $unityExportMenuName = "Export";
1718
global string $unityImportCommand = "unityImport";
@@ -23,17 +24,21 @@ global proc string unityWhatsNewVersion(){
2324
}
2425

2526
global proc unitySetupUI(){
27+
global string $unityLoadCommandFiles;
28+
global string $unityCommandsFile;
2629

2730
$isHeadless = `optionVar -q "UnityFbxForMaya_Headless"`;
2831
if($isHeadless){
2932
// headless install, don't add UI
3033
return;
3134
}
32-
35+
36+
$unityLoadCommandFiles = ("source " + $unityCommandsFile);
37+
3338
evalDeferred -lowestPriority "buildFileMenu; \
3439
$parentMenu = $gMainFileMenu; \
3540
$pluginVersion = unityWhatsNewVersion(); \
36-
source $unityCommandsFile; \
41+
eval ($unityLoadCommandFiles); \
3742
menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider; \
3843
menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName; \
3944
menuItem -parent $unityMenuName -label $unityImportMenuName -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command $unityImportCommand; \

0 commit comments

Comments
 (0)