Fix T62438: Unhide all doesn't set newly visible objects to selected

The select option in the operator was never working because we were
trying to select an object considered unselectable (since it was hidden).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4527
This commit is contained in:
Dalai Felinto 2019-03-15 16:14:21 -03:00
parent 713010bd77
commit b7d942446f

@ -77,6 +77,7 @@
#include "BKE_softbody.h"
#include "BKE_editmesh.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_workspace.h"
#include "DEG_depsgraph.h"
@ -162,7 +163,10 @@ static int object_hide_view_clear_exec(bContext *C, wmOperator *op)
changed = true;
if (select) {
ED_object_base_select(base, BA_SELECT);
/* We cannot call `ED_object_base_select` because
* base is not selectable while it is hidden. */
base->flag |= BASE_SELECTED;
BKE_scene_object_base_flag_sync_from_base(base);
}
}
}