// =========================================================================== // 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: Nov 2002 // // Description: // Option tool property window for Paint Color Per Vertex tool. // // Procedure Name: // artAttrColorPerVertexProperties // // Description: // Initialize the UI for Color per Vertex tool. // // Input Arguments: // // Return Value: // None. // proc artColorPerVertexCreateOperFrame() // // Custom UI for Color Per Vertex tool. // { string $artCommonOpFrame = `frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kColor")) -collapsable true -collapse false artCommonOperationFrame`; setUITemplate -pushTemplate OptionsTemplate; setParent $artCommonOpFrame; columnLayout; separator -h 3 -style "none"; string $replace = (uiRes("m_artAttrColorPerVertexProperties.kReplace")); string $smooth = (uiRes("m_artAttrColorPerVertexProperties.kSmooth")); string $remove = (uiRes("m_artAttrColorPerVertexProperties.kRemove")); string $add = (uiRes("m_artAttrColorPerVertexProperties.kAdd")); string $scale = (uiRes("m_artAttrColorPerVertexProperties.kScale")); string $subtract = (uiRes("m_artAttrColorPerVertexProperties.kSubtract")); // Paint Operation radioButtonGrp -nrb 3 -label (uiRes("m_artAttrColorPerVertexProperties.kOperation")) -cw4 100 67 85 65 -labelArray3 $replace $smooth $remove -sl 1 artAttrColorOperationChoices0; radioButtonGrp -shareCollection artAttrColorOperationChoices0 -nrb 3 -label "" -cw4 100 67 85 65 -labelArray3 $add $subtract $scale -sl 1 artAttrColorOperationChoices1; separator -h 3 -style "none"; string $vertex = (uiRes("m_artAttrColorPerVertexProperties.kVertex")); string $vertexface = (uiRes("m_artAttrColorPerVertexProperties.kVertexFace")); // Vertex / Face / Vertex Face radioButtonGrp -nrb 3 -label (uiRes("m_artAttrColorPerVertexProperties.kPaint")) -cw4 100 67 85 65 -labelArray3 $vertex $vertexface (uiRes("m_artAttrColorPerVertexProperties.kFace")) -sl 1 -annotation (uiRes("m_artAttrColorPerVertexProperties.kPaintAnnotation")) artAttrColorPaintChoices; separator -h 3 -style "none"; string $rgb = (uiRes("m_artAttrColorPerVertexProperties.kRGB")); string $rgba = (uiRes("m_artAttrColorPerVertexProperties.kRGBA")); string $a = (uiRes("m_artAttrColorPerVertexProperties.kA")); // Channels radioButtonGrp -nrb 3 -label (uiRes("m_artAttrColorPerVertexProperties.kChannels")) -cw4 100 67 85 65 -la3 $rgb $rgba $a -sl 1 -cc "artAttrColorPerVertexChannels(\"artAttrPaintVertexCtx\")" -annotation (uiRes("m_artAttrColorPerVertexProperties.kRGBAnnotation")) artAttrColorChannelChoices; separator -h 3 -style "none"; // Paint color value rowColumnLayout -nc 2 -cw 1 343 -cw 2 20; colorSliderGrp -label (uiRes("m_artAttrColorPerVertexProperties.kColorValue")) -annotation (uiRes("m_artAttrColorPerVertexProperties.kColorAnnotation")) -cw 2 62 -cw 3 132 colorPerVertexColor; symbolButton -image "eyeDropper.png" artAttrColorPick; setParent .. ; separator -h 3 -style "none"; // Alpha Value floatSliderGrp -field true -label (uiRes("m_artAttrColorPerVertexProperties.kAlphaValue")) -cal 1 "right" -pre 3 -min 0 -max 1 -step 0.05 -cw3 80 55 140 -fieldMinValue -10000000000000000000000000000000000000000.0 -fieldMaxValue 10000000000000000000000000000000000000000.0 -columnAttach3 "both" "both" "both" -value 1.0 -en false -annotation (uiRes("m_artAttrColorPerVertexProperties.kAlphaChannelAnnotation")) colorPerVertexAlpha; separator -h 5 -style "none"; // Clamp paint value options. string $lower = (uiRes("m_artAttrColorPerVertexProperties.kLower")); string $upper = (uiRes("m_artAttrColorPerVertexProperties.kUpper")); checkBoxGrp -ncb 2 -label (uiRes("m_artAttrColorPerVertexProperties.kPaintClamp")) -cw3 131 68 68 -labelArray2 $lower $upper -annotation (uiRes("m_artAttrColorPerVertexProperties.kClampPaint")) -enable true artAttrClampChkBox; floatFieldGrp -label (uiRes("m_artAttrColorPerVertexProperties.kClampValues")) -numberOfFields 2 -annotation (uiRes("m_artAttrColorPerVertexProperties.kLowerUpperClampAnnot")) -precision 4 -enable true -value1 0.0 -value2 1.0 artAttrClampField; separator -h 15 -style "none"; // Alpha Tools Section // frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kAlphaTools")) -collapsable true -collapse true artAlphaToolsFrame; setParent artAlphaToolsFrame; columnLayout; // Alpha Min/Max Value: floatFieldGrp -label (uiRes("m_artAttrColorPerVertexProperties.kMinMaxAlphaValue")) -numberOfFields 2 -annotation (uiRes("m_artAttrColorPerVertexProperties.kMinMaxAlphaValueAnnot")) -precision 4 -value1 0.0 -value2 1.0 colorPerVertexMinMaxAlphaValue; separator -h 5 -style "none"; // Alpha Clamp Options checkBoxGrp -ncb 2 -label (uiRes("m_artAttrColorPerVertexProperties.kAlphaClamp")) -cw3 131 68 68 -labelArray2 $lower $upper -annotation (uiRes("m_artAttrColorPerVertexProperties.kAlphaClampPaint")) -enable true artAttrAlphaClampChkBox; // Alpha Clamp Values floatFieldGrp -label (uiRes("m_artAttrColorPerVertexProperties.kAlphaClampValues")) -numberOfFields 2 -annotation (uiRes("m_artAttrColorPerVertexProperties.kLowerUpperAlphaClampAnnot")) -precision 4 -enable true -value1 0.0 -value2 1.0 artAttrAlphaClampField; setParent ..; setParent ..; separator -h 15 -style "none"; // Flood rowColumnLayout -nc 1 -cs 1 100 -cw 1 200; button -label (uiRes("m_artAttrColorPerVertexProperties.kFlood")) -annotation (uiRes("m_artAttrColorPerVertexProperties.kFloodAnnotation")) artAttrColorFloodButton; setParent ..; setParent ..; setUITemplate -popTemplate; setParent ..; } // ======================================================= // Main Procedure. // ======================================================= global proc artAttrColorPerVertexProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artAttrProperties.mel"; source "artAttrColorPerVertexCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; setUITemplate -pushTemplate DefaultTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true artAttrColorPerVertex; // Brush frameLayout. frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kBrush")) -collapsable true -collapse false artAttrColorPerVertexBrushFrame; // Create brush option menu. artisanCreateBrushFrame( "artAttrColorPerVertexBrushFrame", $currTool ); setParent ..; // create the color and alpha value controls artColorPerVertexCreateOperFrame(); // Stroke options. frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kStroke")) -collapsable true -collapse true artAttrColorPerVertexStrokeFrame; // Create stroke options. artisanCreateStrokeFrame( "artAttrColorPerVertexStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kStylusPressure")) -collapsable true -collapse true artAttrColorPerVertexPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artAttrColorPerVertexPressureFrame", $currTool ); setParent ..; // Attribute Maps options. string $artAttrColorPerVertexAttrMapFrame = `frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kAttributeMaps")) -collapsable true -collapse true artAttrColorPerVertexAttrMapFrame`; // Create Attribute Map option menu. artisanCreateAttrMapFrame( $artAttrColorPerVertexAttrMapFrame, $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artAttrColorPerVertexProperties.kDisplay")) -collapsable true -collapse true artAttrColorPerVertexDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artAttrColorPerVertexDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; // Set the callbacks and various global functions. artAttrColorPerVertexCallback( "artAttrPaintVertexCtx" ); }