// =========================================================================== // 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 Artisan tools // // // Procedure Name: // artisanProperties // // Description: // Initialize the option values. // // Input Arguments: // // Return Value: // None. // global proc artisanCreateBrushFrame( string $parent, string $currTool ) // // Description: // Create Artisan brush options. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kRadiusU")) -annotation (uiRes("m_artisanProperties.kRadiusUAnnot")) -precision 4 -min 0.0 -max 50.0 -fieldMaxValue 500.0 -step 0.05 upperRadiusSlider; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kRadiusL")) -annotation (uiRes("m_artisanProperties.kRadiusLAnnot")) -precision 4 -min 0.0 -max 50.0 -fieldMaxValue 500.0 -step 0.05 lowerRadiusSlider; if ( $currTool != "artSelect" ) { floatSliderGrp -field true -label (uiRes("m_artisanProperties.kOpacity")) -annotation (uiRes("m_artisanProperties.kOpacityAnnot")) -precision 4 -min 0.0 -max 1.0 -step 0.05 opacitySlider; if ( isOpacityAccumulationRequired() ) { checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kAccumulateOpacity")) -annotation (uiRes("m_artisanProperties.kAccumulateOpacityAnnot")) accOpacityChkBox; } } separator; rowColumnLayout -nc 7 -cw 1 100 -cw 2 35 -cw 3 35 -cw 4 35 -cw 5 35 -cw 6 35 -cs 6 10 -cw 7 26 -cs 7 10 profileLayout; text -al "right" -label (uiRes("m_artisanProperties.kProfile")) -annotation (uiRes("m_artisanProperties.kProfileAnnot")) profileText; symbolCheckBox -w 35 -h 36 -i "circleGaus.png" -annotation (uiRes("m_artisanProperties.kGaussian")) spGaussianChBx; symbolCheckBox -w 35 -h 36 -i "circlePoly.png" -annotation (uiRes("m_artisanProperties.kSoft")) spPolyBrushChBx; symbolCheckBox -w 35 -h 36 -i "circleSolid.png" -annotation (uiRes("m_artisanProperties.kSolid")) spSolidChBx; symbolCheckBox -w 35 -h 36 -i "rect.png" -annotation (uiRes("m_artisanProperties.kSquare")) spRectBrushChBx; symbolCheckBox -w 35 -h 36 -i "file.png" -annotation (uiRes("m_artisanProperties.kLastImage")) artFileBrushChBx; symbolButton -w 26 -h 26 -image "navButtonBrowse.png" -annotation (uiRes("m_artisanProperties.kBrowseAnnot")) spShapeButton; // Instead of giving a "none" style separator for adding some spacing, we use row attach // which is better when under the flat UI. rowColumnLayout -e -rowAttach 1 "bottom" 5 profileLayout; setParent ..; separator; checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kRotateStroke")) -annotation (uiRes("m_artisanProperties.kRotateStrokeAnnot")) artBrushAlignmentChkBox; setParent ..; setUITemplate -popTemplate; } global proc artisanCreateStrokeFrame( string $parent, string $currTool ) // // Description: // Create a stroke UI for all Artisan tools. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; int $toolSupportsReflection = ($currTool != "artAttrSkin"); columnLayout -adj true; // Projective Paint Mode checkbox. checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kScreenProjection")) -annotation (uiRes("m_artisanProperties.kScreenProjectionAnnot")) artProjectionModeChkBox; // Reflection Mode. checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kReflection")) -annotation (uiRes("m_artisanProperties.kReflectionAnnot")) -enable $toolSupportsReflection artReflectionModeChkBox; // Reflection Mode. checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kReflectionAboutOrigin")) -annotation (uiRes("m_artisanProperties.kReflectionAboutOriginAnnot")) -enable $toolSupportsReflection artReflectionModeAboutOriginChkBox; // Reflection Axis string $x = (uiRes("m_artisanProperties.kX")); string $y = (uiRes("m_artisanProperties.kY")); string $z = (uiRes("m_artisanProperties.kZ")); radioButtonGrp -nrb 3 -cw4 131 50 50 50 -label (uiRes("m_artisanProperties.kReflectionAxis")) -labelArray3 $x $y $z -annotation (uiRes("m_artisanProperties.kReflectionAxisAnnot")) artReflectionRadBtn; // display the reference vector checkbox only for artPutty context if ( $currTool == "artPutty" ) { checkBoxGrp -ncb 1 -label1 (uiRes("m_artisanProperties.kInvertReferenceVector")) invertVectorChkBox; } separator; // Stamp Quality Sliders. floatSliderGrp -field true -label (uiRes("m_artisanProperties.kStampSpacing")) -annotation (uiRes("m_artisanProperties.kStampSpacingAnnot")) -precision 3 -min 0.01 -max 10.0 -fieldMinValue 0.001 -fieldMaxValue 100.0 -v 1.0 -step 0.01 artStampSpacingSlider; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kStampDepth")) -annotation (uiRes("m_artisanProperties.kStampDepthAnnot")) -precision 3 -min 0.01 -max 10.0 -fieldMinValue 0.001 -fieldMaxValue 100.0 -v 1.0 -step 0.01 artStampDepthSlider; // Make one more option for the Paint Select tool. if ( $currTool == "artSelect" || $currTool == "artPutty" ) { separator; // Stroke commands. columnLayout ; textFieldGrp -label (uiRes("m_artisanProperties.kBeforeStroke")) -cw2 132 210 -annotation (uiRes("m_artisanProperties.kBeforeStrokeAnnot")) artPreStrokeTextField; textFieldGrp -label (uiRes("m_artisanProperties.kAfterStroke")) -cw2 132 210 -annotation (uiRes("m_artisanProperties.kAfterStrokeAnnot")) artPostStrokeTextField; separator; setParent ..; } if ( $currTool == "artAttr" ) { checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kUpdateContinuously")) -annotation (uiRes("m_artisanProperties.kUpdateContinuouslyAnnot")) artAttrInteractiveUpdate; } separator; setParent ..; setUITemplate -popTemplate; } global proc string stylusPressure_melToUI (string $mel) { string $opacity = (uiRes("m_artisanProperties.kPressureOpacity")); string $radius = (uiRes("m_artisanProperties.kRadius")); string $both = (uiRes("m_artisanProperties.kBoth")); string $result = $mel; if ( $mel == "Opacity") { $result = $opacity; } else if( $mel == "Radius") { $result = $radius; } else if( $mel == "Both") { $result = $both; } else { uiToMelMsg( "stylusPressure_melToUI", $mel, 1 ); } return $result; } global proc artisanCreatePressureFrame( string $parent, string $currTool ) // // Description: // Create a stylus pressure frame for all Arisan tools. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout artStylusPressureLayout; // Tablet Pressure. checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kStylusPressure")) -annotation (uiRes("m_artisanProperties.kStylusPressureAnnot")) artStylusPressureChkBox; // Pressure mapping. columnLayout artPressureMappingLayout; optionMenuGrp -label (uiRes("m_artisanProperties.kPressureMapping")) -annotation (uiRes("m_artisanProperties.kPressureMappingAnnot")) artStylusPressureOpMenu; menuItem -label (uiRes("m_artisanProperties.kPressureOpacity")) artMapOpacity; menuItem -label (uiRes("m_artisanProperties.kRadius")) artMapRadius; menuItem -label (uiRes("m_artisanProperties.kBoth")) artMapBoth; setParent ..; setParent ..; setUITemplate -popTemplate; } // ============================================================ // Attribute Maps. // ============================================================ proc artisanCreateImportFrame( string $parent, string $currTool ) // // Description: // Create the import attribue map options. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout artImportFrameLayout; // File browser. rowColumnLayout -nc 2 -cs 1 52 -cw 1 82 -cw 2 110; text -label (uiRes("m_artisanProperties.kImportMapName")) -annotation (uiRes("m_artisanProperties.kImportMapNameAnnot")); button -label (uiRes("m_artisanProperties.kImport")) importMapBrowseButton; setParent ..; separator; checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kReassignAttributeMaps")) reassignMapsChkBox; separator; frameLayout -lv false -bv false -cll true -cl ($currTool == "artFluidAttr") importChannelsFrame; string $importMapMenu = $currTool + "importMapValueMenu"; optionMenuGrp -label (uiRes("m_artisanProperties.kImportValue")) -annotation (uiRes("m_artisanProperties.kImportValueAnnot")) $importMapMenu; if ( $currTool == "artAttrColorPerVertex" ) { menuItem -label (uiRes("m_artisanProperties.kImportRGB")) artImportMenu5; menuItem -label (uiRes("m_artisanProperties.kImportRGBA")) artImportMenu6; }else{ menuItem -label (uiRes("m_artisanProperties.kImportLuminance")) artImportMenu0; menuItem -label (uiRes("m_artisanProperties.kImportAlpha")) artImportMenu1; menuItem -label (uiRes("m_artisanProperties.kImportRed")) artImportMenu2; menuItem -label (uiRes("m_artisanProperties.kImportGreen")) artImportMenu3; menuItem -label (uiRes("m_artisanProperties.kImportBlue")) artImportMenu4; } setParent ..; separator; // Display the treshhold for Paint Select tool. if ( $currTool == "artSelect" ) { columnLayout; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kThreshold")) -annotation (uiRes("m_artisanProperties.kThresholdAnnot")) -precision 4 -min 0.000 -max 1.0 -v 0.5 -step 0.05 importThresholdSlider; setParent ..; separator; } setParent ..; setUITemplate -popTemplate; } global proc string exportImageFormat_melToUI (string $mel) { string $tiff = (uiRes("m_artisanProperties.kTIFF")); string $sgi = (uiRes("m_artisanProperties.kSGI")); string $iff = (uiRes("m_artisanProperties.kIFF")); string $jpeg = (uiRes("m_artisanProperties.kJPEG")); string $targa = (uiRes("m_artisanProperties.kTarga")); string $windowsBitmap = (uiRes("m_artisanProperties.kWindowsBitmap")); string $quickTimeImage = (uiRes("m_artisanProperties.kQuickTimeImage")); string $quickDraw = (uiRes("m_artisanProperties.kQuickDraw")); string $photoshop = (uiRes("m_artisanProperties.kPhotoshop")); string $png = (uiRes("m_artisanProperties.kPNG")); string $macPaint = (uiRes("m_artisanProperties.kMacPaint")); string $gif = (uiRes("m_artisanProperties.kGIF")); string $softImage = (uiRes("m_artisanProperties.kSoftImage")); string $rla = (uiRes("m_artisanProperties.kRLA")); string $alias = (uiRes("m_artisanProperties.kAlias")); string $eps = (uiRes("m_artisanProperties.kEPS")); string $result = $mel; if ( $mel == "TIFF" ) { $result = $tiff; } else if( $mel == "SGI" ){ $result = $sgi; } else if( $mel == "IFF" ){ $result = $iff; } else if( $mel == "JPEG" ){ $result = $jpeg; } else if( $mel == "Targa" ){ $result = $targa; } else if( $mel == "WindowsBitmap" ){ $result = $windowsBitmap; } else if( $mel == "QuickTime Image" ){ $result = $quickTimeImage; } else if( $mel == "QuickDraw" ){ $result = $quickDraw; } else if( $mel == "Photoshop" ){ $result = $photoshop; } else if( $mel == "PNG" ){ $result = $png; } else if( $mel == "MacPaint" ){ $result = $macPaint; } else if( $mel == "GIF" ){ $result = $gif; } else if( $mel == "SoftImage" ){ $result = $softImage; } else if( $mel == "RLA" ){ $result = $rla; } else if( $mel == "Alias" ){ $result = $alias; } else if( $mel == "EPS" ){ $result = $eps; } else{ uiToMelMsg( "exportImageFormat_melToUI", $mel, 1 ); } return $result; } proc artisanCreateExportFrame( string $parent, string $currTool ) // // Description: // Create export attribute maps options. // { setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout artExportFrameLayout ; rowColumnLayout -nc 2 -cs 1 52 -cw 1 82 -cw 2 110; text -label (uiRes("m_artisanProperties.kExportMapName")) -annotation (uiRes("m_artisanProperties.kExportMapNameAnnot")); button -label (uiRes("m_artisanProperties.kExport")) exportMapBrowseButton; setParent ..; separator; frameLayout -lv false -bv false -cll true -cl ($currTool == "artFluidAttr") exportChannelsFrame; string $exportMapMenu = $currTool + "exportMapValueMenu"; optionMenuGrp -label (uiRes("m_artisanProperties.kExportValue")) -annotation (uiRes("m_artisanProperties.kExportValueAnnot")) $exportMapMenu; menuItem -label (uiRes("m_artisanProperties.kExportLuminance")) artExportMenu0; menuItem -label (uiRes("m_artisanProperties.kExportAlpha")) artExportMenu1; menuItem -label (uiRes("m_artisanProperties.kExportRGB")) artExportMenu2; menuItem -label (uiRes("m_artisanProperties.kExportRGBA")) artExportMenu3; setParent ..; separator; optionMenuGrp -label (uiRes("m_artisanProperties.kImageFormat")) -annotation (uiRes("m_artisanProperties.kImageFormatAnnot")) exportImageFormat; if(`about -mac`){ menuItem -label (uiRes("m_artisanProperties.kTIFF")) fileFormatMenuItem0; menuItem -label (uiRes("m_artisanProperties.kSGI")) fileFormatMenuItem1; menuItem -label (uiRes("m_artisanProperties.kIFF")) fileFormatMenuItem2; menuItem -label (uiRes("m_artisanProperties.kJPEG")) fileFormatMenuItem3; menuItem -label (uiRes("m_artisanProperties.kTarga")) fileFormatMenuItem4; menuItem -label (uiRes("m_artisanProperties.kWindowsBitmap")) fileFormatMenuItem5; menuItem -label (uiRes("m_artisanProperties.kQuickTimeImage")) fileFormatMenuItem6; menuItem -label (uiRes("m_artisanProperties.kQuickDraw")) fileFormatMenuItem7; menuItem -label (uiRes("m_artisanProperties.kPhotoshop")) fileFormatMenuItem8; menuItem -label (uiRes("m_artisanProperties.kPNG")) fileFormatMenuItem9; menuItem -label (uiRes("m_artisanProperties.kMacPaint")) fileFormatMenuItem10; }else{ menuItem -label (uiRes("m_artisanProperties.kGIF")) fileFormatMenuItem0; menuItem -label (uiRes("m_artisanProperties.kSoftImage")) fileFormatMenuItem1; menuItem -label (uiRes("m_artisanProperties.kRLA")) fileFormatMenuItem2; menuItem -label (uiRes("m_artisanProperties.kTIFF")) fileFormatMenuItem3; menuItem -label (uiRes("m_artisanProperties.kSGI")) fileFormatMenuItem4; menuItem -label (uiRes("m_artisanProperties.kAlias")) fileFormatMenuItem5; menuItem -label (uiRes("m_artisanProperties.kIFF")) fileFormatMenuItem6; menuItem -label (uiRes("m_artisanProperties.kJPEG")) fileFormatMenuItem7; menuItem -label (uiRes("m_artisanProperties.kEPS")) fileFormatMenuItem8; } separator; checkBoxGrp -label "" -label1 (uiRes("m_artisanProperties.kKeepAspectRatio")) exportKeepAspectChkBox; separator; intSliderGrp -field true -label (uiRes("m_artisanProperties.kMaxXSize")) -annotation (uiRes("m_artisanProperties.kMaxXSizeAnnot")) -min 1 -max 4096 -fieldMaxValue 8192 -v 256 -ss 256 exportMapSizeXSlider; intSliderGrp -field true -label (uiRes("m_artisanProperties.kMaxYSize")) -annotation (uiRes("m_artisanProperties.kMaxYSizeAnnot")) -min 1 -max 4096 -fieldMaxValue 8192 -v 256 -ss 256 exportMapSizeYSlider; separator; setParent ..; setUITemplate -popTemplate; } global proc artisanCreateAttrMapFrame( string $parent, string $currTool ) // // Description: // Import/Export of attribute maps properties. // { source "artisanToolConfigurations.mel" ; setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout -adj true artisanAttrMap; // Import attribute map frame. string $artImportFrame = `frameLayout -label (uiRes("m_artisanProperties.kImportLayout")) -collapsable true -collapse true artisanImportFrame`; // Create the import frame. artisanCreateImportFrame( $artImportFrame, $currTool ); setParent ..; // Only some of the tools support exporting // of the attribute maps. if ( isExportPanelUsed() ) { // Export attribute map frame. string $artExportFrame = `frameLayout -label (uiRes("m_artisanProperties.kExportLayout")) -collapsable true -collapse true artisanExportFrame`; // Create the import frame. artisanCreateExportFrame( $artExportFrame, $currTool ); setParent ..; } setParent ..; // columnLayout artisanAttrMap setUITemplate -popTemplate; } global proc artisanCreateDisplayFrame( string $parent, string $currTool ) // // Description: // Display . // { source "artisanNamedCommandSetup.mel" ; setUITemplate -pushTemplate OptionsTemplate; setParent $parent; columnLayout; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kDrawBrush")) -annotation (uiRes("m_artisanProperties.kDrawBrushAnnot")) artDrawOutlineChkBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kDrawBrushWhilePainting")) -annotation (uiRes("m_artisanProperties.kDrawBrushWhilePaintingAnnot")) artBrushWhilePaintingChkBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kDrawBrushTangentOutline")) -annotation (uiRes("m_artisanProperties.kDrawBrushTangentOutlineAnnot")) artDrawTangentOutlineChkBox; if ( isSurfaceConformedBrushAvailable() ) { /* checkBoxGrp -ncb 1 -l "" -l1 (uiRes("m_artisanProperties.kDrawOutlineAlongSurface")) -ann (uiRes("m_artisanProperties.kDrawOutlineAlongSurfaceAnnot")) surfaceConformedChkBox; */ checkBoxGrp -ncb 1 -l "" -label1 (uiRes("m_artisanProperties.kDrawBrushAffectedVertices")) -annotation (uiRes("m_artisanProperties.kDrawBrushAffectedVerticesAnnot")) surfaceConformedVtxChkBox; } checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kDrawBrushFeedback")) -annotation (uiRes("m_artisanProperties.kDrawBrushFeedbackAnnot")) artBrushFeedbackChkBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kShowWireframe")) -annotation (uiRes("m_artisanProperties.kShowWireframeAnnot")) artShowActiveLinesChkBox; if( isArtColorPerVertexCtx() ) { separator -h 20 -style "none"; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kAutoColorDisplay")) -annotation (uiRes("m_artisanProperties.kAutoColorDisplayAnnot")) artAutoShowColorChkBox; // Vertex Color Range checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kVertexColorRange")) -annotation (uiRes("m_artisanProperties.kVertexColorRangeAnnot")) -enable true -v1 false artVertexColorRangeChkBox; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kMinVertexColor")) -annotation (uiRes("m_artisanProperties.kMinVertexColorAnnot")) -precision 4 -min -5.0 -max 5.0 -step 0.1 -fmn -10000.0 -fmx 10000.0 -enable false artVertexColorMinSlider; // vcrLower floatSliderGrp -field true -label (uiRes("m_artisanProperties.kMaxVertexColor")) -annotation (uiRes("m_artisanProperties.kMaxVertexColorAnnot")) -precision 4 -min -5.0 -max 5.0 -step 0.1 -fmn -10000.0 -fmx 10000.0 -enable false artVertexColorMaxSlider; // vcrUpper; } // Support for color feedback. else if ( isArtColorFeedbackCtx() ) { separator -h 20 -style "none"; // Color Feedback. checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kColorFeedback")) -annotation (uiRes("m_artisanProperties.kColorFeedbackAnnot")) artColorFeedbackChkBox; if( isArtSkinCtx() ) { // Color Feedback override. checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kMulticolorFeedback")) -annotation (uiRes("m_artisanProperties.kMulticolorFeedbackAnnot")) artMultiColorFeedbackChkBox; checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kXrayJoints")) -annotation (uiRes("m_artisanProperties.kXrayJointsAnnot")) artXrayJointsChkBox; } separator -h 5 -style "none"; floatSliderGrp -field true -label (uiRes("m_artisanProperties.kMinColor")) -annotation (uiRes("m_artisanProperties.kMinColorAnnot")) -precision 4 -min -5.0 -max 5.0 -step 0.1 -fmn -10000.0 -fmx 10000.0 artColorFeedbackMinSlider; // crLower floatSliderGrp -field true -label (uiRes("m_artisanProperties.kMaxColor")) -annotation (uiRes("m_artisanProperties.kMaxColorAnnot")) -precision 4 -min -5.0 -max 5.0 -step 0.1 -fmn -10000.0 -fmx 10000.0 artColorFeedbackMaxSlider; // crUpper; } else if ( $currTool == "artSetPaint" ) { separator -h 20 -style "none"; // Color Feedback. checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kSetPaintColorFeedback")) -annotation (uiRes("m_artisanProperties.kSetPaintColorFeedbackAnnot")) artColorFeedbackChkBox; // Display Active Vertices checkBoxGrp -ncb 1 -label "" -label1 (uiRes("m_artisanProperties.kDisplayActiveVertices")) -annotation (uiRes("m_artisanProperties.kDisplayActiveVerticesAnnot")) artDisplayActiveCVsChkBox; separator -h 5 -style "none"; } separator -h 5 -style "none"; setParent ..; setUITemplate -popTemplate; }