From 05078cf95bddd5cf4b287a74142ded349b0e4458 Mon Sep 17 00:00:00 2001 From: Pierre Baillargeon Date: Wed, 10 Apr 2024 13:59:54 -0400 Subject: [PATCH] EMSUSD-1187 disable root prim type UI When there is no custom root prim name entered, disable the root prim type drop-down button. Also, don't add the empty root prim name to the available root prims. --- .../adsk/scripts/mayaUsdTranslatorExport.mel | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/plugin/adsk/scripts/mayaUsdTranslatorExport.mel b/plugin/adsk/scripts/mayaUsdTranslatorExport.mel index 09ee5d4e84..bb80aa63cb 100644 --- a/plugin/adsk/scripts/mayaUsdTranslatorExport.mel +++ b/plugin/adsk/scripts/mayaUsdTranslatorExport.mel @@ -249,22 +249,38 @@ global proc mayaUsdTranslatorExport_updateDefaultPrimList() { } -global proc mayaUsdTranslatorExport_RootPrimCB() { +proc updateDefaultPrimOptionMenu(string $rootPrim) { if (`optionMenuGrp -exists exportDefaultPrim` == 0){ return; } - string $rootPrim = `textFieldGrp -q -text rootPrimField`; optionMenuGrp -edit -deleteAllItems exportDefaultPrim; string $menuName = `optionMenuGrp -q -fullPathName exportDefaultPrim`; menuItem -parent ($menuName + "|OptionMenu") -l `getMayaUsdString("kExportDefaultPrimNoneLbl")`; - menuItem -parent ($menuName + "|OptionMenu") -l $rootPrim; if(size($rootPrim) > 0){ + menuItem -parent ($menuName + "|OptionMenu") -l $rootPrim; optionMenuGrp -e -select 2 exportDefaultPrim; } else { mayaUsdTranslatorExport_updateDefaultPrimList(); } } +proc updateRootPrimTypeOptionMenu(string $rootPrim) { + if (`optionMenuGrp -exists rootPrimTypePopup` == 0){ + return; + } + if(size($rootPrim) > 0) { + optionMenuGrp -e -enable 1 rootPrimTypePopup; + } else { + optionMenuGrp -e -enable 0 rootPrimTypePopup; + } +} + +global proc mayaUsdTranslatorExport_RootPrimCB() { + string $rootPrim = `textFieldGrp -q -text rootPrimField`; + updateDefaultPrimOptionMenu($rootPrim); + updateRootPrimTypeOptionMenu($rootPrim); +} + global proc mayaUsdTranslatorExport_AnimationCB() { if (`checkBoxGrp -exists animationCheckBox` == 0) return;