[Bf-python] Ok, heres the status of the EMesh code.

joeedh joeeagar at prodigy.net
Sun Oct 10 07:05:33 CEST 2004


Currently EMesh works as following:

The actual module EMesh has the methods AddVert, AddFace, GetScreenVert 
(get the vert under the mouse cursor, takes no args, should be 
GetMouseVert?), GetScreeenFace (the same).  It has the attributes 
"verts", "edges", and "faces", which are python lists that contain all 
the EditVert/Edge/Face data.  Note that all edge vertex and face data is 
immutable (you can't change it) except for the crease, seam and sel stuff.

Verts have the attributes co, no, and sel (like in NMesh).

Edges are sequence types; you get there verts by doing edge[0 or 1].  
Note that an edge's verts inmutable.  They have the attributes "crease", 
"seam", and "sel", and while they are all implemented I have no idea how 
you control the crease or seam values.

Faces are also sequence types (i.e. v1 = face[0], v2 = face[1], etc if I 
wasn't clear above).  They have the attributes "edges" (list of the 
edges, is also immutable), "sel", "centerdot" (the coordinates of the 
center dot of the face), and "UV" (which has the u,v, coordinates of the 
face).  Oh, and "no", which is the normal vector of the face.

So. What do you think?  I plan to implement things like Subdivide, 
Beauty Fill, Bevel (if anyone ever finishes it?), etc.  In the future 
all kind of mesh-editing tools could be done in python!

As a sidenote, this is all done as an extreamly low-level wrapper, so 
everything is done right on the EditMesh data (with error checking, of 
course).  Because of this, the UV data, the vert coordinates, normals, 
essentially whereever the Edit* data has a float-array, I use a BPython 
Vector object, which happily works directly on the C arrays.

joeedh

P.S.: By the way, the QAdd python function will not send events to UI 
elements.  It would be nice if it did.



More information about the Bf-python mailing list