Merge branch 'master' into blender2.8
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index 739f05ee9a1354a1f896455b29f7ee9e7bd59ea5..b1e4b6a1d868fffc1bffc1c5ab03f1e5dda12885 100644 (file)
@@ -1118,6 +1118,9 @@ bool WM_operator_last_properties_store(wmOperator *UNUSED(op))
 
 #endif
 
+/**
+ * Also used for exec when 'event' is NULL.
+ */
 static int wm_operator_invoke(
         bContext *C, wmOperatorType *ot, wmEvent *event,
         PointerRNA *properties, ReportList *reports, const bool poll_only)
@@ -1133,7 +1136,9 @@ static int wm_operator_invoke(
                wmOperator *op = wm_operator_create(wm, ot, properties, reports); /* if reports == NULL, they'll be initialized */
                const bool is_nested_call = (wm->op_undo_depth != 0);
                
-               op->flag |= OP_IS_INVOKE;
+               if (event != NULL) {
+                       op->flag |= OP_IS_INVOKE;
+               }
 
                /* initialize setting from previous run */
                if (!is_nested_call) { /* not called by py script */