// =========================================================================== // 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 findSkinClusterFromSelectedComponent(string $component) { string $selElems[]; tokenize($component, ".", $selElems ); int $nbElem = size($selElems); string $noVertSelectedStr = (uiRes("m_findSkinClusterFromSelectedComponent.kArtAttrSkinNoVertsSelected")); if ( $nbElem != 2 ) { error($noVertSelectedStr); return ""; } string $selMesh[] = `listRelatives -shapes -path -ni $selElems[0]`; if(size($selMesh) <=0) { error($noVertSelectedStr); return ""; } string $skinCluster = findRelatedSkinCluster($selMesh[0]); if($skinCluster == "") { error((uiRes("m_findSkinClusterFromSelectedComponent.kArtAttrSkinNoSkinClusterFound"))); return ""; } return $skinCluster; }