// =========================================================================== // 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 property window for Artisan tools // // // Procedure Name: // artSelectValues // // Description: // Initialize the option values. // // Input Arguments: // // Return Value: // None. // proc artFluidAttrAttributeValues( string $artCommand, string $currTool ) { string $autoSaveCmd = eval( $artCommand + " -q -as `currentCtx` " ); checkBoxGrp -e -v1 ($autoSaveCmd != "artFluidAttrConfirmPaintLoss") artFluidAutoSave; int $allowImportExport = true; string $attr = eval( $artCommand + " -q -p `currentCtx` " ); string $kColor = uiRes("m_artFluidAttrProperties.kColor"); string $kVelocity = uiRes("m_artFluidAttrProperties.kVelocity"); if( $attr == "color" ) { $attr = $kColor; } else if( $attr == "temperature" ) { $attr = uiRes("m_artFluidAttrProperties.kTemperature"); } else if( $attr == "fuel" ) { $attr = uiRes("m_artFluidAttrProperties.kFuel"); } else if( $attr == "velocity" ) { $attr = $kVelocity; } else if( $attr == "densityAndColor" ) { $attr = uiRes("m_artFluidAttrProperties.kDensityAndColor"); } else if( $attr == "densityAndFuel" ) { $attr = uiRes("m_artFluidAttrProperties.kDensityAndFuel"); } else if( $attr == "falloff" ) { $attr = uiRes("m_artFluidAttrProperties.kFalloff"); } else { $attr = uiRes("m_artFluidAttrProperties.kDensity"); } string $oper = eval( $artCommand + " -q -selectedattroper `currentCtx`" ); int $smooth = ( $oper == "smooth" ); int $scale = ( $oper == "scale" ); int $dispAsRender = eval( $artCommand + " -q -dar `currentCtx` " ); radioButtonGrp -e -sl ($dispAsRender+1) artFluidDisplayAsRender; int $dispVelocity = eval( $artCommand + " -q -dv `currentCtx` " ); checkBoxGrp -e -v1 $dispVelocity artFluidDisplayVelocity; optionMenuGrp -e -v $attr artAttrListOptionMenu; float $color[3] = eval( $artCommand + " -q -rgb `currentCtx` " ); colorSliderGrp -e -en ( !$smooth && ( ($attr == $kColor ) || ($attr == uiRes("m_artFluidAttrProperties.kDensityAndColor"))) ) -rgb $color[0] $color[1] $color[2] artFluidColorSlider; int $useIt = eval( $artCommand + " -q -usd `currentCtx` " ); int $select = $useIt == 1 ? 1 : 2; radioButtonGrp -e -en (!$smooth && !$scale && ($attr == $kVelocity)) -select $select artFluidStrokeDirection; float $velocity[] = eval( $artCommand + " -q -v `currentCtx` " ); floatFieldGrp -e -en ( !$smooth && !$scale && ($attr == $kVelocity) && ($select == 2)) -v1 $velocity[0] -v2 $velocity[1] -v3 $velocity[2] artFluidSpecifiedVelocity; // Disable the Value slider for Color painting // floatSliderGrp -e -en (!$smooth && ($attr != $kColor)) artAttrValueSlider; floatFieldGrp -e -en ($attr != $kColor) artAttrMinMaxValue; checkBoxGrp -e -en ($attr != $kColor) artAttrClampChkBox; floatFieldGrp -e -en ($attr != $kColor) artAttrClampField; // Cannot export/import Velocity or Color+Density. // button -e -en $allowImportExport importMapBrowseButton; button -e -en $allowImportExport exportMapBrowseButton; // Update the drawing parameters on the geometry to reflect // the menu selection. // // artFluidAttrPaintMenu $artCommand; } // ======================================================= // Main callback procedure for Paint Selecion tool. // ======================================================= global proc artFluidAttrValues( string $toolName ) { source "artisanCallback.mel"; source "artisanValues.mel"; source "artAttrValues.mel"; string $parent = (`toolPropertyWindow -q -location` + "|artFluidAttr"); setParent $parent; string $artCommand = "artFluidAttrCtx"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; // Provide a different icon for different attribute tools. string $icon = "fluidPaint.png"; string $helpTag = "PaintFluidsTool"; toolPropertySetCommon $toolName $icon $helpTag; // Brush frameLayout values. artisanBrushValues( $artCommand, $currTool ); // Paint Attribute frameLayout values. artFluidAttrAttributeValues( $artCommand, $currTool ); // Paint Attribute frameLayout values. artAttrPaintValues( $artCommand, $currTool ); // Stroke frameLayout values. artisanStrokeValues( $artCommand, $currTool ); // Stylus Pressure frameLayout values. artisanPressureValues( $artCommand, $currTool ); // Attribute Maps frameLayout values. artisanAttrMapValues( $artCommand, $currTool ); // Display frameLayout values. artisanDisplayValues( $artCommand, $currTool ); toolPropertySelect artFluidAttr; }