// =========================================================================== // 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. // =========================================================================== global proc string nComponentAttributeToPaint_melToUI(string $mel) { string $result = $mel; if ( $mel == "strength" ) { $result = (uiRes("m_artAttrNComponentProperties.kStrength")); } else if ( $mel == "glueStrength" ) { $result = (uiRes("m_artAttrNComponentProperties.kGlueStrength")); } else if ( $mel == "weight" ) { $result = (uiRes("m_artAttrNComponentProperties.kWeight")); } return $result; } global proc string nComponentAttributeToPaint_uiToMel(string $ui) { string $result = $ui; if ( $ui == (uiRes("m_artAttrNComponentProperties.kStrength")) ) { $result = "strength"; } else if ( $ui == (uiRes("m_artAttrNComponentProperties.kGlueStrength")) ) { $result = "glueStrength"; } else if ( $ui == (uiRes("m_artAttrNComponentProperties.kWeight")) ) { $result = "weight"; } return $result; } // // // Creation Date: 2006 // // Description: // Option tool property window for NComponent Paint Attributes tool. // proc artNComponentCreateOperFrame( string $parent, string $currTool ) // // Custom UI for Paint NComponent Weights tool. // { // // Target object // columnLayout; optionMenuGrp -label (uiRes("m_artAttrNComponentProperties.kPaintAttribute")) -columnWidth1 200 NComponentPaintAttrMenu; optionMenuGrp -e -cc ("NComponentPaintCallback \"#1\"") NComponentPaintAttrMenu; menuItem -l (uiRes("m_artAttrNComponentProperties.kStrength")); menuItem -l (uiRes("m_artAttrNComponentProperties.kGlueStrength")); menuItem -l (uiRes("m_artAttrNComponentProperties.kWeight")); setParent -m ..; setParent ..; } // ======================================================= // Main Procedure. // ======================================================= global proc artAttrNComponentProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artisanProperties.mel"; source "artisanCallback.mel"; source "artAttrProperties.mel"; source "artAttrNComponentCallback.mel"; source "artisanRampCallback.mel"; string $currContext = `currentCtx`; string $currTool = `contextInfo -c $currContext`; setUITemplate -pushTemplate DefaultTemplate; string $parent = `toolPropertyWindow -q -location`; setParent $parent; columnLayout -adj true artAttrNComponent; // Brush frameLayout. frameLayout -label (uiRes("m_artAttrNComponentProperties.kBrush")) -collapsable true -collapse false artAttrNComponentBrushFrame; // Create brush option menu. artisanCreateBrushFrame( "artAttrNComponentBrushFrame", $currTool ); setParent ..; // which nComponent attributes to paint layout frameLayout -label (uiRes("m_artAttrNComponentProperties.kNComponent")) -collapsable true -collapse false artNComponentOperationFrame; // Create Paint Attribute operation menu. artNComponentCreateOperFrame( "artNComponentOperationFrame", $currTool ); setParent ..; string $artCommonOpFrame = `frameLayout -label (uiRes("m_artAttrNComponentProperties.kPaintAttributes")) -collapsable true -collapse false artCommonOperationFrame`; setUITemplate -pushTemplate OptionsTemplate; setParent $artCommonOpFrame; columnLayout; // Put all the common stuff. artAttrCreateCommonProperties(); artisanCreateRamp($artCommonOpFrame, 0 ); setUITemplate -popTemplate; setParent ..; // Stroke options. frameLayout -label (uiRes("m_artAttrNComponentProperties.kStroke")) -collapsable true -collapse true artAttrNComponentStrokeFrame; // Create stroke options. artisanCreateStrokeFrame( "artAttrNComponentStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artAttrNComponentProperties.kStylusPressure")) -collapsable true -collapse true artAttrNComponentPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artAttrNComponentPressureFrame", $currTool ); setParent ..; // Attribute Maps options. frameLayout -label (uiRes("m_artAttrNComponentProperties.kAttributeMaps")) -collapsable true -collapse true artAttrNComponentAttrMapFrame; // Create Attribute Map option menu. artisanCreateAttrMapFrame( "artAttrNComponentAttrMapFrame", $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artAttrNComponentProperties.kDisplay")) -collapsable true -collapse true artAttrNComponentDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artAttrNComponentDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; // Set the callbacks and various global functions. artAttrNComponentCallback( "artAttrCtx" ); // Ramp controls artisanRampCallback( "artAttrCtx" ); }