// =========================================================================== // 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. // =========================================================================== ////////////////////////////////////////////////////////////////////////////// // This file contains the MEL script to create the Paintable Attribute Menu ////////////////////////////////////////////////////////////////////////////// proc string paintableAttributes_uiToMel(string $ui) { string $mel = $ui; if( $ui == (uiRes("m_artFluidAttrProperties.kDensity")) ) { $mel = "Density"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kDensityAndColor")) ) { $mel = "Density and color"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kDensityAndFuel")) ) { $mel = "Density and fuel"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kVelocity")) ) { $mel = "Velocity"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kTemperature")) ) { $mel = "Temperature"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kFuel")) ) { $mel = "Fuel"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kColor")) ) { $mel = "Color"; } else if( $ui == (uiRes("m_artFluidAttrProperties.kFalloff")) ) { $mel = "Falloff"; } else { uiToMelMsg( "paintableAttributes_uiToMel", $ui, 1 ); } return $mel; } global proc artFluidAttrPaintMenu( string $artCommand ) // // Description: // Creates a menu that shows all the paintable attributes // { string $attr; int $velocity = 0; if( `optionMenuGrp -exists artAttrListOptionMenu` ) { $attr = `optionMenuGrp -q -v artAttrListOptionMenu`; } else { $attr = eval( $artCommand + " -q -p `currentCtx`; " ); } $attr = substituteAllString( tolower( paintableAttributes_uiToMel($attr) ), " ", "" ); $velocity = ($attr == "velocity"); artFluidAttrVerifyGrid( $attr ); // Setting the property here will issue an error if we're // painting on an unpaintable fluid property. // catch( evalEcho( $artCommand + " -e " + " -property " + $attr + " -displayVelocity " + $velocity + " `currentCtx`; " ) ); }