diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-09 18:48:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-09 18:48:34 +0300 |
commit | f082c7be05cdcf0de8e3140eb0d5ee8013fba576 (patch) | |
tree | 3497638dc51db810941824ea72d9fe07f09bc27c /source | |
parent | ce38137449790daa5395045b06d029bf4fd71cf7 (diff) |
add access to edge select tagging from mesh toolbar (tagging seams on Ctrl+RMB)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 14 |
2 files changed, 25 insertions, 6 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 717b725387a..b69f189287b 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -2133,7 +2133,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) { ViewContext vc; EditMesh *em; - EditEdge *eed; + EditEdge *eed, *eed_act= NULL; int dist= 50; em_setup_viewcontext(C, &vc); @@ -2153,7 +2153,6 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) EditSelection *ese = em->selected.last; if(ese && ese->type == EDITEDGE) { - EditEdge *eed_act; eed_act = (EditEdge*)ese->data; if (eed_act != eed) { if (edgetag_shortest_path(vc.scene, em, eed_act, eed)) { @@ -2167,14 +2166,20 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) int act = (edgetag_context_check(vc.scene, eed)==0); edgetag_context_set(vc.scene, eed, act); /* switch the edge option */ } - - EM_selectmode_flush(em); /* even if this is selected it may not be in the selection list */ - if(edgetag_context_check(vc.scene, eed)==0) + if(edgetag_context_check(vc.scene, eed)==EDGE_MODE_SELECT) EM_remove_selection(em, eed, EDITEDGE); - else + else { + /* other modes need to keep the last edge tagged */ + if(eed_act) + EM_select_edge(eed_act, 0); + + EM_select_edge(eed, 1); EM_store_selection(em, eed, EDITEDGE); + } + + EM_selectmode_flush(em); /* force drawmode for mesh */ switch (vc.scene->toolsettings->edge_mode) { diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3d26c8d9944..2192dbef9ea 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -740,6 +740,14 @@ static void rna_def_tool_settings(BlenderRNA *brna) {SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke."}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem edge_tag_items[] = { + {EDGE_MODE_SELECT, "SELECT", 0, "Select", ""}, + {EDGE_MODE_TAG_SEAM, "SEAM", 0, "Tag Seam", ""}, + {EDGE_MODE_TAG_SHARP, "SHARP", 0, "Tag Sharp", ""}, + {EDGE_MODE_TAG_CREASE, "CREASE", 0, "Tag Crease", ""}, + {EDGE_MODE_TAG_BEVEL, "BEVEL", 0, "Tag Bevel", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "ToolSettings", NULL); RNA_def_struct_ui_text(srna, "Tool Settings", ""); @@ -873,6 +881,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "vgroup_weight"); RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups."); + /* use with MESH_OT_select_shortest_path */ + prop= RNA_def_property(srna, "edge_path_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "edge_mode"); + RNA_def_property_enum_items(prop, edge_tag_items); + RNA_def_property_ui_text(prop, "Edge Tag Mode", "The edge flag to tag when selecting the shortest path."); + /* etch-a-ton */ prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING); |