Difference between revisions of "GetCurveLength-ctrl-i"

From scripting
Jump to: navigation, search
(Created page with "Direct: http://crtl-i.com/blog/?p=16 proc float getCurveLength( string $curve ) { string $arcLenNode = `createNode arcLengthDimension`; connectAttr -f ( $curve + “.wor...")
 
(No difference)

Latest revision as of 05:42, 22 April 2017

Direct: http://crtl-i.com/blog/?p=16

proc float getCurveLength( string $curve )
{
string $arcLenNode = `createNode arcLengthDimension`;
connectAttr -f ( $curve + “.worldSpace[0]” ) ( $arcLenNode + “.nurbsGeometry” );

setAttr ( $arcLenNode + “.uParamValue” ) `getAttr ( $curve + “.maxValue” )`;

float $curveLength = `getAttr ( $arcLenNode + “.arcLength” )`; 

string $parent[] = `listRelatives -p $arcLenNode`;
delete $parent;

return $curveLength;
}


More information on working with attributes and querying, read pages 85-102 in YSYT.