diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-21 07:35:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-21 07:35:29 +0300 |
commit | 6b6105a87ebf9f81f981d8624535690aef8a798b (patch) | |
tree | 9513ff2fcb6fed75297e7c81c6e1ea108e68f015 /source/blender | |
parent | 67c3791f63c03e205e2c4683988f8127f3a476e0 (diff) |
Gizmo: run invoke_prepare even when the gizmo isn't modal
This is useful for setting up state for gizmos that run
operators too.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index ede0f7c96ea..ec8e012b1a7 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -945,12 +945,14 @@ void wm_gizmomap_modal_set( WM_tooltip_clear(C, win); + /* Use even if we don't have invoke, so we can setup data before an operator runs. */ + if (gz->parent_gzgroup->type->invoke_prepare) { + gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz); + } + if (gz->type->invoke && (gz->type->modal || gz->custom_modal)) { - if (gz->parent_gzgroup->type->invoke_prepare) { - gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz); - } const int retval = gz->type->invoke(C, gz, event); if ((retval & OPERATOR_RUNNING_MODAL) == 0) { return; |