// =========================================================================== // 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 addPfxToHairSystem() { string $hsys[] = getSelectedHairSystems(); int $numHsys = size( $hsys ); if( $numHsys < 1 ){ warning( uiRes("m_doDeleteHairPB.kNoHairSystemSelected")); return; } int $i; for( $i = 0; $i < $numHsys; $i++ ){ string $pfxHair = destinationNodeNameFromConnection( $hsys[$i] + ".outputRenderHairs" ); if( $pfxHair != "" ){ warning( (uiRes("m_addPfxToHairSystem.kAlreadyHASPfxHair"))); continue; } if( $pfxHair == "" ){ $pfxHair = `createNode pfxHair`; connectAttr ($hsys[$i] + ".outputRenderHairs") ($pfxHair + ".renderHairs"); setAttr ( $pfxHair + ".displayPercent") 100; setAttr ( $pfxHair + ".drawAsMesh") false; } } }