// =========================================================================== // 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 nClothAttributeToPaint_melToUI(string $mel) { string $result = $mel; if ( $mel == "collideStrength" ) { $result = (uiRes("m_artAttrNClothProperties.kCollideStrength")); } else if ( $mel == "thickness" ) { $result = (uiRes("m_artAttrNClothProperties.kThickness")); } else if ( $mel == "bounce" ) { $result = (uiRes("m_artAttrNClothProperties.kBounce")); } else if ( $mel == "friction" ) { $result = (uiRes("m_artAttrNClothProperties.kFriction")); } else if ( $mel == "stickiness" ) { $result = (uiRes("m_artAttrNClothProperties.kStickiness")); } else if ( $mel == "fieldMagnitude" ) { $result = (uiRes("m_artAttrNClothProperties.kFieldMagnitude")); } else if ( $mel == "mass" ) { $result = (uiRes("m_artAttrNClothProperties.kMass")); } else if ( $mel == "stretch" ) { $result = (uiRes("m_artAttrNClothProperties.kStretch")); } else if ( $mel == "compression" ) { $result = (uiRes("m_artAttrNClothProperties.kCompression")); } else if ( $mel == "bend" ) { $result = (uiRes("m_artAttrNClothProperties.kBend")); } else if ( $mel == "bendAngleDropoff" ) { $result = (uiRes("m_artAttrNClothProperties.kBendAngleDropOff")); } else if ( $mel == "restitutionAngle" ) { $result = (uiRes("m_artAttrNClothProperties.kRestitutionAngle")); } else if ( $mel == "damp" ) { $result = (uiRes("m_artAttrNClothProperties.kDamp")); } else if ( $mel == "rigidity" ) { $result = (uiRes("m_artAttrNClothProperties.kRigidity")); } else if ( $mel == "deform" ) { $result = (uiRes("m_artAttrNClothProperties.kDeform")); } else if ( $mel == "inputAttract" ) { $result = (uiRes("m_artAttrNClothProperties.kInputAttract")); } else if ( $mel == "restLengthScale" ) { $result = (uiRes("m_artAttrNClothProperties.kRestLengthScale")); } else if ( $mel == "wrinkle" ) { $result = (uiRes("m_artAttrNClothProperties.kWrinkle")); } else if ( $mel == "lift" ) { $result = (uiRes("m_artAttrNClothProperties.kLift")); } else if ( $mel == "drag" ) { $result = (uiRes("m_artAttrNClothProperties.kDrag")); } else if ( $mel == "tangentialDrag" ) { $result = (uiRes("m_artAttrNClothProperties.kTangentialDrag")); } return $result; } global proc string nClothAttributeToPaint_uiToMel(string $ui) { string $result = $ui; if ( $ui == (uiRes("m_artAttrNClothProperties.kCollideStrength")) ) { $result = "collideStrength"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kThickness")) ) { $result = "thickness"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kBounce")) ) { $result = "bounce"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kFriction")) ) { $result = "friction"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kStickiness")) ) { $result = "stickiness"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kFieldMagnitude")) ) { $result = "fieldMagnitude"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kMass")) ) { $result = "mass"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kStretch")) ) { $result = "stretch"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kCompression")) ) { $result = "compression"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kBend")) ) { $result = "bend"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kBendAngleDropOff")) ) { $result = "bendAngleDropoff"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kRestitutionAngle")) ) { $result = "restitutionAngle"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kDamp")) ) { $result = "damp"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kRigidity")) ) { $result = "rigidity"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kDeform")) ) { $result = "deform"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kInputAttract")) ) { $result = "inputAttract"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kRestLengthScale")) ) { $result = "restLengthScale"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kWrinkle")) ) { $result = "wrinkle"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kLift")) ) { $result = "lift"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kDrag")) ) { $result = "drag"; } else if ( $ui == (uiRes("m_artAttrNClothProperties.kTangentialDrag")) ) { $result = "tangentialDrag"; } return $result; } // // // Creation Date: 2006 // // Description: // Option tool property window for NCloth Paint Attributes tool. // proc artNClothCreateOperFrame( string $parent, string $currTool ) // // Custom UI for Paint NCloth Weights tool. // { // // Target object // columnLayout; optionMenuGrp -label (uiRes("m_artAttrNClothProperties.kPaintAttribute")) -columnWidth 1 220 NClothPaintAttrMenu; optionMenuGrp -e -cc ("NClothPaintCallback \"#1\"") NClothPaintAttrMenu; menuItem -l (uiRes("m_artAttrNClothProperties.kCollideStrength")); menuItem -l (uiRes("m_artAttrNClothProperties.kThickness")); menuItem -l (uiRes("m_artAttrNClothProperties.kBounce")); menuItem -l (uiRes("m_artAttrNClothProperties.kFriction")); menuItem -l (uiRes("m_artAttrNClothProperties.kStickiness")); menuItem -l (uiRes("m_artAttrNClothProperties.kFieldMagnitude")); menuItem -l (uiRes("m_artAttrNClothProperties.kMass")); menuItem -l (uiRes("m_artAttrNClothProperties.kStretch")); menuItem -l (uiRes("m_artAttrNClothProperties.kCompression")); menuItem -l (uiRes("m_artAttrNClothProperties.kBend")); menuItem -l (uiRes("m_artAttrNClothProperties.kBendAngleDropOff")); menuItem -l (uiRes("m_artAttrNClothProperties.kRestitutionAngle")); menuItem -l (uiRes("m_artAttrNClothProperties.kDamp")); menuItem -l (uiRes("m_artAttrNClothProperties.kRigidity")); menuItem -l (uiRes("m_artAttrNClothProperties.kDeform")); menuItem -l (uiRes("m_artAttrNClothProperties.kInputAttract")); menuItem -l (uiRes("m_artAttrNClothProperties.kRestLengthScale")); menuItem -l (uiRes("m_artAttrNClothProperties.kWrinkle")); menuItem -l (uiRes("m_artAttrNClothProperties.kLift")); menuItem -l (uiRes("m_artAttrNClothProperties.kDrag")); menuItem -l (uiRes("m_artAttrNClothProperties.kTangentialDrag")); setParent -m ..; setParent ..; } // ======================================================= // Main Procedure. // ======================================================= global proc artAttrNClothProperties() { // Base Artisan (applicable to all Artisan tools) properties. source "artisanProperties.mel"; source "artisanCallback.mel"; source "artAttrProperties.mel"; source "artAttrNClothCallback.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 artAttrNCloth; // Brush frameLayout. frameLayout -label (uiRes("m_artAttrNClothProperties.kBrush")) -collapsable true -collapse false artAttrNClothBrushFrame; // Create brush option menu. artisanCreateBrushFrame( "artAttrNClothBrushFrame", $currTool ); setParent ..; // which ncloth attributes to paint layout frameLayout -label (uiRes("m_artAttrNClothProperties.kNCloth")) -collapsable true -collapse false artNClothOperationFrame; // Create Paint Attribute operation menu. artNClothCreateOperFrame( "artNClothOperationFrame", $currTool ); setParent ..; string $artCommonOpFrame = `frameLayout -label (uiRes("m_artAttrNClothProperties.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_artAttrNClothProperties.kStroke")) -collapsable true -collapse true artAttrNClothStrokeFrame; // Create stroke options. artisanCreateStrokeFrame( "artAttrNClothStrokeFrame", $currTool ); setParent ..; // Stylus Pressure options. frameLayout -label (uiRes("m_artAttrNClothProperties.kStylusPressure")) -collapsable true -collapse true artAttrNClothPressureFrame; // Create stroke options. artisanCreatePressureFrame( "artAttrNClothPressureFrame", $currTool ); setParent ..; // Attribute Maps options. frameLayout -label (uiRes("m_artAttrNClothProperties.kAttributeMaps")) -collapsable true -collapse true artAttrNClothAttrMapFrame; // Create Attribute Map option menu. artisanCreateAttrMapFrame( "artAttrNClothAttrMapFrame", $currTool ); setParent ..; // Display options. frameLayout -label (uiRes("m_artAttrNClothProperties.kDisplay")) -collapsable true -collapse true artAttrNClothDisplayFrame; // Create Display options. artisanCreateDisplayFrame( "artAttrNClothDisplayFrame", $currTool ); setParent ..; setParent ..; setUITemplate -popTemplate; // Set the callbacks and various global functions. artAttrNClothCallback( "artAttrCtx" ); // Ramp controls artisanRampCallback( "artAttrCtx" ); }