diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-17 07:28:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-17 07:30:46 +0300 |
commit | b8592b656b124c43a41a7264411d134e5f2bd654 (patch) | |
tree | e5f54c58c7ec771f77eda390f7b17375e741b0c1 /source/blender/editors/mesh | |
parent | f409c1ec9398309dcc34fb0c5f8c4b447c2c3210 (diff) |
Gizmo: Functions to re-initialize a group type
Partially re-initializing a gizmo is often more trouble then removing
and re-adding.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add_gizmo.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c index 460b70cecca..38fc7d58dcf 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.c +++ b/source/blender/editors/mesh/editmesh_add_gizmo.c @@ -380,17 +380,10 @@ static int add_primitive_cube_gizmo_invoke(bContext *C, wmOperator *op, const wm if (ret & OPERATOR_FINISHED) { /* Setup gizmos */ if (v3d && ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0)) { - ARegion *ar = CTX_wm_region(C); - wmGizmoMap *gzmap = ar->gizmo_map; wmGizmoGroupType *gzgt = WM_gizmogrouptype_find("MESH_GGT_add_bounds", false); - wmGizmoGroup *gzgroup = WM_gizmomap_group_find_ptr(gzmap, gzgt); - if (gzgroup != NULL) { - GizmoPlacementGroup *ggd = gzgroup->customdata; - ggd->data.op = op; - gizmo_mesh_placement_modal_from_setup(C, gzgroup); - } - else { - WM_gizmo_group_type_ensure_ptr(gzgt); + if (!WM_gizmo_group_type_ensure_ptr(gzgt)) { + struct Main *bmain = CTX_data_main(C); + WM_gizmo_group_type_reinit_ptr(bmain, gzgt); } } } |