Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-10-15 09:27:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-15 09:27:57 +0400
commit4e61d5420c6b45c406bc59bd311342579c619e9c (patch)
treea8f993ef9bc21ed186a200baca415700dc9c5363 /source/blender
parent25bbf99a79b0a1fa324dcd8d49bf80807b2d9672 (diff)
Ctrl+Click extrude, project the source verts when projection and rotating the source are enabled (better for retopo workflow).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/mesh/editmesh_add.c18
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);