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:
authorJoseph Eagar <joeedh@gmail.com>2011-05-03 05:48:15 +0400
committerJoseph Eagar <joeedh@gmail.com>2011-05-03 05:48:15 +0400
commit03734f5c58f374cd016b318685a00a16a219defa (patch)
tree641bd92f668051ed051710c3a749b24545a2bc19 /source/blender/editors/mesh
parent1fdc760bfe227a06504907ed03714a8f262fe4ff (diff)
=trunk=
Recommitted eltopo collision code (but disabled by default) with Genscher's permission. To use, you need to install liblapack and libblas
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/loopcut.c42
-rw-r--r--source/blender/editors/mesh/mesh_ops.c6
2 files changed, 35 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c
index 0ec356a88ae..2e06d8385d4 100644
--- a/source/blender/editors/mesh/loopcut.c
+++ b/source/blender/editors/mesh/loopcut.c
@@ -100,6 +100,7 @@ typedef struct tringselOpData {
int extend;
int do_cut;
+ wmTimer *timer;
} tringselOpData;
/* modal loop selection drawing callback */
@@ -315,10 +316,13 @@ static void ringsel_finish(bContext *C, wmOperator *op)
}
/* called when modal loop selection is done... */
-static void ringsel_exit(wmOperator *op)
+static void ringsel_exit(bContext *C, wmOperator *op)
{
tringselOpData *lcd= op->customdata;
+ if (lcd->timer)
+ WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), lcd->timer);
+
/* deactivate the extra drawing stuff in 3D-View */
ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle);
@@ -354,10 +358,10 @@ static int ringsel_init (bContext *C, wmOperator *op, int do_cut)
return 1;
}
-static int ringcut_cancel (bContext *UNUSED(C), wmOperator *op)
+static int ringcut_cancel (bContext *C, wmOperator *op)
{
/* this is just a wrapper around exit() */
- ringsel_exit(op);
+ ringsel_exit(C, op);
return OPERATOR_CANCELLED;
}
@@ -375,7 +379,7 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt)
lcd = op->customdata;
if (lcd->em->selectmode == SCE_SELECT_FACE) {
- ringsel_exit(op);
+ ringsel_exit(C, op);
WM_operator_name_call(C, "MESH_OT_loop_select", WM_OP_INVOKE_REGION_WIN, NULL);
return OPERATOR_CANCELLED;
}
@@ -385,7 +389,7 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt)
edge = findnearestedge(&lcd->vc, &dist);
if(!edge) {
- ringsel_exit(op);
+ ringsel_exit(C, op);
return OPERATOR_CANCELLED;
}
@@ -393,7 +397,7 @@ static int ringsel_invoke (bContext *C, wmOperator *op, wmEvent *evt)
ringsel_find_edge(lcd, 1);
ringsel_finish(C, op);
- ringsel_exit(op);
+ ringsel_exit(C, op);
return OPERATOR_FINISHED;
}
@@ -404,7 +408,11 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt)
tringselOpData *lcd;
EditEdge *edge;
int dist = 75;
-
+
+ /*if we're in the cut-n-slide macro, set release_confirm based on user pref*/
+ if (op->opm)
+ RNA_boolean_set(op->next->ptr, "release_confirm", U.loopcut_finish_on_release);
+
if(modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit))
BKE_report(op->reports, RPT_WARNING, "Loop cut doesn't work well on deformed edit mesh display");
@@ -437,22 +445,34 @@ static int ringcut_modal (bContext *C, wmOperator *op, wmEvent *event)
view3d_operator_needs_opengl(C);
-
switch (event->type) {
case LEFTMOUSE: /* confirm */ // XXX hardcoded
- if (event->val == KM_PRESS) {
+ if (event->val == KM_RELEASE) {
/* finish */
ED_region_tag_redraw(lcd->ar);
ringsel_finish(C, op);
- ringsel_exit(op);
+ ringsel_exit(C, op);
ED_area_headerprint(CTX_wm_area(C), NULL);
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED|OPERATOR_ABORT_MACRO;
+ }else {
+ lcd->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER2, 0.12);
}
ED_region_tag_redraw(lcd->ar);
break;
+
+ case TIMER2:
+ /* finish */
+ ED_region_tag_redraw(lcd->ar);
+
+ ringsel_finish(C, op);
+ ringsel_exit(C, op);
+
+ ED_area_headerprint(CTX_wm_area(C), NULL);
+
+ return OPERATOR_FINISHED;
case RIGHTMOUSE: /* abort */ // XXX hardcoded
case ESCKEY:
if (event->val == KM_RELEASE) {
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c
index d95c71b68ba..6d8dd4e9a2e 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -175,8 +175,10 @@ void ED_operatormacros_mesh(void)
ot= WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Cut mesh loop and slide it";
WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
- WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
-
+ otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
+ RNA_boolean_set(otmacro->ptr, "release_confirm", 1);
+ RNA_int_set(otmacro->ptr, "launch_event", LEFTMOUSE);
+
ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
ot->description = "Duplicate mesh and move";
WM_operatortype_macro_define(ot, "MESH_OT_duplicate");