// =========================================================================== // 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 art3dPaintSetPaintAttr() // // Description: // Checks if the current paintable attr is a valid attr. // If not, it sets the current paint attr to "color" // which is a valid one for all the shaders. // { string $paintAttr = eval("art3dPaintCtx -q -painttxtattrname `currentCtx`"); string $validPaintAttr = art3dPaintGetPaintableAttr(); string $validAttrArray[]; int $numbAttr = `tokenize $validPaintAttr $validAttrArray`; for ( $attr in $validAttrArray ) { if ( $attr == $paintAttr ) { return; // everything is OK, we can return } } // If we got here we did not find the curr paint attr on the // valid paint attr list, so to be safe we set it to "color". // art3dPaintCtx -e -painttxtattrname "color" `currentCtx`; // If the option box is already opened, make sure the // menu is updated as well. if (`optionMenuGrp -ex artPaintAttrOptionMenu`) { optionMenuGrp -e -v "color" artPaintAttrOptionMenu; } }