[Bf-blender-cvs] [d772c6ea315] master: Fix T74009: `bpy.ops.outliner.orphans_purge()` poll being too restrictive.

Bastien Montagne noreply at git.blender.org
Wed Feb 19 17:10:48 CET 2020


Commit: d772c6ea315c5c34524aa3283ddc17eaf660798c
Author: Bastien Montagne
Date:   Wed Feb 19 17:08:58 2020 +0100
Branches: master
https://developer.blender.org/rBd772c6ea315c5c34524aa3283ddc17eaf660798c

Fix T74009: `bpy.ops.outliner.orphans_purge()` poll being too restrictive.

There is no reason to even require an editor at all here, for now just
kept the 'orphan view needed' condition for the outliner case only.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 1bdb68f49fe..5c5c5ade726 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -2177,17 +2177,11 @@ void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot)
 static bool ed_operator_outliner_id_orphans_active(bContext *C)
 {
   ScrArea *sa = CTX_wm_area(C);
-  if (sa != NULL) {
-    if (sa->spacetype == SPACE_TOPBAR) {
-      return true;
-    }
-
-    if (sa->spacetype == SPACE_OUTLINER) {
-      SpaceOutliner *so = CTX_wm_space_outliner(C);
-      return (so->outlinevis == SO_ID_ORPHANS);
-    }
+  if (sa != NULL && sa->spacetype == SPACE_OUTLINER) {
+    SpaceOutliner *so = CTX_wm_space_outliner(C);
+    return (so->outlinevis == SO_ID_ORPHANS);
   }
-  return 0;
+  return true;
 }
 
 /* Purge Orphans Operator --------------------------------------- */



More information about the Bf-blender-cvs mailing list