[Bf-blender-cvs] [20bf736ff81] master: Fix T86645: Executing "Operator Cheat Sheet" Crashes Blender

Julian Eisel noreply at git.blender.org
Wed Mar 17 12:52:51 CET 2021


Commit: 20bf736ff81c6fb79558796b74d50d4e7a9c8ef6
Author: Julian Eisel
Date:   Wed Mar 17 12:44:28 2021 +0100
Branches: master
https://developer.blender.org/rB20bf736ff81c6fb79558796b74d50d4e7a9c8ef6

Fix T86645: Executing "Operator Cheat Sheet" Crashes Blender

The "Operator Cheat Sheet" operator collects info about all operators, and as
part of that executes the callbacks to create dynamic enums. The callback to
enumerate the Outliner ID operations depends on Outliner context. If this isn't
available, it can just return a context-less version of the enum, that is, a
static enum with all available items. This was already done in case no context
is available at all.

===================================================================

M	source/blender/editors/space_outliner/outliner_tools.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index d9641930134..5e9af78d17b 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -1854,7 +1854,7 @@ static bool outliner_id_operation_item_poll(bContext *C,
       }
       return false;
     case OUTLINER_IDOP_SINGLE:
-      if (!space_outliner || ELEM(space_outliner->outlinevis, SO_SCENES, SO_VIEW_LAYER)) {
+      if (ELEM(space_outliner->outlinevis, SO_SCENES, SO_VIEW_LAYER)) {
         return true;
       }
       /* TODO(dalai): enable in the few cases where this can be supported
@@ -1873,7 +1873,7 @@ static const EnumPropertyItem *outliner_id_operation_itemf(bContext *C,
   EnumPropertyItem *items = NULL;
   int totitem = 0;
 
-  if (C == NULL) {
+  if ((C == NULL) || (ED_operator_outliner_active(C) == false)) {
     return prop_id_op_types;
   }
   for (const EnumPropertyItem *it = prop_id_op_types; it->identifier != NULL; it++) {



More information about the Bf-blender-cvs mailing list