// Copyright (C) 1997-2004 Alias Systems Corp. // // The information in this file is provided for the exclusive use of the // licensees of Alias. Such users have the right to use, modify, // and incorporate this code into other products for purposes authorized // by the Alias license agreement, without fee. // // ALIAS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO // EVENT SHALL ALIAS BE LIABLE FOR ANY SPECIAL, INDIRECT OR // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. // // Alias Script File // MODIFY THIS AT YOUR OWN RISK // // Creation Date: Nov 2002 // // // // Procedure Name: // artAttrColorPerVertexToolScript // // Description: // Create wrapper around the artAttrCtx command. // // Input Arguments: // 6 ==> enter the tool (create if necessary) with vertexFaceColorRGB chosen // 5 ==> enter the tool (create if necessary) with vertexColorRGB chosen // 4 ==> enter the tool (create if necessary) // 3 ==> property sheet box // // Return Value: // None. // global proc string artAttrColorPerVertexToolScript( int $setToTool ) // // Description : // 4 ==> enter the tool { // Poly color per vertex Paint Tool. string $tool = "artAttrColorPerVertexContext"; makePaintable -activateAll false; makePaintable -activate true "mesh" "vertexFaceColorRGB" ; makePaintable -activate true "mesh" "vertexColorRGB" ; if( ! `artAttrPaintVertexCtx -exists $tool` ) { rememberCtxSettings `artAttrPaintVertexCtx -i1 "paintVertexColour.xpm" -whichTool "colorPerVertex" $tool`; } // Enter color-per-vertex shaded mode if the switch indicates so // if (`optionVar -q polyAutoShowColorPerVertex`) { optionVar -intValue colorShadedDisplay 1 -intValueAppend colorShadedDisplay 1; DisplaySmoothShaded; polyOptions -cs 1; } // turn off color feedback and clamping $res = `artAttrPaintVertexCtx -e -colorfeedback false -clamp none $tool` ; setToolTo $tool; if( 3 == $setToTool ) { toolPropertyWindow; } else if( 4 != $setToTool && 5 != $setToTool && 6 != $setToTool) { warning( "Wrong input for artAttrColorPerVertexToolScript" ); } switch ( $setToTool ) { case 5 : // vertex artAttrPaintVertexCtx -e -paintComponent 1 `currentCtx` ; break ; case 6 : // vertex face artAttrPaintVertexCtx -e -paintComponent 2 `currentCtx` ; break ; case 7 : // face artAttrPaintVertexCtx -e -paintComponent 3 `currentCtx` ; break ; } return $tool; }