// =========================================================================== // 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. // =========================================================================== // // createNCloth.mel // // Description: // Interface for creating an nCloth. // // Arguments: // None. // global proc int addActiveToNSystem(string $active, string $nucleus) { // TODO should check to see if the corresponding start is already connected // and do something meaningful if indices are out of sync string $attr = ($nucleus + ".inputActive"); string $startattr = ($nucleus + ".inputActiveStart"); int $nIndex = getNextFreeMultiIndex($attr, 0); connectAttr ($active + ".currentState") ($attr + "[" + $nIndex + "]"); connectAttr ($active + ".startState") ($startattr + "[" + $nIndex + "]"); string $nattr = ($nucleus + ".outputObjects"); // note that later, the indices might not match up, fix this connectAttr ($nattr + "[" + $nIndex + "]") ($active + ".nextState"); setAttr ($active + ".active") 1 ; // TODO connect the index attribute when we decide where it goes return $nIndex; }