// =========================================================================== // 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 xgmToggleSelectDeselect() { int $newDeselect = !`xgmSelectBrushContext -q -invert xgmSelectBrushTool`; xgmSelectBrushContext -e -invert $newDeselect xgmSelectBrushTool; } global proc xgmToggleSelectSelectionHighlight() { int $newSelectionHighlight = !`xgmSelectBrushContext -q -selectionHighlight xgmSelectBrushTool`; xgmSelectBrushContext -e -selectionHighlight $newSelectionHighlight xgmSelectBrushTool; } global proc xgmToggleSelectPreselectionHighlight() { int $newPreselectionHighlight = !`xgmSelectBrushContext -q -ps xgmSelectBrushTool`; xgmSelectBrushContext -e -ps $newPreselectionHighlight xgmSelectBrushTool; } global proc xgmToggleSelectShowFrozen() { int $newShowFrozen = !`xgmSelectBrushContext -q -sf xgmSelectBrushTool`; xgmSelectBrushContext -e -sf $newShowFrozen xgmSelectBrushTool; } global proc xgmSwitchSelectSelectionType(string $selectionType) { xgmSelectBrushContext -e -brushFalloffType $selectionType xgmSelectBrushTool; } global proc xgmSelectShowSelectedOnly() { xgmSelectBrushContext -e -hideUnselected xgmSelectBrushTool; } global proc xgmToggleSelectFilterBackfaces() { int $newFilterBackfaces = !`xgmSelectBrushContext -q -fb xgmSelectBrushTool`; xgmSelectBrushContext -e -fb $newFilterBackfaces xgmSelectBrushTool; } global proc contextXGenSelectToolMM() { int $currentDeselect = `xgmSelectBrushContext -q -invert xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kDeselect")) -command xgmToggleSelectDeselect -checkBox $currentDeselect -radialPosition "N" -enableCommandRepeat 1 ; int $currentSelectionHighlight = `xgmSelectBrushContext -q -sh xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kSelectionHighlight")) -command xgmToggleSelectSelectionHighlight -checkBox $currentSelectionHighlight -radialPosition "NE" -enableCommandRepeat 1 ; int $currentPreselectionHighlight = `xgmSelectBrushContext -q -ps xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kPreselectionHighlight")) -command xgmToggleSelectPreselectionHighlight -checkBox $currentPreselectionHighlight -radialPosition "E" -enableCommandRepeat 1 ; int $currentShowFrozen = `xgmSelectBrushContext -q -sf xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kShowFrozen")) -command xgmToggleSelectShowFrozen -checkBox $currentShowFrozen -radialPosition "SE" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kShowAll")) -command "xgmSelectBrushContext -e -unhideAll xgmSelectBrushTool" -radialPosition "S" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kHideSelected")) -command "xgmSelectBrushContext -e -hideSelected xgmSelectBrushTool" -radialPosition "SW" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kInvertSelection")) -command "xgmSelectBrushContext -e -invertSelection xgmSelectBrushTool" -radialPosition "W" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kDeselectAll")) -command "xgmSelectBrushContext -e -deselectAll xgmSelectBrushTool" -radialPosition "NW" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kSelectionType")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentSelectionType = `xgmSelectBrushContext -q -bft xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kScreen")) -command "xgmSwitchSelectSelectionType(\"screen\")" -radioButton ($currentSelectionType == "screen") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kVolume")) -command "xgmSwitchSelectSelectionType(\"volume\")" -radioButton ($currentSelectionType == "volume") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kSurface")) -command "xgmSwitchSelectSelectionType(\"surface\")" -radioButton ($currentSelectionType == "surface") -enableCommandRepeat 1 ; setParent -m ..; menuItem -label (uiRes("m_contextXGenSelectToolMM.kShowSelectedOnly")) -command xgmSelectShowSelectedOnly -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kToggleShowHide")) -command "xgmSelectBrushContext -e -invertHidden xgmSelectBrushTool" -enableCommandRepeat 1 ; int $currentFilterBackFaces = `xgmSelectBrushContext -q -filterBackface xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kFilterBackFaces")) -command xgmToggleSelectFilterBackfaces -checkBox $currentFilterBackFaces -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kSymmetry")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentSymmetryType = `xgmSelectBrushContext -q -brushSymmetryType xgmSelectBrushTool`; menuItem -label (uiRes("m_contextXGenSelectToolMM.kOff")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 0)" -radioButton ($currentSymmetryType == 0) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kObjectX")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 1)" -radioButton ($currentSymmetryType == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kObjectY")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 2)" -radioButton ($currentSymmetryType == 2) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kObjectZ")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 3)" -radioButton ($currentSymmetryType == 3) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kWorldX")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 4)" -radioButton ($currentSymmetryType == 4) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kWorldY")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 5)" -radioButton ($currentSymmetryType == 5) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSelectToolMM.kWorldZ")) -command "xgmSwitchSymmetryType(\"xgmSelectBrushContext\", \"xgmSelectBrushTool\", 6)" -radioButton ($currentSymmetryType == 6) -enableCommandRepeat 1 ; setParent -m ..; setParent -menu ..; }