Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMSUSD-550 - Disable Material section when Mesh type is excluded from export #3421

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 21 additions & 22 deletions plugin/adsk/scripts/mayaUsdTranslatorExport.mel
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ global proc mayaUsdTranslatorExport_MeshCB() {
return;

columnLayout -e -enable (`checkBoxGrp -q -v1 exportMeshesCheckBox` == 1) meshExportOptsCol;
columnLayout -e -enable (`checkBoxGrp -q -v1 exportMeshesCheckBox` == 1) materialOptsCol;
}

// Callback called when the animation frame layout is expanded.
Expand Down Expand Up @@ -488,10 +489,6 @@ global proc mayaUsdTranslatorExport_SetFromOptions(string $currentOptions, int $
mayaUsdTranslatorExport_SetCheckbox($optionBreakDown[1], $enable, "exportDisplayColorCheckBox");
} else if ($optionBreakDown[0] == "exportInstances") {
mayaUsdTranslatorExport_SetOptionMenuByBool($optionBreakDown[1], $enable, "exportInstancesPopup");
} else if($optionBreakDown[0] == "exportCameras"){
mayaUsdTranslatorExport_SetOptionMenuByBool($optionBreakDown[1], $enable, "exportInstancesPopup");
} else if($optionBreakDown[0] == "exportLights") {
mayaUsdTranslatorExport_SetOptionMenuByBool($optionBreakDown[1], $enable, "exportInstancesPopup");
Comment on lines -491 to -494
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why were these lines removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those lines are some debug code I used before and forgot to remove. They are totally useless now...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would they be useless. Someone can call this function adding those strings to the input options to control the starting value of these two export options.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no those flags are not longer available. Now we use excludeExportTypes flag, so it will be excludeExportTypes=[Cameras, Lights] like this. These two flags are abandoned. It's my fault I forgot to delete them here...

} else if ($optionBreakDown[0] == "exportVisibility") {
mayaUsdTranslatorExport_SetCheckbox($optionBreakDown[1], $enable, "exportVisibilityCheckBox");
} else if ($optionBreakDown[0] == "mergeTransformAndShape") {
Expand Down Expand Up @@ -721,24 +718,26 @@ global proc int mayaUsdTranslatorExport (string $parent,
int $collapse = stringArrayContains("materials", $collapsedSections) ? true : false;
frameLayout -label `getMayaUsdString("kExportFrameMaterialsLbl")` -collapsable true -collapse $collapse -ann `getMayaUsdString("kExportMaterialsAnn")` materialsFrameLayout;
separator -style "none";
string $conversions[] = `mayaUSDListShadingModes -export -useRegistryOnly`;
for ($conversion in $conversions) {
string $ann = `mayaUSDListShadingModes -ea $conversion -useRegistryOnly`;
string $opt = `mayaUSDListShadingModes -eo $conversion -useRegistryOnly`;
string $widgetName = $opt + "_ConvertMaterialsToCheckBox";

checkBoxGrp -cw 2 240 -numberOfCheckBoxes 1
-label "" -label1 $conversion -annotation $ann
$widgetName;
}

optionMenuGrp -l `getMayaUsdString("kExportRelativeTexturesLbl")` -annotation `getMayaUsdString("kExportRelativeTexturesAnn")` exportRelativeTexturesPopup;
// The annotation will be used to assign value to token exportRelativeTextures, so lower case is used
menuItem -l `getMayaUsdString("kExportRelativeTexturesAutomaticLbl")` -ann "automatic";
menuItem -l `getMayaUsdString("kExportRelativeTexturesAbsoluteLbl")` -ann "absolute";
menuItem -l `getMayaUsdString("kExportRelativeTexturesRelativeLbl")` -ann "relative";

separator -style "none";
columnLayout -width 100 materialOptsCol;
string $conversions[] = `mayaUSDListShadingModes -export -useRegistryOnly`;
for ($conversion in $conversions) {
string $ann = `mayaUSDListShadingModes -ea $conversion -useRegistryOnly`;
string $opt = `mayaUSDListShadingModes -eo $conversion -useRegistryOnly`;
string $widgetName = $opt + "_ConvertMaterialsToCheckBox";

checkBoxGrp -cw 2 240 -numberOfCheckBoxes 1
-label "" -label1 $conversion -annotation $ann
$widgetName;
}

optionMenuGrp -l `getMayaUsdString("kExportRelativeTexturesLbl")` -annotation `getMayaUsdString("kExportRelativeTexturesAnn")` exportRelativeTexturesPopup;
// The annotation will be used to assign value to token exportRelativeTextures, so lower case is used
menuItem -l `getMayaUsdString("kExportRelativeTexturesAutomaticLbl")` -ann "automatic";
menuItem -l `getMayaUsdString("kExportRelativeTexturesAbsoluteLbl")` -ann "absolute";
menuItem -l `getMayaUsdString("kExportRelativeTexturesRelativeLbl")` -ann "relative";

separator -style "none";
setParent ..;
setParent ..;
}

Expand Down