/*error messages*/
#define BMERR_SELF_INTERSECTING 1
#define BMERR_DISSOLVEDISK_FAILED 2
+#define BMERR_CONNECTVERT_FAILED 3
static char *bmop_error_messages[] = {
0,
"Self intersection error",
"Could not dissolve vert",
+ "Could not connect verts",
};
/*------------begin operator defines (see bmesh_opdefines.c too)------------*/
BMOP_EXFACE_TOTSLOT,
};
+#define BMOP_CONNECT_VERTS 11
+enum {
+ BM_CONVERTS_VERTIN,
+ BM_CONVERTS_EDGEOUT,
+ BM_CONVERTS_TOTSLOT
+};
/*keep this updated!*/
-#define BMOP_TOTAL_OPS 11
+#define BMOP_TOTAL_OPS 12
/*-------------------------------end operator defines-------------------------------*/
extern BMOpDefine *opdefines[];
void BM_esubdivideflag(struct Object *obedit, struct BMesh *bm, int selflag, float rad,
int flag, int numcuts, int seltype);
void BM_extrudefaceflag(BMesh *bm, int flag);
+
+/*these next two return 1 if they did anything, or zero otherwise.*/
int BM_DissolveFaces(struct EditMesh *em, int flag);
+/*this doesn't display errors to the user, btw*/
+int BM_ConnectVerts(struct EditMesh *em, int flag);
#endif
void dissolveverts_exec(BMesh *bmesh, BMOperator *op);
void bmesh_make_fgons_exec(BMesh *bmesh, BMOperator *op);
void extrude_edge_context_exec(BMesh *bm, BMOperator *op);
+void connectverts_exec(BMesh *bm, BMOperator *op);
#endif
EditEdge *eed;
EditFace *efa;
short amount=0;
-
+
+ if (em->selectmode & SCE_SELECT_VERTEX) {
+ /*return if bmesh vert connect does anything.*/
+ if (BM_ConnectVerts(em, BM_SELECT)) return;
+ }
+
if (em->selectmode & SCE_SELECT_FACE) {
/*return if bmesh face dissolve finds stuff to
dissolve.*/
MEM_freeN(innerverts);
}
-//Next two fill types are for knife exact only and are provided to allow for knifing through vertices
+//Next two fill types are for exact only and are provided to allow for knifing through vertices
//This means there is no multicut!
static void fill_quad_doublevert(EditMesh *em, EditFace *efa, int v1, int v2)
{