// =========================================================================== // 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. // =========================================================================== // // // Description: // This script sets the values for the specified cut // context within the tool property sheet. // // Input Arguments: // None. // // Return Value: // None. // global proc texCutEdgeSelectionSensitiveCB( string $parent, string $context ) { setParent $parent; float $ess = `floatSliderGrp -query -value texCutEdgeSelectionSensitiveItem`; texCutContext -edit -edgeSelectSensitive $ess $context; } global proc texSewBrushSizeCB( string $parent, string $context ) { setParent $parent; float $sz = `floatSliderGrp -query -value texSewBrushSizeItem`; texCutContext -edit -size $sz $context; } global proc texCutSteadyStrokeCB( string $parent, string $context ) { setParent $parent; int $ss = `checkBoxGrp -query -value1 texCutSteadyStroke`; texCutContext -edit -steadyStroke $ss $context; if ( $ss) { floatSliderGrp -edit -en true texCutSteadyStrokeDistance; } else { floatSliderGrp -edit -en false texCutSteadyStrokeDistance; } } global proc texCutSteadyStrokeDistanceCB( string $parent, string $context ) { setParent $parent; float $ssd = `floatSliderGrp -query -value texCutSteadyStrokeDistance`; texCutContext -edit -steadyStrokeDistance $ssd $context; } global proc texCutMoveRatioCB( string $parent, string $context ) { setParent $parent; float $mvr = `floatSliderGrp -query -value texCutMoveRatio`; texCutContext -edit -moveRatio $mvr $context; } global proc texCutDisplayShellBorderCB( string $parent, string $context ) { setParent $parent; int $dsb = `checkBoxGrp -query -value1 texCutDisplayShellBorder_CBG`; texCutContext -edit -displayShellBorders $dsb $context; } global proc texCutContextValues_ResetTool( string $toolName ) { // set the generic default values that are common to all tools texCutContext -e -size 0.04 -edgeSelectSensitive 0.2 -steadyStroke 0 -moveRatio 0.1 -steadyStrokeDistance 0.1 -displayShellBorders 0 $toolName; } global proc texCutContextValues( string $context ) { string $parent = `toolPropertyWindow -query -location`; setParent $parent; float $edgeSelectSensitiveValue = `texCutContext -query -edgeSelectSensitive $context`; float $brushSize = `texCutContext -query -size $context`; int $ss = `texCutContext -query -steadyStroke $context`; float $ssd = `texCutContext -query -steadyStrokeDistance $context`; float $mvr = `texCutContext -query -moveRatio $context`; string $mode = `texCutContext -query -mode $context`; int $dsb = `texCutContext -query -displayShellBorders $context`; floatSliderGrp -edit -changeCommand ("texCutEdgeSelectionSensitiveCB " + $parent + " " + $context) -value $edgeSelectSensitiveValue texCutEdgeSelectionSensitiveItem; if ( $mode == "Cut" ) { floatSliderGrp -edit -visible true texCutEdgeSelectionSensitiveItem; } if ( $mode == "Sew" ) { floatSliderGrp -edit -visible false texCutEdgeSelectionSensitiveItem; } floatSliderGrp -edit -changeCommand ("texSewBrushSizeCB " + $parent + " " + $context) -value $brushSize texSewBrushSizeItem; if ( $mode == "Cut" ) { floatSliderGrp -edit -visible false texSewBrushSizeItem; } if ( $mode == "Sew" ) { floatSliderGrp -edit -visible true texSewBrushSizeItem; } checkBoxGrp -edit -changeCommand ("texCutSteadyStrokeCB " + $parent + " " + $context) -value1 $ss texCutSteadyStroke ; floatSliderGrp -edit -changeCommand ("texCutSteadyStrokeDistanceCB " + $parent + " " + $context) -value $ssd texCutSteadyStrokeDistance; floatSliderGrp -edit -changeCommand ("texCutMoveRatioCB " + $parent + " " + $context) -value $mvr texCutMoveRatio; if ( $mode == "Cut" ) { floatSliderGrp -edit -visible true texCutMoveRatio; separator -edit -visible true dsbSpearator; } if ( $mode == "Sew" ) { floatSliderGrp -edit -visible false texCutMoveRatio; separator -edit -visible false dsbSpearator; } checkBoxGrp -edit -changeCommand ("texCutDisplayShellBorderCB " + $parent + " " + $context) -value1 $dsb texCutDisplayShellBorder_CBG ; string $helpTag = "CutUVTool"; if ( $mode == "Sew" ) { $helpTag = "SewUVTool"; } toolPropertySetCommon $context "UV_Cut_ToolLarge.png" $helpTag; toolPropertySelect "texCutContext"; string $reset = `toolPropertyWindow -query -resetButton`; button -edit -enable true -command ("texCutContextValues_ResetTool \"" + $context + "\"") $reset; }