// =========================================================================== // 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. // =========================================================================== // // setNClothMapType // // Description: // This method sets the nCloth/nRigid map type for either the selected // meshes, or for the specified mesh, by setting the appropriate MapType // attribute corresponding to the specified attribute, to the given mapType // value. // global proc setNClothMapType(string $attr, string $meshParam, int $mapType) { string $objs[]; // The 0 to getNMeshToPaint means we do not accept component // selections, the user must select an nCloth // string $meshAndCloth[] = `getNMeshToPaint $meshParam 0`; if( size($meshAndCloth) > 0 ){ $objs[0] = $meshAndCloth[1]; // We want the nBase } string $mapTypeAttr = ($attr+"MapType"); for ($obj in $objs) { string $cmd = ("setAttr "+$obj+"."+$mapTypeAttr+" "+$mapType); eval $cmd; } }