Skip to content

Commit

Permalink
EMSUSD-772 - Fixes Edit-As-Maya Option Dialog Not Executing Action
Browse files Browse the repository at this point in the history
EMSUSD-772 - Fixes Edit-As-Maya Option Dialog Not Executing Action
EMSUSD-740 - Updates the "Apply" button's logic to conform with the new design. It should also execute the action.
  • Loading branch information
AramAzhari-adsk committed Oct 30, 2023
1 parent 179a79d commit 27788b4
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions plugin/adsk/scripts/USDMenuProc.mel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ proc string expandToSelection(string $obj)
}
}

global proc mayaUsdMenu_editAsMaya(string $obj)
{
if (!hasPrimUpdater())
return;

if (size($obj) != 0) {
mayaUsdEditAsMaya $obj;
}
}

global proc mayaUsdMenu_EditAsMayaDataOptionsCallback(string $optionsString)
{
optionVar -stringValue usdMaya_EditAsMayaDataOptions $optionsString;
Expand All @@ -35,10 +45,14 @@ global proc mayaUsdMenu_EditAsMayaDataOptionsReset(string $obj)
mayaUsdMenu_EditAsMayaDataOptions($obj);
}

global proc mayaUsdMenu_ApplyEditAsMayaDataOptions(string $obj)
global proc mayaUsdMenu_ApplyEditAsMayaDataOptions(string $obj, int $closeDialog)
{
mayaUsdTranslatorImport ("", "query", "", "mayaUsdMenu_EditAsMayaDataOptionsCallback");

if ($closeDialog) {
hideOptionBox;
}

if (size($obj)) {
waitCursor -state 1;
mayaUsdMenu_editAsMaya $obj;
Expand All @@ -65,12 +79,12 @@ global proc mayaUsdMenu_EditAsMayaDataOptions(string $obj)

string $applyCloseBtn = getOptionBoxApplyAndCloseBtn();
button -edit -label `getMayaUsdString("kEditAsMayaData")`
-command ("mayaUsdMenu_ApplyEditAsMayaDataOptions(\"" + $obj + "\");")
-command ("mayaUsdMenu_ApplyEditAsMayaDataOptions(\"" + $obj + "\", 1);")
$applyCloseBtn;

string $applyBtn = getOptionBoxApplyBtn();
button -edit
-command ("mayaUsdMenu_ApplyEditAsMayaDataOptions(\"\");")
-command ("mayaUsdMenu_ApplyEditAsMayaDataOptions(\"" + $obj + "\", 0);")
$applyBtn;

string $resetBtn = getOptionBoxResetBtn();
Expand Down

0 comments on commit 27788b4

Please sign in to comment.