// =========================================================================== // 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 sculptMeshCacheValues_ResetToolUI( string $toolName ) { // reset some of the slider widget ranges to their defaults. string $parent = (`toolPropertyWindow -q -location` + "|sculptMeshCache"); setParent $parent; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshFalloffSize_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshFalloffStrength_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100 sculptMeshStampDistance_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100 sculptMeshBuildUp_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 steadyStrokeDistance_ISG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshMinSize_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshMinStrength_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshStampRandomizeRotation_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshStampRandomizeScale_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshStampRandomizeStrength_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshStampRandomizePosX_FSG; floatSliderGrp -e -min 0 -max 100 -fieldMaxValue 100000 sculptMeshStampRandomizePosY_FSG; sculptMeshCacheValues_ResetTool( $toolName ); } global proc sculptMeshCacheValues_ResetTool( string $toolName ) { // set the generic default values that are common to all tools sculptMeshCacheCtx -e -displayWireframe true -wireframeAlpha 0.25 -wireframeColor 0 0 0 -inverted false -falloffType 0 -size 25 -orientToSurface false -useSteadyStroke false -steadyStrokeDistance 4 -useScreenSpace false -lockShellBorder true -useStampImage false -stampOrientToStroke true -stampRotation 0 -stampFlipX false -stampFlipY false -stampPlacement 0 -buildUpRate 50 -grabTwist 0 -grabSilhouette 0 -grabFollowPath 0 -constrainToSurface false -updatePlane true -wholeStroke false -stampRandomization false -stampRandomizeRotation 35 -stampRandomizeScale 0 -stampRandomizePosX 40 -stampRandomizePosY 40 -stampRandomizationSeed 0 -stampRandomizeStrength 0 -stampRandomizeFlipX false -stampRandomizeFlipY false -sculptFalloffCurve "0.0,1.0,0.5,1.0,0.5,0.0,1.0,0.0" -displayFrozen 1 $toolName; // set the tool specific default values. string $mode = (`sculptMeshCacheCtx -q -mode $toolName`); string $runTimeDir = `getenv "MAYA_LOCATION"`; string $defaultStamp; switch ($mode) { case "Sculpt": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Smooth": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 -affectAllLayers 1 $toolName; break; case "SmoothTarget": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 -affectAllLayers 0 $toolName; break; case "Grab": sculptMeshCacheCtx -e -strength 100 -direction 0 -useStampDistance 0 -stampDistance 6.25 -minSize 100 -minStrength 100 -stampOrientToStroke false $toolName; break; case "Pinch": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Flatten": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Foamy": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 0 -stampDistance 11.25 -minSize 25 -minStrength 0 -buildUpRate 25 $toolName; break; case "Spray": $defaultStamp = $runTimeDir + "/Examples/Modeling/Sculpting_Stamps/bw_brickTile.tif"; sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; sculptMeshCacheCtx -e -stampFile $defaultStamp -useStampImage 1 -stampRandomization 1 $toolName; break; case "Repeat": $defaultStamp = $runTimeDir + "/Examples/Modeling/Sculpting_Stamps/bw_scale.tif"; sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; sculptMeshCacheCtx -e -stampFile $defaultStamp -useStampImage 1 $toolName; break; case "Imprint": $defaultStamp = $runTimeDir + "/Examples/Modeling/Sculpting_Stamps/bw_rubble.tif"; sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 0 -stampDistance 6.25 -minSize 25 -minStrength 0 -buildUpRate 100 $toolName; sculptMeshCacheCtx -e -stampFile $defaultStamp -stampPlacement 1 -useStampImage 1 -stampOrientToStroke 0 -sculptFalloffCurve "0,1,0.273,1,0.772,1,1,1" $toolName; break; case "Wax": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 10.0 -minSize 25 -minStrength 0 $toolName; break; case "Scrape": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Fill": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Knife": $defaultStamp = $runTimeDir + "/Examples/Modeling/Sculpting_Stamps/bw_knife.exr"; sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 26.25 -minSize 25 -minStrength 0 $toolName; sculptMeshCacheCtx -e -stampFile $defaultStamp -useStampImage 1 $toolName; break; case "Smear": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Bulge": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Amplify": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 $toolName; break; case "Freeze": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 0 -stampDistance 6.25 -minSize 25 -minStrength 0 -buildUpRate 40 -steadyStrokeDistance 4 -freezesmooth 1 -freezesmoothandpaint 1 $toolName; break; case "UV": sculptMeshCacheCtx -e -strength 15 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 -lockShellBorder 1 $toolName; break; case "Relax": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 1 -stampDistance 6.25 -minSize 25 -minStrength 0 -constrainToSurface true $toolName; break; case "Erase": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 0 -stampDistance 6.25 -minSize 25 -minStrength 0 -buildUpRate 40 -steadyStrokeDistance 2 $toolName; break; case "Mask": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 0 -stampDistance 6.25 -minSize 25 -minStrength 0 -buildUpRate 40 -steadyStrokeDistance 2 $toolName; break; case "Clone": sculptMeshCacheCtx -e -strength 100 -direction 1 -useStampDistance 0 -stampDistance 6.25 -minSize 25 -minStrength 0 -buildUpRate 100 -steadyStrokeDistance 2 -cloneMethod 0 $toolName; break; default: break; } }