(though it's not completely feature-complete yet).
I ported over the remove doubles code from the
old bmesh branch for this, and split it into two
bmops, "Weld Verts" and "Remove Doubles".
Weld verts welds specific verts together, while remove
doubles finds doubles and welds them.
I also reverted the hotkey change I made earlier.
and made it sensitive to the selection mode. Also
coded dissolve edges, since that was missing.
Removed the old "Delete Edge Loop", since dissolve
edges pretty much replaces that :)
to bmesh. Yay! Creating faces from edge nets
is sill missing, I'm leaving that for later.
I added two new bmop functions, BMO_HeaderFlag_Buffer
and BMO_UnHeaderFlag_Buffer, which are header flag
version of BMO_Flag_Buffer and BMO_Unflag_Buffer.
The new functions properly handle setting/clearing
BM_SELECT via the selection API.
bmop, that just multiplies input verts with a matrix. Also
made a derivative translate bmop.
BMO_CallOpf now has a %s format code, which is used to
copy data from another slot.
Also cleaned the extrude code up some more, and restored extrude-repeat
(which is bound to ctrl-alt-4), though this doesn't work right yet
(the view matrix it uses is incorrect, or something like that).
BMO_ITER macros to make defining iterator
loops easier. Moved some files around.
And also made the editmesh conversion functions
tesselate ngons to triangle fans, since it's
more stable for conversion, and editmeshes are
never displayed to the user anyway. And ported
akey to bmesh.
Next up I plan on adding face iterators to DerivedMesh,
since that's the last major chunk of major refactoring
left, I think, except perhaps the uv editor (at the
moment it's probably close to working, but it's still
converting to editmeshes for everything, which is very
bad).
that handles some non-manifold situations better without failing.
Also made edge subdivide use a more specializzed internal version
of BM_Connect_Verts, that should hopefully always split the correct face.
Dissolve verts also now has checks to not accidentally dissolve
unselected vertices. It's not kindof a hybrid tool, using dissolve
faces where it can to dissolve verts for robustness, and using
BM_Dissolve_Verts where it cannot.
And removed some cruft from a few API functions.
Used it to implement the dissolve faces operation (previous
incarnation was just a debugging hack). The code works by
creating one giant new face per region of faces.
The dissolve verts (xkey->collapse, heh need to rename it)
operator now invokes dissolve faces on the faces around verts.
This is less error-prone then a pure topological/euler based
solution.
like so:
[opname] [slotname]=%[format code]
Before it was relying on the input format codes being in the same proper
order as the slots, which seemed like a potential maintainance nightmare to
me. Also the flags for creating buffers from bmop flags or header flags,
now support additional modifiers for combining vert/edge/face inputs.
E.g. %hfvef would accept all geometry with a header flag, and
%fef would accept edges and faces with a certain bmop flag set.
Example from the UI code:
if (!EDBM_CallOpf(em, op, "del geom=%hf context=%d", BM_SELECT, DEL_ONLYFACES))
return OPERATOR_CANCELLED;
(remember EDBM_CallOpf is the UI wrapper for this that does conversion,
error reporting, etc).
On todo is cleaning up/splitting bmesh_operators.h,
since it's kindof a mesh right now. I'm thinking of adding the slot
names in comments next to the slot ids, but I definitely would have to
clean up bmesh_operators.h first, or it'd just be too chaotic for me.
BTW, the operator API should now have enough meta info to wrap with
a scripting language, not that it matters since that's not happening till
much much later.
Also hopefully corrected some SConscripts, fix mostly provided by Elia Sarti,
though I also copied some SConscripts from 2.5 (not sure if doing
so was especially helpful).
Finally, I refactored a few places to use the new operator calling api,
as an example of how this is beneficial.