// =========================================================================== // 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 xgmTogglePlaceRemove() { int $currentRemoveValue = `xgmPlaceBrushContext -q -opMode xgmPlaceBrushTool`; int $newRemoveValue; if($currentRemoveValue == 1) { $newRemoveValue = 2; } else if($currentRemoveValue == 2) { $newRemoveValue = 1; } xgmPlaceBrushContext -e -opMode $newRemoveValue xgmPlaceBrushTool; } global proc xgmTogglePlaceInterpolate() { int $newInterpolate = !`xgmPlaceBrushContext -q -interpolate xgmPlaceBrushTool`; xgmPlaceBrushContext -e -interpolate $newInterpolate xgmPlaceBrushTool; } global proc xgmSwitchPlaceInterpolateFrom(int $interpolateFrom) { xgmPlaceBrushContext -e -interpolateFrom $interpolateFrom xgmPlaceBrushTool; } global proc contextXGenPlaceToolMM() { int $currentRemoveValue = `xgmPlaceBrushContext -q -opMode xgmPlaceBrushTool` - 1; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kRemove")) -command xgmTogglePlaceRemove -checkBox $currentRemoveValue -radialPosition "N" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kClearAll")) -command "xgmPlaceBrushContext -e -clearAll xgmPlaceBrushTool" -radialPosition "NE" -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kSymmetry")) -subMenu 1 -radialPosition "E" -enableCommandRepeat 1 ; radioMenuItemCollection; string $currentSymmetryType = `xgmPlaceBrushContext -q -brushSymmetryType xgmPlaceBrushTool`; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kOff")) -radialPosition "N" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 0)" -radioButton ($currentSymmetryType == 0) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kObjectX")) -radialPosition "NE" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 1)" -radioButton ($currentSymmetryType == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kObjectY")) -radialPosition "E" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 2)" -radioButton ($currentSymmetryType == 2) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kObjectZ")) -radialPosition "SE" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 3)" -radioButton ($currentSymmetryType == 3) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kWorldX")) -radialPosition "SW" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 4)" -radioButton ($currentSymmetryType == 4) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kWorldY")) -radialPosition "W" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 5)" -radioButton ($currentSymmetryType == 5) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kWorldZ")) -radialPosition "NW" -command "xgmSwitchSymmetryType(\"xgmPlaceBrushContext\", \"xgmPlaceBrushTool\", 6)" -radioButton ($currentSymmetryType == 6) -enableCommandRepeat 1 ; setParent -m ..; int $currentInterpolate = `xgmPlaceBrushContext -q -interpolate xgmPlaceBrushTool`; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kInterpolateFrom")) -subMenu 1 -radialPosition "W" -enable $currentInterpolate -enableCommandRepeat 1 ; if($currentInterpolate) { radioMenuItemCollection; string $currentInterpolateFrom = `xgmPlaceBrushContext -q -interpolateFrom xgmPlaceBrushTool`; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kCurrentDescription")) -command "xgmSwitchPlaceInterpolateFrom(1)" -radialPosition "W" -radioButton ($currentInterpolateFrom == 1) -enableCommandRepeat 1 ; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kInterpSource")) -command "xgmSwitchPlaceInterpolateFrom(2)" -radialPosition "S" -radioButton ($currentInterpolateFrom == 2) -enableCommandRepeat 1 ; } setParent -m ..; menuItem -label (uiRes("m_contextXGenPlaceToolMM.kInterpolate")) -command xgmTogglePlaceInterpolate -checkBox $currentInterpolate -radialPosition "NW" -enableCommandRepeat 1 ; setParent -menu ..; }