// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Creation Date: April 21 1997 // // // // // // string[] getMayaPanelTypes (int $isScripted) // // // This proc returns available panel types for Maya. It will // filter any unwanted types from all of the available types. // // // int $isScripted - If 1 then return a list of scripted panels. // // // string[]: List of panel types // // // getMayaPanelTypes(0); // // Result:devicePanel hardwareRenderPanel blendShapePanel outlinerPanel modelPanel// // // getMayaPanelTypes(1); // // Result:blindDataEditor componentEditorPanel dopeSheetPanel dynPaintScriptedPanelType dynRelEdPanel graphEditor hyperGraphPanel hyperShadePanel multiListerPanel polySelectionConstraintPanel polyTexturePlacementPanel referenceEditorPanel relationshipPanel renderWindowPanel scriptEditorPanel setEditor shadingGroupEditor visorPanel// // // global proc string[] getMayaPanelTypes (int $isScripted ) { string $retTypes[]; string $types[]; string $type; int $count; if ($isScripted) { $types = `getPanel -ast`; } else { string $tmpTypes[]; $tmpTypes = `getPanel -at`; // Remove hyperPanel and dynRelEdPanel from this list. They will // appear in the scriptedPanel list, and we don't want them to // appear twice. Anyhow, this panel type for these panels is obsolete // and not used, but can't be removed from the code for backward // compatibility reasons. // $count = 0; for ($type in $tmpTypes) { // QT_TODO: if Device Editor panel is ported, // remove the test for devicePanel once that editor is working // testPanelEditor fails when devicePanel is disabled if ("hyperPanel" == $type || "dynRelEdPanel" == $type || "hardwareRenderPanel" == $type || "devicePanel" == $type || "`blendShapePanel" == $type) { continue; } $types[$count++] = $type; } } // Now remove the non desired types from the list. // $count = 0; for ($type in $types) { if(`scriptedPanelType -q -exists $type`) { if(`scriptedPanelType -q -obsolete $type`) { continue; // Skip obsolete scripted panels } } if ( "lightListPanel" == $type || "rendRelPanel" == $type) { continue; } $retTypes[$count++] = $type; } return $retTypes; }