// =========================================================================== // 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: // artAttrToolScript // // Description: // create wrapper around the artSelect command // // Input Arguments: // 4 ==> enter the tool (create if necessary) // 3 ==> property sheet box // // Return Value: // None. // global proc string artAttrToolScript( int $setToTool, string $attrFilter ) // // Description : // 4 ==> enter the tool { source "artAttrCallback.mel"; artAttrSyncCurrentAttribute(); string $filterUILabel = (uiRes("m_artAttrToolScript.kFilter")); string $tool = "artAttrContext"; if ( $attrFilter == "" ) { // General Attribute Paint Tool. makePaintable -activateAll true; makePaintable -activate false "mesh" "vertexColorRGB" ; makePaintable -activate false "mesh" "vertexFaceColorRGB" ; makePaintable -activate false "skinCluster" "*"; setArtAttrFilterLabel( (uiRes("m_artAttrToolScript.kFilterAll")) ); } else if ( $attrFilter == "cluster" || $attrFilter == "textureDeformer" || $attrFilter == "oceanDeformer" || $attrFilter == "jiggle" || $attrFilter == "polyReduce" || $attrFilter == "particle" || $attrFilter == "wire" || $attrFilter == "transferAttributes" || $attrFilter == "shrinkWrap" || $attrFilter == "deltaMush" || $attrFilter == "tension" || $attrFilter == "proxWrap" || $attrFilter == "ffd") { // Paint Weight Tool. makePaintable -activateAll false; makePaintable -activate true $attrFilter "weights"; // Set the filter label. setArtAttrFilterLabel( `format -s $attrFilter $filterUILabel` ); } // Create a tool if it does not exists. if( ! `artAttrCtx -exists $tool` ) { rememberCtxSettings `artAttrCtx -i1 "attrPaint.png" -whichTool "general" $tool`; } setToolTo $tool; if( 3 == $setToTool ) { toolPropertyWindow; // Make sure that the filer is displayed. if (`button -q -ex artAttrFilterButton`) { button -e -label `artAttrFilterLabel` artAttrFilterButton; } } else { if( 4 != $setToTool ) { warning (uiRes("m_artAttrToolScript.kWrongInput")); } else if (!artAttrInitPaintableAttr()) { warning (uiRes("m_artAttrToolScript.kSelectObjectWithPaintableAttr")); } } return $tool; }