add access to edge select tagging from mesh toolbar (tagging seams on Ctrl+RMB)

This commit is contained in:
Campbell Barton 2010-02-09 15:48:34 +00:00
parent ce38137449
commit f082c7be05
3 changed files with 26 additions and 6 deletions

@ -155,6 +155,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
mesh = context.active_object.data
col = layout.column(align=True)
col.prop(mesh, "use_mirror_x")
col.prop(context.tool_settings, "edge_path_mode")
# ********** default tools for editmode_curve ****************

@ -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) {

@ -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);