// =========================================================================== // 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: May 2000 // // Procedure Name: // artAttrInitPaintableAttr // // Description: // Initializes the paintable attribute. // // Return Value: // 0 - if the selection failed. // 1 - if the selection succeded. // proc int artAttrFindAllPaintableAttr() { string $artCmd = "artAttrCtx"; string $attr = ""; string $cmd = $artCmd + " -q -objattrArray " + `currentCtx`; string $paintAttr = `eval $cmd`; string $ListPaintableItem[]; tokenize( $paintAttr, " ", $ListPaintableItem ); if (size($ListPaintableItem) < 1) { return 0; } for ($paintableItem in $ListPaintableItem) { string $buf[]; tokenize($paintableItem, ".", $buf); if (size($buf) < 3) { continue; } // For paint vertex color tool we are interested in // only vertexColorRGB and vertexFaceColorRGB attributes. // So update the paintable array with only those nodes if( $buf[2] != "vertexFaceColorRGB" && $buf[2] != "vertexColorRGB") { // skip other attributes continue ; } $attr = $buf[0] + "." + $buf[1] + "." + $buf[2]; string $isPaintableCmd = "makePaintable -q " + $buf[0] + " " + $buf[2]; int $isPaintable[] = eval($isPaintableCmd); if (size($isPaintable) < 1) { continue; } if ($isPaintable[0]) { //artAttrSelected( $artCmd, $attr ); //interactive update required string $cmd = $artCmd + " -interactiveUpdate true " ; // Notify the context about the change. $cmd = ($cmd + " -e -pas \"" + $attr + "\" `currentCtx`"); eval( $cmd ); } } return 0 ; } global proc int artPaintVertexInitPaintableAttr() { source "artAttrCallback.mel"; artAttrSyncCurrentAttribute(); return artAttrFindAllPaintableAttr() ; }