forked from bartvdbraak/blender
add access to edge select tagging from mesh toolbar (tagging seams on Ctrl+RMB)
This commit is contained in:
parent
ce38137449
commit
f082c7be05
@ -155,6 +155,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel):
|
|||||||
mesh = context.active_object.data
|
mesh = context.active_object.data
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
col.prop(mesh, "use_mirror_x")
|
col.prop(mesh, "use_mirror_x")
|
||||||
|
col.prop(context.tool_settings, "edge_path_mode")
|
||||||
|
|
||||||
# ********** default tools for editmode_curve ****************
|
# ********** default tools for editmode_curve ****************
|
||||||
|
|
||||||
|
@ -2133,7 +2133,7 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2])
|
|||||||
{
|
{
|
||||||
ViewContext vc;
|
ViewContext vc;
|
||||||
EditMesh *em;
|
EditMesh *em;
|
||||||
EditEdge *eed;
|
EditEdge *eed, *eed_act= NULL;
|
||||||
int dist= 50;
|
int dist= 50;
|
||||||
|
|
||||||
em_setup_viewcontext(C, &vc);
|
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;
|
EditSelection *ese = em->selected.last;
|
||||||
|
|
||||||
if(ese && ese->type == EDITEDGE) {
|
if(ese && ese->type == EDITEDGE) {
|
||||||
EditEdge *eed_act;
|
|
||||||
eed_act = (EditEdge*)ese->data;
|
eed_act = (EditEdge*)ese->data;
|
||||||
if (eed_act != eed) {
|
if (eed_act != eed) {
|
||||||
if (edgetag_shortest_path(vc.scene, em, 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);
|
int act = (edgetag_context_check(vc.scene, eed)==0);
|
||||||
edgetag_context_set(vc.scene, eed, act); /* switch the edge option */
|
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 */
|
/* 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);
|
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_store_selection(em, eed, EDITEDGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
EM_selectmode_flush(em);
|
||||||
|
|
||||||
/* force drawmode for mesh */
|
/* force drawmode for mesh */
|
||||||
switch (vc.scene->toolsettings->edge_mode) {
|
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."},
|
{SK_CONVERT_RETARGET, "RETARGET", 0, "Retarget", "Retarget template bone chain to stroke."},
|
||||||
{0, NULL, 0, NULL, NULL}};
|
{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);
|
srna= RNA_def_struct(brna, "ToolSettings", NULL);
|
||||||
RNA_def_struct_ui_text(srna, "Tool Settings", "");
|
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_float_sdna(prop, NULL, "vgroup_weight");
|
||||||
RNA_def_property_ui_text(prop, "Vertex Group Weight", "Weight to assign in vertex groups.");
|
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 */
|
/* etch-a-ton */
|
||||||
prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
|
prop= RNA_def_property(srna, "bone_sketching", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
|
RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
|
||||||
|
Loading…
Reference in New Issue
Block a user