// =========================================================================== // 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. // =========================================================================== // Sculpt Paint Tools UI script // global proc artPuttyCreateOperationFrame( string $parent, string $currTool ) { float $artSculptBigFloat = 100000000.0; setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout; // // Sculpt Operation frameLayout // columnLayout artSculptOperationLayout; separator -h 5 -style "none"; rowColumnLayout -nc 8 -cw 1 100 -cw 2 35 -cw 3 35 -cw 4 35 -cw 5 35 -cw 6 35 -cw 7 35 -cw 8 35 ; text -al "right" -label (uiRes("m_artPuttyProperties.kSculptOperation")) ; symbolCheckBox -h 36 -i "sculptPush.png" -ann (uiRes("m_artPuttyProperties.kSculptPush")) artPuttyPushIcon; symbolCheckBox -h 36 -i "sculptPull.png" -ann (uiRes("m_artPuttyProperties.kSculptPull")) artPuttyPullIcon; symbolCheckBox -h 36 -i "sculptSmooth.png" -ann (uiRes("m_artPuttyProperties.kSculptSmooth")) artPuttySmoothIcon; symbolCheckBox -h 36 -i "sculptRelax.png" -ann (uiRes("m_artPuttyProperties.kSculptRelax")) artPuttyRelaxIcon; symbolCheckBox -h 36 -i "sculptPinch.png" -ann (uiRes("m_artPuttyProperties.kSculptPinch")) artPuttyPinchIcon; symbolCheckBox -h 36 -i "sculptSlide.png" -ann (uiRes("m_artPuttyProperties.kSculptSlide")) artPuttySlideIcon; symbolCheckBox -h 36 -i "sculptErase.png" -ann (uiRes("m_artPuttyProperties.kSculptErase")) artPuttyEraseIcon; setParent ..; separator -h 5 -style "none"; setParent ..; // // Brush Strength frameLayout // columnLayout artPuttyBrushStrengthLayout; floatSliderGrp -field true -label (uiRes("m_artPuttyProperties.kBrushStrength")) -columnAlign3 "left" "left" "left" -cw3 60 35 120 -min 1 -max 100 artPuttyBrushStrength; separator -h 10 -style "none"; setParent ..; // // Auto Smooth frameLayout // columnLayout artPuttySmoothStrengthLayout; checkBoxGrp -label "" -label1 (uiRes("m_artPuttyProperties.kAutoSmooth")) -cal 1 "right" autoSmooth; intSliderGrp -field true -label (uiRes("m_artPuttyProperties.kSmoothStrength")) -columnAlign3 "left" "left" "left" -cw3 60 35 120 -min 1 -max 10 smoothStrength; separator -h 10 -style "none"; setParent ..; // // Sculpt Variables frameLayout // columnLayout ReferenceLayout; radioButtonGrp -label (uiRes("m_artPuttyProperties.kReferenceVector")) -nrb 3 -cw4 130 75 95 80 -label1 (uiRes("m_artPuttyProperties.kNormal")) -label2 (uiRes("m_artPuttyProperties.kFirstNormal")) -label3 (uiRes("m_artPuttyProperties.kView")) rv0Radio; radioButtonGrp -label "" -scl rv0Radio -nrb 3 -cw4 130 75 95 80 -label1 (uiRes("m_artPuttyProperties.kXAxis")) -label2 (uiRes("m_artPuttyProperties.kYAxis")) -label3 (uiRes("m_artPuttyProperties.kZAxis")) rv1Radio; radioButtonGrp -label "" -scl rv0Radio -nrb 3 -cw4 130 75 95 80 -label1 (uiRes("m_artPuttyProperties.kUAxis")) -label2 (uiRes("m_artPuttyProperties.kVAxis")) -label3 (uiRes("m_artPuttyProperties.kUVAxis")) rv2Radio; rowColumnLayout -nc 2 -cw 1 133 -cw 2 183 -cal 2 "center" rvUVLayout; button -rs false -w 133 -vis false -c ""; // dummy button - space filler checkBox -l (uiRes("m_artPuttyProperties.kEnableUVAxis")) -onc "enableAdjustUVVector()" -ofc "disableAdjustUVVector()" -v 0 -vis true -w 183 -ann (uiRes("m_artPuttyProperties.kUVAxisAnnot")) rvUVVect; setParent ..; separator -h 10 -style "none"; rowColumnLayout -nc 2 -cw 1 330 -cw 2 20 ; floatSliderGrp -field true -label (uiRes("m_artPuttyProperties.kMaxDisplacement")) -precision 4 -step 0.05 -min 0.0 -fmn 0.0 -max 5.0 -fmx $artSculptBigFloat maxDisp; setParent ..; rowColumnLayout -nc 2 -cw 1 330 -cw 2 20 ; floatSliderGrp -field true -label (uiRes("m_artPuttyProperties.kSeamPoleToleranc")) -precision 4 -min 0.0001 -max 1.0 -value 0.05 collapseCVTol; setParent ..; separator -h 10 -style "none"; // Flood rowColumnLayout -nc 1 -cs 1 133 -cw 1 183; button -label (uiRes("m_artPuttyProperties.kFlood")) -annotation (uiRes("m_artPuttyProperties.kFloodSurfaceAnnot")) artPuttyFloodButton; setParent ..; setParent ..; // separator -h 5 -style "none"; separator -h 5 -style "single"; separator -h 5-style "none"; // Surface frameLayout // string $updateStroke = (uiRes("m_artPuttyProperties.kUpdateonStroke")); string $update = (uiRes("m_artPuttyProperties.kUpdate")); rowColumnLayout -nc 3 -cw 1 133 -cw 2 155 -cw 3 70; text -al "right" -label (uiRes("m_artPuttyProperties.kReferencesurface")) ; checkBox -label $updateStroke refSurfaceChk; button -label $update updateButton; text -al "right" -label (uiRes("m_artPuttyProperties.kEraseSurface")) ; checkBox -label $updateStroke eraseSurfaceChk; button -label $update eraseSurfaceButton; setParent ..; separator -h 5-style "none"; setParent ..; setUITemplate -popTemplate; } global proc artPuttyProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artisanProperties.mel"; source "artisanCallback.mel"; source "artisanValues.mel"; source "artAttrProperties.mel"; source "artPuttyCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; setUITemplate -pushTemplate DefaultTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true artPutty; // Brush frameLayout. frameLayout -label (uiRes("m_artPuttyProperties.kBrush")) -collapsable true -collapse false artPuttyBrushFrame; // Create brush option menu. artisanCreateBrushFrame( "artPuttyBrushFrame", $currTool ); setParent ..; // putty Operation options. frameLayout -label (uiRes("m_artPuttyProperties.kSculptParameters")) -collapsable true -collapse false artPuttyOperationFrame; // Create Display options. artPuttyCreateOperationFrame( "artPuttyOperationFrame", $currTool ); setParent ..; // Stroke options. frameLayout -label (uiRes("m_artPuttyProperties.kStroke")) -collapsable true -collapse true artPuttyStrokeFrame; // Create stroke options. artisanCreateStrokeFrame( "artPuttyStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artPuttyProperties.kStylusPressure")) -collapsable true -collapse true artPuttyPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artPuttyPressureFrame", $currTool ); setParent ..; // Attribute Maps options. frameLayout -label (uiRes("m_artPuttyProperties.kAttributeMaps")) -collapsable true -collapse true artAttrAttrMapFrame; // Create Attribute Map option menu. artisanCreateAttrMapFrame( "artAttrAttrMapFrame", $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artPuttyProperties.kDisplay")) -collapsable true -collapse true artPuttyDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artPuttyDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; // Set the callbacks and various global functions. artPuttyCallback( "artPuttyCtx" ); } // Utility method // global proc enableAdjustUVVector() { string $ctx = `currentCtx`; if( `artBaseCtx -q -dragSlider $ctx` == "none" ) { artActivateScreenSlider( "uv_vector" ); if( !`checkBox -q -v rvUVVect` ) { checkBox -e -v 1 rvUVVect; } } } global proc disableAdjustUVVector() { string $ctx = `currentCtx`; if( `artBaseCtx -q -dragSlider $ctx` == "uvvector" ) { artDeactivateScreenSlider; if( `checkBox -q -v rvUVVect` ) { checkBox -e -v 0 rvUVVect; } } }