ctrl-click to make an isolated vert works again

This commit is contained in:
Joseph Eagar
2009-06-18 03:04:27 +00:00
parent 00d0a58db3
commit 8a6d70bcb1
4 changed files with 35 additions and 15 deletions

View File

@@ -3,7 +3,14 @@
#include <stdio.h>
/*applies a transform to vertices*/
BMOpDefine def_makevert = {
"makevert",
{{BMOP_OPSLOT_VEC, "co"},
{BMOP_OPSLOT_ELEMENT_BUF, "newvertout"},
{0, /*null-terminating sentinel*/}},
bmesh_makevert_exec,
0,
};
/*contextual_create is fkey, it creates
new faces, makes stuff from edge nets,
@@ -47,6 +54,7 @@ BMOpDefine def_translate= {
};
/*applies a transform to vertices*/
BMOpDefine def_transform = {
"transform",
{{BMOP_OPSLOT_MAT, "mat"},
@@ -248,6 +256,7 @@ BMOpDefine *opdefines[] = {
&def_rotate,
&def_edgenet_fill,
&def_contextual_create,
&def_makevert,
};
int bmesh_total_ops = (sizeof(opdefines) / sizeof(void*));

View File

@@ -28,5 +28,7 @@ void bmesh_transform_exec(BMesh *bm, BMOperator *op);
void bmesh_contextual_create_exec(BMesh *bm, BMOperator *op);
void bmesh_edgenet_fill_exec(BMesh *bm, BMOperator *op);
void bmesh_rotate_exec(BMesh *bm, BMOperator *op);
void bmesh_makevert_exec(BMesh *bm, BMOperator *op);
#endif

View File

@@ -32,6 +32,15 @@
*
*/
void bmesh_makevert_exec(BMesh *bm, BMOperator *op) {
float vec[3];
BMO_Get_Vec(op, "co", vec);
BMO_SetFlag(bm, BM_Make_Vert(bm, vec, NULL), 1);
BMO_Flag_To_Slot(bm, op, "newvertout", 1, BM_VERT);
}
void bmesh_transform_exec(BMesh *bm, BMOperator *op) {
BMOIter iter;
BMVert *v;

View File

@@ -450,7 +450,6 @@ short EDBM_Extrude_edges_indiv(BMEditMesh *em, short flag, float *nor)
short EDBM_Extrude_verts_indiv(BMEditMesh *em, wmOperator *op, short flag, float *nor)
{
BMOperator bmop;
BMIter iter;
BMOIter siter;
BMVert *v;
@@ -912,26 +911,27 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event)
EDBM_CallOpf(vc.em, op, "translate verts=%hv vec=%v",
BM_SELECT, min);
}
/*
else {
float mat[3][3],imat[3][3];
float *curs= give_cursor(vc.scene, vc.v3d);
BMOperator bmop;
BMOIter oiter;
VECCOPY(min, curs);
view3d_get_view_aligned_coordinate(&vc, min, event->mval);
eve= addvertlist(vc.em, 0, NULL);
Mat3CpyMat4(mat, vc.obedit->obmat);
Mat3Inv(imat, mat);
view3d_get_view_aligned_coordinate(&vc, min, event->mval);
Mat4Invert(vc.obedit->imat, vc.obedit->obmat);
Mat4MulVecfl(vc.obedit->imat, min); // back in object space
VECCOPY(eve->co, min);
Mat3MulVecfl(imat, eve->co);
VecSubf(eve->co, eve->co, vc.obedit->obmat[3]);
eve->f= SELECT;
EDBM_InitOpf(vc.em, &bmop, op, "makevert co=%v", min);
BMO_Exec_Op(vc.em->bm, &bmop);
BMO_ITER(v1, &oiter, vc.em->bm, &bmop, "newvertout") {
BM_Select(vc.em->bm, v1, 1);
}
if (!EDBM_FinishOp(vc.em, &bmop, op, 1))
return OPERATOR_CANCELLED;
}
*/
//retopo_do_all();
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit);