diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 112d76a3e65..ef81addbb4d 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -470,6 +470,8 @@ int WM_operator_repeat(struct bContext *C, struct wmOperator *op); int WM_operator_repeat_last(struct bContext *C, struct wmOperator *op); bool WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op); bool WM_operator_is_repeat(const struct bContext *C, const struct wmOperator *op); + +bool WM_operator_name_poll(struct bContext *C, const char *opstring); int WM_operator_name_call_ptr(struct bContext *C, struct wmOperatorType *ot, short context, diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 798f60fba3d..b780fef289a 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1611,6 +1611,16 @@ int WM_operator_name_call(bContext *C, const char *opstring, short context, Poin return 0; } +bool WM_operator_name_poll(bContext *C, const char *opstring) +{ + wmOperatorType *ot = WM_operatortype_find(opstring, 0); + if (!ot) { + return false; + } + + return WM_operator_poll(C, ot); +} + int WM_operator_name_call_with_properties(struct bContext *C, const char *opstring, short context, |