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.
This commit is contained in:
Bastien Montagne 2020-02-19 17:08:58 +01:00
parent 1c0230b573
commit d772c6ea31
Notes: blender-bot 2023-02-14 11:28:39 +01:00
Referenced by issue #74009, Adding bpy.ops.outliner.orphans_purge() to the QuickMenu leaves it inaccessible, because poll() prevents it from being run
1 changed files with 4 additions and 10 deletions

View File

@ -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 --------------------------------------- */