diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-02-04 00:33:15 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-02-04 00:33:15 +0300 |
commit | 7516a56cb741194b58d3bdd63bf46c01e6b0c70d (patch) | |
tree | 0b17ff873a9db6bc6918520b4030a3250366bb23 /source/blender | |
parent | ec5788925c305b062ae28bc55c72699e30257b9a (diff) |
Small tweaks to Knife Cut
- Number of multicuts can now be set (only usable for multicut mode)
- Midpoint cutting is now done using shift-k + drag hotkey mapping
These were just minor properties changes, which shouldn't be too much of a hassle for BMesh merging.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mesh/editmesh_loop.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index 2cd5f221ebe..0a3eed99d77 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -632,7 +632,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op) float isect=0.0; float *scr, co[4]; int len=0; - short numcuts=1, mode= RNA_int_get(op->ptr, "type"); + short numcuts= RNA_int_get(op->ptr, "num_cuts"); + short mode= RNA_int_get(op->ptr, "type"); /* edit-object needed for matrix, and ar->regiondata for projections to work */ if (ELEM3(NULL, obedit, ar, ar->regiondata)) @@ -732,6 +733,7 @@ void MESH_OT_knife_cut(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", knife_items, KNIFE_EXACT, "Type", ""); prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath); + RNA_def_int(ot->srna, "num_cuts", 1, 1, MAX_CUTS, "Number of Cuts", "Only for Multi-Cut", 1, MAX_CUTS); /* internal */ RNA_def_int(ot->srna, "cursor", BC_KNIFECURSOR, 0, INT_MAX, "Cursor", "", 0, INT_MAX); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 5dd940be785..703333343b4 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -299,6 +299,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0); WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, 0, KKEY); + RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_SHIFT, KKEY)->ptr, "type", 2/*KNIFE_MIDPOINT*/); WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); |