// =========================================================================== // 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 xgmToggleSmoothInvertFrozenEffect() { int $newInvertFrozenValue = !`xgmSmoothBrushContext -q -freezeMode xgmSmoothBrushTool`; xgmSmoothBrushContext -e -freezeMode $newInvertFrozenValue xgmSmoothBrushTool; } global proc xgmToggleSmoothFalloffColor() { int $newFalloffColorValue = !`xgmSmoothBrushContext -q -fc xgmSmoothBrushTool`; xgmSmoothBrushContext -e -fc $newFalloffColorValue xgmSmoothBrushTool; } global proc xgmToggleSmoothPreselectionHighlight() { int $newPreselectionHighlight = !`xgmSmoothBrushContext -q -ps xgmSmoothBrushTool`; xgmSmoothBrushContext -e -ps $newPreselectionHighlight xgmSmoothBrushTool; } global proc xgmToggleSmoothShowFrozen() { int $newShowFrozen = !`xgmSmoothBrushContext -q -sf xgmSmoothBrushTool`; xgmSmoothBrushContext -e -sf $newShowFrozen xgmSmoothBrushTool; } global proc xgmToggleSmoothPreserveLength() { int $newPreserveLength = !`xgmSmoothBrushContext -q -preserveLength xgmSmoothBrushTool`; xgmSmoothBrushContext -e -preserveLength $newPreserveLength xgmSmoothBrushTool; } global proc xgmToggleSmoothEnableCollide() { int $newEnableCollide = !`xgmSmoothBrushContext -q -ec xgmSmoothBrushTool`; xgmSmoothBrushContext -e -ec $newEnableCollide xgmSmoothBrushTool; } global proc xgmToggleSmoothEnableRootToTipFalloff() { int $newEnableRootToTip = !`xgmSmoothBrushContext -q -ert xgmSmoothBrushTool`; xgmSmoothBrushContext -e -ert $newEnableRootToTip xgmSmoothBrushTool; } global proc xgmToggleSmoothFilterBackfaces() { int $newFilterBackfaces = !`xgmSmoothBrushContext -q -fb xgmSmoothBrushTool`; xgmSmoothBrushContext -e -fb $newFilterBackfaces xgmSmoothBrushTool; } global proc xgmSwitchSmoothFallOffType(string $falloffType) { xgmSmoothBrushContext -e -brushFalloffType $falloffType xgmSmoothBrushTool; } global proc xgmSwitchSmoothBrushMode(int $newBrushMode) { xgmSmoothBrushContext -e -globalSelection $newBrushMode xgmSmoothBrushTool; } global proc contextXGenSmoothToolMM() { int $currentInvertFrozen = !`xgmSmoothBrushContext -q -freezeMode xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kInvertFrozenEffect")) -command xgmToggleSmoothInvertFrozenEffect -checkBox $currentInvertFrozen -radialPosition "N" -enableCommandRepeat 1 ; int $currentFalloffColor = `xgmSmoothBrushContext -q -fc xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kBrushFalloffColor")) -command xgmToggleSmoothFalloffColor -checkBox $currentFalloffColor -radialPosition "NE" -enableCommandRepeat 1 ; int $currentPreselectionHighlight = `xgmSmoothBrushContext -q -ps xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kPreselectionHighlight")) -command xgmToggleSmoothPreselectionHighlight -checkBox $currentPreselectionHighlight -radialPosition "E" -enableCommandRepeat 1 ; int $currentShowFrozen = `xgmSmoothBrushContext -q -sf xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kShowFrozen")) -command xgmToggleSmoothShowFrozen -checkBox $currentShowFrozen -radialPosition "SE" -enableCommandRepeat 1 ; int $currentPreserveLength = `xgmSmoothBrushContext -q -preserveLength xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kPreserveLength")) -command xgmToggleSmoothPreserveLength -checkBox $currentPreserveLength -radialPosition "S" -enableCommandRepeat 1 ; int $currentEnableCollide = `xgmSmoothBrushContext -q -ec xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kCollideWithMeshes")) -command xgmToggleSmoothEnableCollide -checkBox $currentEnableCollide -radialPosition "SW" -enableCommandRepeat 1 ; int $currentRootToTipFalloff = `xgmSmoothBrushContext -q -ert xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kRootToTipFalloff")) -command xgmToggleSmoothEnableRootToTipFalloff -checkBox $currentRootToTipFalloff -radialPosition "W" -enableCommandRepeat 1 ; int $currentFilterBackFaces = `xgmSmoothBrushContext -q -fb xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kFilterBackFaces")) -command xgmToggleSmoothFilterBackfaces -checkBox $currentFilterBackFaces -radialPosition "NW" -enableCommandRepeat 1 ; int $currentBrushMode = `xgmSmoothBrushContext -q -globalSelection xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kFalloffType")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentFallOffType = `xgmSmoothBrushContext -q -bft xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kScreen")) -command "xgmSwitchSmoothFallOffType(\"screen\")" -radioButton ($currentFallOffType == "screen") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kVolume")) -command "xgmSwitchSmoothFallOffType(\"volume\")" -radioButton ($currentFallOffType == "volume") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kSurface")) -command "xgmSwitchSmoothFallOffType(\"surface\")" -radioButton ($currentFallOffType == "surface") -enable $currentBrushMode -enableCommandRepeat 1 ; setParent -m ..; string $brushCmd = "xgmSmoothBrushContext"; string $tool = "xgmSmoothBrushTool"; string $flag = "-brushFalloffCurve"; string $defaultValFlag = "-defaultBrushFalloffCurve"; string $param = $brushCmd + "\", \"" + $tool + "\", \"" + $flag + "\", \"" + $defaultValFlag; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kAdjustBrushFalloffCurve")) -command ("xgmMarkingMenuAdjustFalloffCurve( \"" + $param + "\" )") -enableCommandRepeat 1 ; $flag = "-rootToTipCurve"; $defaultValFlag = "-defaultRootToTipCurve"; $param = $brushCmd + "\", \"" + $tool + "\", \"" + $flag + "\", \"" + $defaultValFlag; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kAdjustRootToTipFalloffCurve")) -command ("xgmMarkingMenuAdjustFalloffCurve( \"" + $param + "\" )") -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kSmoothBrushMode")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kSmoothGlobal")) -command "xgmSwitchSmoothBrushMode(1)" -radioButton ($currentBrushMode == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kSmoothLocal")) -command "xgmSwitchSmoothBrushMode(0)" -radioButton ($currentBrushMode == 0) -enableCommandRepeat 1 ; setParent -m ..; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kFlood")) -command "xgmSmoothBrushContext -e -flood xgmSmoothBrushTool" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kSymmetry")) -subMenu 1 -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentSymmetryType = `xgmSmoothBrushContext -q -brushSymmetryType xgmSmoothBrushTool`; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kOff")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 0)" -radioButton ($currentSymmetryType == 0) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kObjectX")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 1)" -radioButton ($currentSymmetryType == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kObjectY")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 2)" -radioButton ($currentSymmetryType == 2) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kObjectZ")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 3)" -radioButton ($currentSymmetryType == 3) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kWorldX")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 4)" -radioButton ($currentSymmetryType == 4) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kWorldY")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 5)" -radioButton ($currentSymmetryType == 5) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenSmoothToolMM.kWorldZ")) -command "xgmSwitchSymmetryType(\"xgmSmoothBrushContext\", \"xgmSmoothBrushTool\", 6)" -radioButton ($currentSymmetryType == 6) -enableCommandRepeat 1 ; setParent -m ..; setParent -menu ..; }