View Full Version : get ID of Nurbs CV point?


Kyrish
08 August 2007, 03:24 PM
Hi there!
My question is:
I have nurbs sphere and select one (or several) of Control Vertex:
string $cv_points[]=`ls -sl -fl`;
the result is (for example) nurbsSphere1.cv[12][28]
so, how I can obtain the ID's of CV (12,28) and put their on different variables.
thanks in advance!
Alex

harmless
08 August 2007, 06:20 PM
$cvs = `filterExpand -sm 28`;
string $buffer[];
int $cv1_list[] = {}, $cv2_list[] = {};

for( $cv in $cvs )
{
$numTokens = `tokenize $cv "[]" $buffer`;
$cv1_list[size($cv1_list)] = $buffer[1];
$cv2_list[size($cv2_list)] = $buffer[2];
}

for($i=0;$i<size($cv1_list);$i++)
{
print ("selected cv: \n");
print ($cv1_list[$i]+"\n");
print ($cv2_list[$i]+"\n\n");
}

CGTalk Moderation
08 August 2007, 06:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


1