一半君的总结纸

听话只听一半君

#04 Given a polymesh edge component, how can I get a list of its associated vertices?

proc int[] edgeVertices( string $edge )
{
  int $vertices[2];

  string $vlist[] = `listAttr $edge`;

  $vertices[0] = match( "[0-9]+", $vlist[0] );
  $vertices[1] = match( "[0-9]+", $vlist[4] );

  return $vertices;
}

However, Maya always returns the vertices in numeric order and not in what I call “construction order.” For example, if you activate the PolyAppendTool and pick an edge, you’ll see an arrow that defines the “vector” for that edge. The order of the vertices returned does not necessarily match the orientation of this vector.

Per the documentation on the ‘mesh’ DG Node you’re supposed to be able to query this using:

getAttr polymesh.e[0];

or more directly, possibly something like:

getAttr polymesh.e[0].edg1;
getAttr polymesh.e[0].edg2;

However, that appears to be broken (at least in MEL) right now. Maya Tech Support is currently investigating this.

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: