// =========================================================================== // 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. // =========================================================================== global proc commonSelectionConstraintsOptionsPopup() { int $mtkEnable = (`pluginInfo -q -loaded "modelingToolkit"`); string $tranCon = `xformConstraint -q -type`; menuItem -version 2015 -enable $mtkEnable -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kSelConstraintsLabel")) -subMenu 1; radioMenuItemCollection; int $bp = `polySelectConstraint -q -bp`; int $sh = `polySelectConstraint -q -sh`; int $ap = `polySelectConstraint -q -ap`; int $el = `polySelectConstraint -q -lp`; int $er = `polySelectConstraint -q -rp`; int $ulp = `polySelectConstraint -q -ulp`; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kOff")) -radioButton (!$bp && !$sh && !$ap) -c "dR_selConstraintOff"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kAngle")) -radioButton ($ap) -c "dR_selConstraintAngle"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kBorder")) -radioButton ($bp) -c "dR_selConstraintBorder"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kEdgeLoop")) -radioButton ($el) -c "dR_selConstraintEdgeLoop"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kEdgeRing")) -radioButton ($er) -c "dR_selConstraintEdgeRing"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kShell")) -radioButton ($sh) -c "dR_selConstraintElement"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kUVEdgeLoop")) -radioButton($ulp) -c "dR_selConstraintUVEdgeLoop"; setParent -menu ..; menuItem -version 2015 -enable 1 -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kTranConstraintsLabel")) -subMenu 1; radioMenuItemCollection; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kSlideOff")) -radioButton ($tranCon == "none") -c "setXformConstraint none"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kSlideEdge")) -radioButton ($tranCon == "edge") -c "setXformConstraint edge"; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kSlideSurface")) -radioButton ($tranCon == "surface") -c "setXformConstraint surface"; menuItem -divider true; menuItem -label (uiRes("m_commonSelectionConstraintsOptionsPopup.kSlideAlongNormals")) -checkBox `xformConstraint -q -n` -c "setXformConstraintAlongNormal #1"; setParent -menu ..; }