// =========================================================================== // 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 texSculptBrushInfo(string $mode, string $brushInfo[]) { switch ($mode) { case "Freeze": $brushInfo[3] = "1"; $brushInfo[2] = "PinUVTool"; $brushInfo[1] = "UV_Freeze_ToolLarge.png"; $brushInfo[0] = (uiRes("m_texSculptCacheContextValues.kPinUVTool")); break; case "Pinch": $brushInfo[3] = "1"; $brushInfo[2] = "PinchUVTool"; $brushInfo[1] = "UV_Pinch_ToolLarge.png"; $brushInfo[0] = (uiRes("m_texSculptCacheContextValues.kPinchUVTool")); break; case "Smear": $brushInfo[3] = "1"; $brushInfo[2] = "SmearUVTool"; $brushInfo[1] = "UV_Smear_ToolLarge.png"; $brushInfo[0] = (uiRes("m_texSculptCacheContextValues.kSmearUVTool")); break; case "Grab": default: $brushInfo[3] = "0"; $brushInfo[2] = "GrabUVTool"; $brushInfo[1] = "UV_Grab_BrushLarge.png"; $brushInfo[0] = (uiRes("m_texSculptCacheContextValues.kGrabUVTool")); break; } } global proc texSculptCacheContextValues( string $toolName ) { string $parent = (`toolPropertyWindow -q -location` + "|texSculptCacheContext"); setParent $parent; float $size = `texSculptCacheContext -q -size $toolName`; float $strength = `texSculptCacheContext -q -strength $toolName`; int $falloff = 1 + (`texSculptCacheContext -q -falloffType $toolName`); int $stg = `falloffCurve -q -snapToGrid texSculptFalloffCurve`; // See the Direction definition // enum Direction { // kDirUV = 0, // Can also be 2. // kDirU = 3, // 3 will corresponding to "XZ" // kDirV = 4 // 4 will corresponding to "YZ" // } // To setup the item in Direction tool settings, need to transform 0, 1, 2 to 1, 2, 3. int $direction = 1 + (`texSculptCacheContext -q -direction $toolName`); string $mode = (`texSculptCacheContext -q -mode $toolName`); floatSliderGrp -e -value $size texSculptFalloffSize_FSG; floatSliderGrp -e -value $strength texSculptFalloffStrength_FSG; int $inv = `texSculptCacheContext -q -inverted $toolName`; int $twist = `texSculptCacheContext -q -grabTwist $toolName`; checkBoxGrp -e -value1 $twist texSculptTwist_CBG; if( $mode == "Grab" ) { checkBoxGrp -e -visible true texSculptTwist_CBG; } else { checkBoxGrp -e -visible false texSculptTwist_CBG; } // the menuIndex starts from 1 not 0. optionMenuGrp -e -select $falloff texSculptCacheFalloffType_OMG; if( $mode == "Grab" ) { optionMenuGrp -e -visible true -select $direction texSculptGrabDirection_OMG; } else { optionMenuGrp -e -visible false texSculptGrabDirection_OMG; } int $smooth = `texSculptCacheContext -q -pinsmooth $toolName`; int $sap = `texSculptCacheContext -q -pinsmoothandpaint $toolName`; if( $mode == "Freeze" ) { int $pm = 2; if( $sap ) $pm = 1; optionMenuGrp -e -visible true -select $pm texSculptPaintMethod_OMG; rowLayout -e -visible true unPinAll_ROW; rowLayout -e -visible true invertPinned_ROW; } else { optionMenuGrp -e -visible false texSculptPaintMethod_OMG; rowLayout -e -visible false unPinAll_ROW; rowLayout -e -visible false invertPinned_ROW; } falloffCurve -e -asString `texSculptCacheContext -q -sculptFalloffCurve $toolName` texSculptFalloffCurve; if(`optionVar -exists "optionvarCustomCurves"`) { string $customsArray[] = `optionVar -q "optionvarCustomCurves"`; for($i = 0 ; $i