// =========================================================================== // 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. // =========================================================================== // // // Creation Date: June 2000 // // Description: // Option tool callbacks for Artisan Select Paint tool. // // // Procedure Name: // artSelectCallback // // Description: // Initialize the option values. // // Input Arguments: // // Return Value: // None. // // // ======================================================= // Attribute Paint Specific callbacks. // ======================================================= global proc artFluidAttrAutoSave( string $artCommand ) { string $autoSaveCmd; int $autoSave = `checkBoxGrp -q -v1 artFluidAutoSave`; if( $autoSave ) { $autoSaveCmd = "artFluidAttrAutoSaveInitialState `currentCtx`"; } else { $autoSaveCmd = "artFluidAttrConfirmPaintLoss"; } eval( $artCommand + " -e -as \"" + $autoSaveCmd + "\" `currentCtx`" ); } global proc artFluidAttrUpdateColor( string $artCommand ) { float $c[3] = `colorSliderGrp -q -rgb artFluidColorSlider`; if( eval( $artCommand + " -q -exists `currentCtx` " ) ) { eval( $artCommand + " -e -rgb " + $c[0] + " " + $c[1] + " " + $c[2] + " `currentCtx`" ); } } global proc artFluidAttrUpdateVelocity( string $artCommand ) { float $vx = `floatFieldGrp -q -v1 artFluidSpecifiedVelocity`; float $vy = `floatFieldGrp -q -v2 artFluidSpecifiedVelocity`; float $vz = `floatFieldGrp -q -v3 artFluidSpecifiedVelocity`; eval( $artCommand + " -e -v " + $vx + " " + $vy + " " + $vz + " `currentCtx`" ); } global proc artFluidAttrUpdateUseStroke( string $artCommand ) { int $select = `radioButtonGrp -q -sl artFluidStrokeDirection`; int $useIt = $select == 1; eval( $artCommand + " -e -usd " + $useIt + " `currentCtx`" ); floatFieldGrp -e -enable ($select == 2) artFluidSpecifiedVelocity; } global proc artFluidAttrAttributeCallback( string $artCommand, string $currTool ) { checkBoxGrp -e -cc ( "artFluidAttrAutoSave " + $artCommand ) artFluidAutoSave; radioButtonGrp -e -cc ( $artCommand + " -e -dar " + "(`radioButtonGrp -q -sl artFluidDisplayAsRender` - 1) " + "`currentCtx`; " ) artFluidDisplayAsRender; checkBoxGrp -e -cc ( $artCommand + " -e -dv #1 `currentCtx`; " ) artFluidDisplayVelocity; optionMenuGrp -e -cc ( "artFluidAttrPaintMenu " + $artCommand ) artAttrListOptionMenu; colorSliderGrp -e -cc ( "artFluidAttrUpdateColor " + $artCommand ) artFluidColorSlider; radioButtonGrp -e -cc ( "artFluidAttrUpdateUseStroke " + $artCommand ) artFluidStrokeDirection; floatFieldGrp -e -cc ( "artFluidAttrUpdateVelocity " + $artCommand ) artFluidSpecifiedVelocity; } // ======================================================= // Main Procedure. // ======================================================= global proc artFluidAttrCallback( string $artCommand ) { source "artisanCallback.mel"; source "artAttrCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; // Basic Brush frameLayout. artisanBrushCallback( $artCommand, $currTool ); // Attribute Paint frameLayout. artAttrCommonCallback( $artCommand, $currTool ); // Attribute Paint frameLayout. artFluidAttrAttributeCallback( $artCommand, $currTool ); // Stroke frameLayout. artisanStrokeCallback( $artCommand, $currTool ); // Stroke frameLayout. artisanPressureCallback( $artCommand, $currTool ); // Attribute Maps frameLayout. artisanAttrMapCallback( $artCommand, $currTool ); // Display frameLayout. artisanDisplayCallback( $artCommand, $currTool ); }