// =========================================================================== // 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. // =========================================================================== proc addhairSysNameToList(string $hairSystemList[], string $hairSysName) { int $numNames = size($hairSystemList); int $objFound = 0; for($i = 0; $i < $numNames; $i ++) { if($hairSystemList[$i] == $hairSysName) { $objFound = 1; break; } } if(!$objFound) $hairSystemList[$numNames] = $hairSysName; } global proc string[] hairGetAllHairSystems(string $polyObj) { string $hairSystemList[]; string $hairSys[]; string $folliclesList[] = `listConnections -t follicle ($polyObj + ".outMesh")`; for($i = 0; $i < size($folliclesList); $i ++) { $hairSys = `listConnections -sh 1 ($folliclesList[$i] + ".outHair")`; addhairSysNameToList($hairSystemList, $hairSys[0]); } return $hairSystemList; }