// =========================================================================== // 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 xgmToggleDirectionInvertFrozenEffect() { int $newInvertFrozenValue = !`xgmDirectionBrushContext -q -freezeMode xgmDirectionBrushTool`; xgmDirectionBrushContext -e -freezeMode $newInvertFrozenValue xgmDirectionBrushTool; } global proc xgmToggleDirectionFalloffColor() { int $newFalloffColorValue = !`xgmDirectionBrushContext -q -fc xgmDirectionBrushTool`; xgmDirectionBrushContext -e -fc $newFalloffColorValue xgmDirectionBrushTool; } global proc xgmToggleDirectionPreselectionHighlight() { int $newPreselectionHighlight = !`xgmDirectionBrushContext -q -ps xgmDirectionBrushTool`; xgmDirectionBrushContext -e -ps $newPreselectionHighlight xgmDirectionBrushTool; } global proc xgmToggleDirectionShowFrozen() { int $newShowFrozen = !`xgmDirectionBrushContext -q -sf xgmDirectionBrushTool`; xgmDirectionBrushContext -e -sf $newShowFrozen xgmDirectionBrushTool; } global proc xgmToggleDirectionAlignToSurface() { int $newAlignToSurface = !`xgmDirectionBrushContext -q -alignToSurface xgmDirectionBrushTool`; xgmDirectionBrushContext -e -alignToSurface $newAlignToSurface xgmDirectionBrushTool; } global proc xgmSwitchDirectionBrushMode(int $DirectionBrushMode) { xgmDirectionBrushContext -e -globalSelection $DirectionBrushMode xgmDirectionBrushTool; } global proc xgmSwitchDirectionSelectMode(int $DirectionSelectMode) { xgmDirectionBrushContext -e -selectMode $DirectionSelectMode xgmDirectionBrushTool; } global proc xgmSwitchDirectionFloodMode(int $DirectionFloodMode) { xgmDirectionBrushContext -e -floodMode $DirectionFloodMode xgmDirectionBrushTool; } global proc xgmToggleDirectionEnableRootToTipFalloff() { int $newEnableRootToTip = !`xgmDirectionBrushContext -q -ert xgmDirectionBrushTool`; xgmDirectionBrushContext -e -ert $newEnableRootToTip xgmDirectionBrushTool; } global proc xgmToggleDirectionFilterBackfaces() { int $newFilterBackfaces = !`xgmDirectionBrushContext -q -fb xgmDirectionBrushTool`; xgmDirectionBrushContext -e -fb $newFilterBackfaces xgmDirectionBrushTool; } global proc xgmSwitchDirectionFallOffType(string $falloffType) { xgmDirectionBrushContext -e -brushFalloffType $falloffType xgmDirectionBrushTool; } global proc contextXGenDirectionToolMM() { int $currentInvertFrozen = !`xgmDirectionBrushContext -q -freezeMode xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kInvertFrozenEffect")) -command xgmToggleDirectionInvertFrozenEffect -checkBox $currentInvertFrozen -radialPosition "N" -enableCommandRepeat 1 ; int $currentFalloffColor = `xgmDirectionBrushContext -q -fc xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kBrushFalloffColor")) -command xgmToggleDirectionFalloffColor -checkBox $currentFalloffColor -radialPosition "NE" -enableCommandRepeat 1 ; int $currentPreselectionHighlight = `xgmDirectionBrushContext -q -ps xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kPreselectionHighlight")) -command xgmToggleDirectionPreselectionHighlight -checkBox $currentPreselectionHighlight -radialPosition "E" -enableCommandRepeat 1 ; int $currentShowFrozen = `xgmDirectionBrushContext -q -sf xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kShowFrozen")) -command xgmToggleDirectionShowFrozen -checkBox $currentShowFrozen -radialPosition "SE" -enableCommandRepeat 1 ; int $alignToSurface = `xgmDirectionBrushContext -q -alignToSurface xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kAlignToSurface")) -command xgmToggleDirectionAlignToSurface -checkBox $alignToSurface -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kFlood")) -command "xgmDirectionBrushContext -e -flood xgmDirectionBrushTool" -radialPosition "S" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionBrushMode")) -radialPosition "SW" -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; int $currentBrushMode = `xgmDirectionBrushContext -q -globalSelection xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionGlobal")) -command "xgmSwitchDirectionBrushMode(1)" -radialPosition "W" -radioButton ($currentBrushMode == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionLocal")) -command "xgmSwitchDirectionBrushMode(0)" -radioButton ($currentBrushMode == 0) -radialPosition "S" -enableCommandRepeat 1 ; setParent -m ..; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionSelectionMode")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; int $currentSelectMode = `xgmDirectionBrushContext -q -selectMode xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionFloating")) -command "xgmSwitchDirectionSelectMode(1)" -radialPosition "W" -radioButton ($currentSelectMode == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionLocked")) -command "xgmSwitchDirectionSelectMode(0)" -radioButton ($currentSelectMode == 0) -radialPosition "S" -enableCommandRepeat 1 ; setParent -m ..; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionfloodMode")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; int $currentFloodMode = `xgmDirectionBrushContext -q -floodMode xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionAll")) -command "xgmSwitchDirectionFloodMode(1)" -radialPosition "W" -radioButton ($currentFloodMode == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kDirectionSelected")) -command "xgmSwitchDirectionFloodMode(2)" -radioButton ($currentFloodMode == 2) -radialPosition "S" -enableCommandRepeat 1 ; setParent -m ..; int $currentRootToTipFalloff = `xgmDirectionBrushContext -q -ert xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kRootToTipFalloff")) -command xgmToggleDirectionEnableRootToTipFalloff -checkBox $currentRootToTipFalloff -radialPosition "W" -enableCommandRepeat 1 ; int $currentFilterBackFaces = `xgmDirectionBrushContext -q -fb xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kFilterBackFaces")) -command xgmToggleDirectionFilterBackfaces -checkBox $currentFilterBackFaces -radialPosition "NW" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kFalloffType")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentFallOffType = `xgmDirectionBrushContext -q -bft xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kScreen")) -command "xgmSwitchDirectionFallOffType(\"screen\")" -radioButton ($currentFallOffType == "screen") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kVolume")) -command "xgmSwitchDirectionFallOffType(\"volume\")" -radioButton ($currentFallOffType == "volume") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kSurface")) -command "xgmSwitchDirectionFallOffType(\"surface\")" -radioButton ($currentFallOffType == "surface") -enableCommandRepeat 1 ; setParent -m ..; string $brushCmd = "xgmDirectionBrushContext"; string $tool = "xgmDirectionBrushTool"; string $flag = "-brushFalloffCurve"; string $defaultValFlag = "-defaultBrushFalloffCurve"; string $param = $brushCmd + "\", \"" + $tool + "\", \"" + $flag + "\", \"" + $defaultValFlag; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kAdjustBrushFalloffCurve")) -command ("xgmMarkingMenuAdjustFalloffCurve( \"" + $param + "\" )") -enableCommandRepeat 1 ; $flag = "-rootToTipCurve"; $defaultValFlag = "-defaultRootToTipCurve"; $param = $brushCmd + "\", \"" + $tool + "\", \"" + $flag + "\", \"" + $defaultValFlag; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kAdjustRootToTipFalloffCurve")) -command ("xgmMarkingMenuAdjustFalloffCurve( \"" + $param + "\" )") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kSymmetry")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentSymmetryType = `xgmDirectionBrushContext -q -brushSymmetryType xgmDirectionBrushTool`; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kOff")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 0)" -radioButton ($currentSymmetryType == 0) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kObjectX")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 1)" -radioButton ($currentSymmetryType == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kObjectY")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 2)" -radioButton ($currentSymmetryType == 2) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kObjectZ")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 3)" -radioButton ($currentSymmetryType == 3) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kWorldX")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 4)" -radioButton ($currentSymmetryType == 4) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kWorldY")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 5)" -radioButton ($currentSymmetryType == 5) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenDirectionToolMM.kWorldZ")) -command "xgmSwitchSymmetryType(\"xgmDirectionBrushContext\", \"xgmDirectionBrushTool\", 6)" -radioButton ($currentSymmetryType == 6) -enableCommandRepeat 1 ; setParent -m ..; setParent -menu ..; }