superduper10000
01-25-2007, 05:26 PM
Is there a simple way to get the positions for vertices that define a face? Right now I have something like:
string $vertList[] = `polyInfo -fv`; // 1 face is selected in the scene
print $vertList;
string $vertBuffer[];
// This is the part that starts to get unplesant
tokenize($vertList[0], $vertBuffer);
for($vert in $vertBuffer)
{
print("Token: " + $vert + "\n");
}
... which outputs:
FACE 62: 68 69 79 78
Token: FACE
Token: 62:
Token: 68
Token: 69
Token: 79
Token: 78
My question is: do I have to dig around in the tokenized buffer and find vert indices (keep in mind that for multiple selected faces it will look like several 2-d arrays to walk through and get vertex indices) or is there an easier way to get a list of verts?
Ultimately I am interested in finding position and normal data for these faces -- maybe I am taking the wrong approach all together? :curious: (http://forums.cgsociety.org/misc.php?do=getsmilies&wysiwyg=1&forumid=0#)
string $vertList[] = `polyInfo -fv`; // 1 face is selected in the scene
print $vertList;
string $vertBuffer[];
// This is the part that starts to get unplesant
tokenize($vertList[0], $vertBuffer);
for($vert in $vertBuffer)
{
print("Token: " + $vert + "\n");
}
... which outputs:
FACE 62: 68 69 79 78
Token: FACE
Token: 62:
Token: 68
Token: 69
Token: 79
Token: 78
My question is: do I have to dig around in the tokenized buffer and find vert indices (keep in mind that for multiple selected faces it will look like several 2-d arrays to walk through and get vertex indices) or is there an easier way to get a list of verts?
Ultimately I am interested in finding position and normal data for these faces -- maybe I am taking the wrong approach all together? :curious: (http://forums.cgsociety.org/misc.php?do=getsmilies&wysiwyg=1&forumid=0#)
