PDA

View Full Version : Parsing Maya Ascii


unseenthings
02-14-2006, 05:56 PM
I'm having a bugger of a time parsing one particular aspect of the maya ascii format. I know, it's a subset of MEL and all that -- I'm mostly interested in the geometry within.

I've been able to grab all the verts and edges... the faces are what's giving me grief. I can grab them, but I haven't been able to make much sense of them. I know that the face is defined by the edges... and that faces with negative numbers mean they're facing the other way (not entirely sure what that means). But when there are 5 edges (2 positive and 3 negative) to make up what should be a simple square plane, and used in an order that doesn't seem to make any sense to me, I start getting lost.

In the application I'm working towards, edges are pretty much nonexistent as far as the program goes, but I'll deal with that once I figure out the face issue.

Here's the relevant data for above-mentioned flat, square plane object:
setAttr -s 4 ".vt[0:3]"
-32.5 -31.8 0
-32.5 31.6 0
26.9 31.6 0
26.9 -31.8 0;
setAttr -s 4 ".ed[0:3]"
0 1 0
2 3 0
1 2 0
0 3 0;
setAttr ".fc[0]" -type "polyFaces"
f 4 3 -2 -3 -1
mu 0 4 0 3 2 1;

Now, if I'm reading all this right, and I'm pretty sure I am, the vertex and edge data work out like this:
http://www.unseenthings.net/cgtalk/breaking_down_a_plane.jpg

With "Edge #4" referring to the 4th edge in the file (edges seem to be referred to as 1-x instead of 0-x, like the verts, which is weird, but okay ;-)) and "edge 03" meaning it's the edge made up of the line between vert 0 and vert 3.

And this is where I get stuck. Trying to interpret "f 4 3 -2 -3 -1" as some sort of polyface makes no sense to me. And I'm usually pretty good at this stuff, honest ;-) I'm just trying to make some triangles out of this thing... I've dug around the web and the maya ascii node information included with the PLE docs and looked at various other things... but still don't quite get what they're doing there.

Can anyone offer some insight?

CGTalk Moderation
02-14-2006, 05:56 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.