Calling Vertices numbers

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  11 November 2007
Calling Vertices numbers

Is there a way to get a selected Vertex number only? Or do I need to use match and substituteAllStrings to get the clean number?
don't worry IK Handle this!
  11 November 2007
Thumbs up

global proc int[] getVertInt( string $verts[] )
	string $curSel[] = `ls -sl`;
	select -r $verts;
	string $myVerts[] = `ls -sl`;
	string $vertList[] = `filterExpand -sm 31 -ex true`; //poly verts

	int $intVerts[] = {}; 
	for( $vert in $vertList )
		string $buffer[] = {};
		$n = `tokenize $vert "[]" $buffer`;
		string $nVertStr = $buffer[1];
		int $nVert = $nVertStr;
		$intVerts[size($intVerts)] = $nVert;
	select -r $curSel;
	return $intVerts;

//test asset
string $obj[] = `polySphere -ch on -o on -r 8.904493`;
select -r ($obj[0]+".vtx[2]");
select -add ($obj[0]+".vtx[10]");
select -add ($obj[0]+".vtx[4]");
string $verts[] = `ls -sl`;

//call my function to get ints back
int $vertNums[] = getVertInt( $verts );

print $vertNums;
  11 November 2007
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 03:27 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.