// =========================================================================== // 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. // =========================================================================== // Sculpt Paint Tools UI script // global int $gArtPuttySelChangedJob = -1; // ======================================================= // Main Procedure. // ======================================================= proc artPuttyOperationCallBack( string $artCommand ) { // // Sculpt Operation frameLayout // symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " push ;" ) artPuttyPushIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " pull ;" ) artPuttyPullIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " smooth ;" ) artPuttySmoothIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " erase ;" ) artPuttyEraseIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " relax ;" ) artPuttyRelaxIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " pinch ;" ) artPuttyPinchIcon; symbolCheckBox -e -onc ("artUpdatePuttyOperation " + $artCommand + " slide ;" ) artPuttySlideIcon; // // Brush Strength frameLayout // floatSliderGrp -e -cc ($artCommand + " -e -brushStrength #1 `currentCtx` ; ") artPuttyBrushStrength; // // Auto Smooth frameLayout // checkBoxGrp -e -cc1 ($artCommand + " -e -autosmooth #1 `currentCtx` ; " + "artUpdateAutoSmoothSlider " + $artCommand) autoSmooth; intSliderGrp -e -cc ($artCommand + " -e -smoothiters #1 `currentCtx`") smoothStrength; // // Sculpt Variables frameLayout // radioButtonGrp -e -on1 ($artCommand + " -e -refvector \"normal\" `currentCtx`") -on2 ($artCommand + " -e -refvector \"firstnormal\" `currentCtx`") -on3 ($artCommand + " -e -refvector \"view\" `currentCtx`") rv0Radio; radioButtonGrp -e -on1 ($artCommand + " -e -refvector \"xaxis\" `currentCtx`") -on2 ($artCommand + " -e -refvector \"yaxis\" `currentCtx`") -on3 ($artCommand + " -e -refvector \"zaxis\" `currentCtx`") rv1Radio; radioButtonGrp -e -on1 ($artCommand + " -e -refvector \"uisoparm\" `currentCtx`") -on2 ($artCommand + " -e -refvector \"visoparm\" `currentCtx`") -on3 ($artCommand + " -e -refvector \"uvvector\" `currentCtx`; rowColumnLayout -e -vis true rvUVLayout;") -of3 ("rowColumnLayout -e -vis false rvUVLayout; disableAdjustUVVector();") rv2Radio; rowColumnLayout -e -vis (eval($artCommand + " -q -refvector `currentCtx`") == "uvvector") rvUVLayout; updateUandVSculptDirection( $artCommand ); floatSliderGrp -e -cc ($artCommand + " -e -maxdisp #1 `currentCtx`") maxDisp; floatSliderGrp -e -cc ($artCommand + " -e -collapsecvtol #1 `currentCtx`") collapseCVTol; // // Surface frameLayout // checkBox -e -cc ($artCommand + " -e -refsurface #1 `currentCtx`") refSurfaceChk; button -e -c ($artCommand + " -e -updaterefsrf `currentCtx`" ) updateButton; checkBox -e -cc ($artCommand + " -e -erasesrfupd #1 `currentCtx`") eraseSurfaceChk; button -e -c ($artCommand + " -e -updateerasesrf `currentCtx`" ) eraseSurfaceButton; // Flood. button -e -c ($artCommand + " -e -clear `currentCtx`") artPuttyFloodButton; } global proc artPuttyCallback( string $artCommand ) { source "artisanCallback.mel"; source "artAttrCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; // Basic Brush frameLayout. artisanBrushCallback( $artCommand, $currTool ); // Stroke frameLayout. artisanStrokeCallback( $artCommand, $currTool ); // Stroke frameLayout. artisanPressureCallback( $artCommand, $currTool ); artPuttyOperationCallBack( $artCommand ) ; // Attribute Maps frameLayout. artisanAttrMapCallback( $artCommand, $currTool ); // Display frameLayout. artisanDisplayCallback( $artCommand, $currTool ); // Create a script job to manage the tool properties page // global int $gArtPuttySelChangedJob; if( !`scriptJob -ex $gArtPuttySelChangedJob` ) { $gArtPuttySelChangedJob = `scriptJob -e SelectionChanged artPuttySelChanged`; } } global proc artPuttySelChanged() { string $currCtx = `currentCtx`; if( $currCtx == "artPuttyContext" ) { // Refresh properties page on new selections. // if( `contextInfo -exists $currCtx`) { setToolTo $currCtx; } // If UVVector adjustment mode is enabled, disable it. // disableAdjustUVVector(); } }