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:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_loopcut.c')
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 727b595bbe0..4fc57224580 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -436,6 +436,25 @@ static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event)
static int ringcut_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
+ /* When accessed as a tool, get the active edge from the preselection gizmo. */
+ {
+ ARegion *ar = CTX_wm_region(C);
+ wmGizmoMap *gzmap = ar->gizmo_map;
+ wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_edgering") : NULL;
+ if (gzgroup != NULL) {
+ wmGizmo *gz = gzgroup->gizmos.first;
+ const int object_index = RNA_int_get(gz->ptr, "object_index");
+ const int edge_index = RNA_int_get(gz->ptr, "edge_index");
+
+ if (object_index != -1 && edge_index != -1) {
+ RNA_int_set(op->ptr, "object_index", object_index);
+ RNA_int_set(op->ptr, "edge_index", edge_index);
+ return loopcut_init(C, op, NULL);
+ }
+ return OPERATOR_CANCELLED;
+ }
+ }
+
return loopcut_init(C, op, event);
}