// =========================================================================== // 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: June 2000 // // Description: // Option tool property window for Attribute Paint tool. // // // Procedure Name: // artAttrProperties // // Description: // Initialize the UI for Attribute Paint tool. // // Input Arguments: // // Return Value: // None. // global proc artAttrCreateCommonProperties() // // Common Attribute Paint UI - operation, value, clamping. // { // Paint Operation. string $attribPaint = (uiRes("m_artAttrProperties.kAttribPaintAnnot")); radioButtonGrp -nrb 2 -cw 3 77 -label (uiRes("m_artAttrProperties.kPaintOperation")) -label1 (uiRes("m_artAttrProperties.kReplace")) -label2 (uiRes("m_artAttrProperties.kAdd")) -annotation $attribPaint artAttrOperRadioButton0; radioButtonGrp -shareCollection artAttrOperRadioButton0 -cw 3 77 -nrb 2 -label "" -label1 (uiRes("m_artAttrProperties.kScale")) -label2 (uiRes("m_artAttrProperties.kSmooth")) -annotation $attribPaint artAttrOperRadioButton1; separator -h 10 -style "none"; // Value Range. rowColumnLayout -nc 2 -cw 1 320 -cw 2 20 ; // Value Range. floatSliderGrp -field true -label (uiRes("m_artAttrProperties.kValue")) -cw 3 100 -annotation (uiRes("m_artAttrProperties.kPaintValueAnnot")) -precision 4 -min 0.0 -max 1.0 -value 1.0 -step 0.05 artAttrValueSlider; symbolButton -image "eyeDropper.png" artAttrValuePick; setParent .. ; floatFieldGrp -label (uiRes("m_artAttrProperties.kMinMaxValue")) -numberOfFields 2 -annotation (uiRes("m_artAttrProperties.kMinMaxValueAnnot")) -precision 4 -value1 0.0 -value2 1.0 artAttrMinMaxValue; separator -h 5 -style "none"; // Clamp options. string $lower = (uiRes("m_artAttrProperties.kLower")); string $upper = (uiRes("m_artAttrProperties.kUpper")); checkBoxGrp -ncb 2 -label (uiRes("m_artAttrProperties.kClamp")) -cw3 131 68 68 -labelArray2 $lower $upper - annotation (uiRes("m_artAttrProperties.kClampPaint")) artAttrClampChkBox; floatFieldGrp -label (uiRes("m_artAttrProperties.kClampValues")) -numberOfFields 2 -annotation (uiRes("m_artAttrProperties.kLowerUpperClampAnnot")) -precision 4 -value1 0.0 -value2 1.0 artAttrClampField; separator -h 15 -style "none"; // Flood rowColumnLayout -nc 1 -cs 1 100 -cw 1 200; button -label (uiRes("m_artAttrProperties.kFlood")) -annotation (uiRes("m_artAttrProperties.kFloodSelectedAnnot")) artAttrFloodButton; setParent ..; } global proc artAttrCreateOperFrame( string $parent, string $currTool ) // // UI for generic Attribute Paint Tool - Attribute Paint tool, // Paint Weights tool and others. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout; separator -h 5 -style "none"; // Paintable Attribute Menu. rowColumnLayout -nc 1 -cs 1 100 -cw 1 200; button -label (uiRes("m_artAttrProperties.kNoAttribute")) -annotation (uiRes("m_artAttrProperties.kListPaintableAnnot")) artAttrListButton; popupMenu -button 1 artAttrListPopupMenu; button -label (uiRes("m_artAttrToolScript.kFilterAll")) -annotation (uiRes("m_artAttrProperties.kListPaintableNodesAnnot")) artAttrFilterButton; popupMenu -button 1 artAttrNodeFiterMenu; menuItem -label "cluster" artAttrFilterMenu1; menuItem -label "jiggle" artAttrFilterMenu2; menuItem -label "particle" artAttrFilterMenu3; menuItem -label "polyReduce" artAttrFilterMenu4; menuItem -label "wire" artAttrFilterMenu5; menuItem -label "transferAttributes" artAttrFilterMenu6; menuItem -label "shrinkWrap" artAttrFilterMenu7; menuItem -label (uiRes("m_artAttrProperties.kAll")) artAttrFilterMenu8; setParent ..; separator -h 10 -style "none"; // Put all the common stuff. artAttrCreateCommonProperties(); separator -h 10 -style "none"; // Vector index to paint. optionMenuGrp -label (uiRes("m_artAttrProperties.kVectorIndex")) -annotation (uiRes("m_artAttrProperties.kVectorIndexAnnot")) artAttrVectorIdxOptionMenu; menuItem -label (uiRes("m_artAttrProperties.kXR")) artAttrIdxMenuItem0; menuItem -label (uiRes("m_artAttrProperties.kYG")) artAttrIdxMenuItem1; menuItem -label (uiRes("m_artAttrProperties.kZB")) artAttrIdxMenuItem2; separator -h 5 -style "none"; setParent ..; setUITemplate -popTemplate; } // ======================================================= // Main Procedure. // ======================================================= global proc artAttrProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artisanProperties.mel"; source "artisanCallback.mel"; source "artAttrCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; string $whichTool = `artAttrCtx -q -whichTool $currContext`; setUITemplate -pushTemplate DefaultTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true artAttr; // Brush frameLayout. frameLayout -label (uiRes("m_artAttrProperties.kBrush")) -collapsable true -collapse false artAttrBrushFrame; // Create brush option menu. artisanCreateBrushFrame( "artAttrBrushFrame", $currTool ); setParent ..; // Paint Attribute operation frameLayout. frameLayout -label (uiRes("m_artAttrProperties.kPaintAttributes")) -collapsable true -collapse false artAttrOperationFrame; // Create Paint Attribute operation menu. artAttrCreateOperFrame( "artAttrOperationFrame", $currTool ); setParent ..; // Stroke options. frameLayout -label (uiRes("m_artAttrProperties.kStroke")) -collapsable true -collapse true artAttrStrokeFrame; // Create stroke options. artisanCreateStrokeFrame( "artAttrStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artAttrProperties.kStylusPressure")) -collapsable true -collapse true artAttrPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artAttrPressureFrame", $currTool ); setParent ..; // Attribute Maps options. frameLayout -label (uiRes("m_artAttrProperties.kAttributeMaps")) -collapsable true -collapse true artAttrAttrMapFrame; // Create Attribute Map option menu. artisanCreateAttrMapFrame( "artAttrAttrMapFrame", $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artAttrProperties.kDisplay")) -collapsable true -collapse true artAttrDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artAttrDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; // Set the callbacks and various global functions. artAttrCallback( "artAttrCtx" ); }