diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-15 09:27:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-15 09:27:57 +0400 |
commit | 4e61d5420c6b45c406bc59bd311342579c619e9c (patch) | |
tree | a8f993ef9bc21ed186a200baca415700dc9c5363 | |
parent | 25bbf99a79b0a1fa324dcd8d49bf80807b2d9672 (diff) |
Ctrl+Click extrude, project the source verts when projection and rotating the source are enabled (better for retopo workflow).
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index ad4c02c834c..30070581a1c 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -113,9 +113,12 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) EditVert *eve; float min[3], max[3]; int done= 0; - + short use_proj; + em_setup_viewcontext(C, &vc); + use_proj= ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE); + invert_m4_m4(vc.obedit->imat, vc.obedit->obmat); INIT_MINMAX(min, max); @@ -129,7 +132,7 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) /* call extrude? */ if(done) { - int rot_src= RNA_boolean_get(op->ptr, "rotate_source"); + short rot_src= RNA_boolean_get(op->ptr, "rotate_source"); EditEdge *eed; float vec[3], cent[3], mat[3][3]; float nor[3]= {0.0, 0.0, 0.0}; @@ -221,8 +224,12 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) } } - if(rot_src) + if(rot_src) { rotateflag(vc.em, SELECT, cent, mat); + /* also project the source, for retopo workflow */ + if(use_proj) + EM_project_snap_verts(C, vc.ar, vc.obedit, vc.em); + } extrudeflag(vc.obedit, vc.em, SELECT, nor, 0); rotateflag(vc.em, SELECT, cent, mat); @@ -249,11 +256,8 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) eve->f= SELECT; } - if( ((vc.scene->toolsettings->snap_flag & (SCE_SNAP|SCE_SNAP_PROJECT))==(SCE_SNAP|SCE_SNAP_PROJECT)) && - (vc.scene->toolsettings->snap_mode==SCE_SNAP_MODE_FACE) - ) { + if(use_proj) EM_project_snap_verts(C, vc.ar, vc.obedit, vc.em); - } WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data); DAG_id_flush_update(vc.obedit->data, OB_RECALC_DATA); |