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:
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py1
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c17
-rw-r--r--source/blender/makesrna/intern/rna_scene.c14
3 files changed, 26 insertions, 6 deletions
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index e8e892f682f..fddce61c7cf 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -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 ****************
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);