// =========================================================================== // 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. // =========================================================================== // Description: // Create a cluster for every CV in active curve // // Return Value: // None. // global proc clusterCurve(){ //get selected curves string $curves[] = `listRelatives -shapes -type "nurbsCurve"`; //test to see if user has selected curve components if (size ($curves) == 0){ $curves = `listRelatives -parent -type "nurbsCurve"`; } //error out if there is nothing to cluster if (size ($curves) == 0){ string $msg = (uiRes("m_clusterCurve.kSelectionError")); error($msg); } //for each curve for ($curve in $curves){ //find number of CVs in curve int $numCVs = `getAttr -size ($curve + ".controlPoints")`; //loop for each CV int $i = 0; for ($i; $i < $numCVs; $i++){ //make CV into a cluster cluster -relative ($curve + ".cv[" + $i + "]") ; } } }