// =========================================================================== // 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: 17 June 1997 // // // Description: // This implements the Shading Marking Menu. // global proc doShadingMenuStyle(string $mode, int $isActiveOnly) { string $currPanel = `getPanel -withFocus`; if ("" != $currPanel && ("modelPanel" == `getPanel -to $currPanel`)) { modelEditor -e -da $mode -ao $isActiveOnly $currPanel; switch ($mode) { case "boundingBox": case "points": case "wireframe": modelEditor -e -displayLights "default" -displayTextures off $currPanel; break; } } } global proc buildShadingMM() // // Creates a marking menu that allows the user // to select shading modes. It reuses // the name tempMM for the name of the menu, to // ensure that there's only one of these at // any one time. { if( `popupMenu -exists tempMM` ) { deleteUI tempMM; } popupMenu -mm 1 -b 1 -aob 1 -p `findPanelPopupParent` tempMM; menuItem -rp "N" -label (uiRes("m_buildShadingMM.kPoints")) -c ("doShadingMenuStyle \"points\" 0"); menuItem -rp "NE" -label (uiRes("m_buildShadingMM.kSmoothShadedActive")) -c ("doShadingMenuStyle \"smoothShaded\" 1"); menuItem -rp "E" -label (uiRes("m_buildShadingMM.kSmoothShaded")) -c ("doShadingMenuStyle \"smoothShaded\" 0"); menuItem -rp "SE" -label (uiRes("m_buildShadingMM.kFlatShaded")) -c ("doShadingMenuStyle \"flatShaded\" 0"); menuItem -rp "S" -label (uiRes("m_buildShadingMM.kFlatShadedActive")) -c ("doShadingMenuStyle \"flatShaded\" 1"); menuItem -rp "SW" -label (uiRes("m_buildShadingMM.kBoundingBox")) -c ("doShadingMenuStyle \"boundingBox\" 0"); menuItem -rp "W" -label (uiRes("m_buildShadingMM.kWireframe")) -c ("doShadingMenuStyle \"wireframe\" 0"); setParent -m ..; }