// =========================================================================== // 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 Skin Paint Weight tool. // // Procedure Name: // artAttrSkinProperties // // Description: // Initialize the UI for Skin Paint Weight tool. // // Input Arguments: // // Return Value: // None. // proc artSkinCreateOperFrame(string $parent, string $currTool) // // Creates the widgets for the Influences section of Paint Skin Weights tool. // { string $toolLayout = `formLayout`; global string $gArtSkinInfluencesList; source skinClusterInflMenu; string $rebuildJointListCmd = "artAttrSkinJointMenuRebuild( \"artAttrSkinPaintCtx\" )"; $gArtSkinInfluencesList = skinClusterInflBuildList( 100, 200, $rebuildJointListCmd ); separator -h 5 -style "none"; // Action buttons string $buttons = `rowColumnLayout -nc 8 -cw 1 80 -cw 2 30 -cw 3 30 -cw 4 30 -cw 5 30 -cw 6 30 -cw 7 80 -cw 8 30 -cat 7 "right" 0`; columnLayout; setParent ..; symbolButton -image "skinWeightCopy.png" -w 20 -h 20 -annotation (uiRes("m_artAttrSkinProperties.kSkinWeightCopyAnnot")) artAttrSkinWeightCopyButton; symbolButton -image "skinWeightPaste.png" -w 20 -h 20 -annotation (uiRes("m_artAttrSkinProperties.kSkinWeightPasteAnnot")) artAttrSkinWeightPasteButton; symbolButton -image "weightHammer.png" -w 20 -h 20 -annotation (uiRes("m_artAttrSkinProperties.kHammerAnnot")) artAttrHammerButton; symbolButton -image "moveVertexWeights.png" -w 20 -h 20 -annotation (uiRes("m_artAttrSkinProperties.kMoveInfluenceAnnot")) artAttrMoveInfluenceButton; symbolButton -image "showInfluence.png" -w 20 -h 20 -annotation (uiRes("m_artAttrSkinProperties.kShowInfluenceAnnot")) artAttrShowInfluenceButton; symbolButton -w 20 -h 20 -image "revealSelected.png" -annotation (uiRes("m_artAttrSkinProperties.kSkinPaintRevealSelectedAnnot")) artSkinRevealSelectedButton; symbolButton -w 20 -h 20 -image "invertSelection.png" -annotation (uiRes("m_artAttrSkinProperties.kSkinPaintInvertSelectionAnnot")) artSkinInvertSelection; columnLayout; setParent ..; setParent ..; // $buttons string $childs[] = `formLayout -q -ca $toolLayout`; // To retrieve the Layout created by skinClusterInflBuildList formLayout -e -af $buttons "left" 20 -af $buttons "right" 20 -af $buttons "bottom" 0 -af $childs[0] "left" 20 -af $childs[0] "right" 20 -af $childs[0] "top" 0 -ac $childs[0] "bottom" 0 $buttons $toolLayout; setParent ..; // $toolLayout; } global proc artAttrCreateSkinPaintWeightsProperties() // // Common Attribute Paint UI - operation, value, clamping. // { columnLayout; string $skinPaintModeStr = (uiRes("m_artAttrSkinProperties.kSkinPaintModeAnnot")); radioButtonGrp -nrb 3 -cw 2 65 -cw 3 65 -label (uiRes("m_artAttrSkinProperties.kSkinPaintMode")) -label1 (uiRes("m_artAttrSkinProperties.kSkinPaint")) -label2 (uiRes("m_artAttrSkinProperties.kSkinSelect")) -label3 (uiRes("m_artAttrSkinProperties.kSkinPaintSelect")) -select 1 -annotation $skinPaintModeStr artAttrSkinPaintModeRadioButton; radioButtonGrp -nrb 3 -cw 2 65 -cw 3 65 -label (uiRes("m_artAttrSkinProperties.kSkinPaintSelectMode")) -label1 (uiRes("m_artAttrSkinProperties.kSkinPaintSelectAdd")) -label2 (uiRes("m_artAttrSkinProperties.kSkinPaintSelectRemove")) -label3 (uiRes("m_artAttrSkinProperties.kSkinPaintSelectToggle")) -select 1 artAttrSkinPaintSelectModeRadioButton; rowColumnLayout -nc 3 -cw 1 130 -cw 2 180 -cw 3 30; columnLayout; setParent .. ; button -label (uiRes("m_artAttrSkinProperties.kSkinSelectGeometry")) -annotation (uiRes("m_artAttrSkinProperties.kSkinSelectGeometryAnnot")) artSkinSelectGeometry; columnLayout; setParent .. ; setParent .. ; // Paint Operation. string $attribPaint = (uiRes("m_artAttrSkinProperties.kAttribPaintAnnot")); radioButtonGrp -nrb 2 -cw 2 132 -label (uiRes("m_artAttrSkinProperties.kPaintOperation")) -label1 (uiRes("m_artAttrSkinProperties.kReplace")) -label2 (uiRes("m_artAttrSkinProperties.kAdd")) -annotation $attribPaint artAttrOperRadioButton0; radioButtonGrp -shareCollection artAttrOperRadioButton0 -cw 2 132 -nrb 2 -label "" -label1 (uiRes("m_artAttrSkinProperties.kScale")) -label2 (uiRes("m_artAttrSkinProperties.kSmooth")) -annotation $attribPaint artAttrOperRadioButton1; rowColumnLayout -nc 7 -cw 1 130 -cw 2 35 -cw 3 35 -cw 4 35 -cw 5 35 -cw 6 35 -cs 6 10 -cw 7 26 -cs 7 10; text -al "right" -label (uiRes("m_artAttrSkinProperties.kProfile")) -annotation (uiRes("m_artAttrSkinProperties.kProfileAnnot")) profileText; symbolCheckBox -w 35 -h 36 -i "circleGaus.png" -annotation (uiRes("m_artAttrSkinProperties.kGaussian")) spGaussianChBx; symbolCheckBox -w 35 -h 36 -i "circlePoly.png" -annotation (uiRes("m_artAttrSkinProperties.kSoft")) spPolyBrushChBx; symbolCheckBox -w 35 -h 36 -i "circleSolid.png" -annotation (uiRes("m_artAttrSkinProperties.kSolid")) spSolidChBx; symbolCheckBox -w 35 -h 36 -i "rect.png" -annotation (uiRes("m_artAttrSkinProperties.kSquare")) spRectBrushChBx; symbolCheckBox -w 35 -h 36 -i "file.png" -annotation (uiRes("m_artAttrSkinProperties.kLastImage")) artFileBrushChBx; symbolButton -image "navButtonBrowse.png" -w 26 -h 26 -annotation (uiRes("m_artAttrSkinProperties.kBrowseAnnot")) spShapeButton; setParent ..; separator -h 5 -style "none"; rowColumnLayout -nc 2 -cw 1 320 -cw 2 20 ; optionMenuGrp -l (uiRes("m_artAttrSkinProperties.kSkinWeightType")) artAttrSkinWeightType; menuItem -label (uiRes("m_artAttrSkinProperties.kSkinWeightTypeSkinWeight")); menuItem -label (uiRes("m_artAttrSkinProperties.kSkinWeightTypeDQBlendWeight")); separator -h 5 -style "none"; optionMenuGrp -l (uiRes("m_artAttrSkinProperties.kSkinWeightNormalizationMode")) artAttrSkinNormalizationMode; menuItem -label (uiRes("m_artAttrSkinProperties.kSkinWeightNormalizationModeOff")); menuItem -label (uiRes("m_artAttrSkinProperties.kSkinWeightNormalizationModeInteractive")); menuItem -label (uiRes("m_artAttrSkinProperties.kSkinWeightNormalizationModePost")); separator -h 5 -style "none"; floatSliderGrp -field true -label (uiRes("m_artAttrSkinProperties.kOpacity")) -cw 3 100 -annotation (uiRes("m_artAttrSkinProperties.kOpacityAnnot")) -precision 4 -min 0.0 -max 1.0 -step 0.05 opacitySlider; columnLayout; setParent .. ; setParent .. ; separator -h 5 -style "none"; // Value Range. rowColumnLayout -nc 2 -cw 1 320 -cw 2 20 ; // Value Range. floatSliderGrp -field true -label (uiRes("m_artAttrSkinProperties.kValue")) -cw 3 100 -annotation (uiRes("m_artAttrSkinProperties.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_artAttrSkinProperties.kMinMaxValue")) -numberOfFields 2 -annotation (uiRes("m_artAttrSkinProperties.kMinMaxValueAnnot")) -precision 4 -value1 0.0 -value2 1.0 artAttrMinMaxValue; rowColumnLayout -nc 3 -cw 1 130 -cw 2 180 -cw 3 30; columnLayout; setParent .. ; button -label (uiRes("m_artAttrSkinProperties.kSkinFloodSelected")) -annotation (uiRes("m_artAttrSkinProperties.kFloodSelectedAnnot")) artAttrFloodButton; columnLayout; setParent ..; setParent .. ; setParent .. ; } // ======================================================= // Main Procedure. // ======================================================= global proc artAttrSkinProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artisanProperties.mel"; source "artisanCallback.mel"; source "artAttrProperties.mel"; source "artAttrSkinCallback.mel"; source "artisanRampCallback.mel"; // The soft select tool interferes with the visual feedback for skin weights. // turn it off here (bug 323614): softSelect -e -softSelectEnabled false; // Whether or not to sort the influences is controlled by an optionVar // int $sortList = 2; if (`optionVar -exists sortSkinPaintList`) { $sortList = `optionVar -query sortSkinPaintList`; } else { // by default use connection order // optionVar -iv sortSkinPaintList 2; } string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; setUITemplate -pushTemplate DefaultTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true artAttrSkin; // Tool Settings frameLayout. string $frame = `frameLayout -label (uiRes("m_artAttrSkinProperties.kInfluence")) -collapsable true -collapse false`; // Create operation menu. artSkinCreateOperFrame($frame, $currTool ); setUITemplate -pushTemplate OptionsTemplate; setParent $frame; artAttrCreateSkinPaintWeightsProperties(); setUITemplate -popTemplate; setParent ..; frameLayout -label (uiRes("m_artAttrSkinProperties.kGradient")) -collapsable true -collapse false artGradientFrame; setUITemplate -pushTemplate OptionsTemplate; setParent artGradientFrame; artisanCreateRamp("artGradientFrame", 1 ); setUITemplate -popTemplate; setParent ..; // Stroke options. frameLayout -label (uiRes("m_artAttrSkinProperties.kStroke")) -collapsable true -collapse true artAttrSkinStrokeFrame; columnLayout -adj true; floatSliderGrp -field true -label (uiRes("m_artAttrSkinProperties.kRadiusU")) -annotation (uiRes("m_artAttrSkinProperties.kRadiusUAnnot")) -precision 4 -min 0.0 -max 50.0 -fieldMaxValue 500.0 -step 0.05 -cw 1 130 -cw 2 65 upperRadiusSlider; floatSliderGrp -field true -label (uiRes("m_artAttrSkinProperties.kRadiusL")) -annotation (uiRes("m_artAttrSkinProperties.kRadiusLAnnot")) -precision 4 -min 0.0 -max 50.0 -fieldMaxValue 500.0 -step 0.05 -cw 1 130 -cw 2 65 lowerRadiusSlider; setParent ..; // Create stroke options. artisanCreateStrokeFrame( "artAttrSkinStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artAttrSkinProperties.kStylusPressure")) -collapsable true -collapse true artAttrSkinPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artAttrSkinPressureFrame", $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artAttrSkinProperties.kDisplay")) -collapsable true -collapse true artAttrSkinDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artAttrSkinDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; global string $gArtSkinInfluencesList; artAttrSkinJointMenu( $gArtSkinInfluencesList, "artAttrSkinPaintCtx" ); // Set the callbacks and various global functions. artAttrSkinCallback( "artAttrSkinPaintCtx" ); artisanRampCallback( "artAttrSkinPaintCtx" ); //Always start the tool in paint mode. artAttrSkinPaintCtx -e -skinPaintMode 1 $currContext; }