LibOverride: Massive edits to 'editable' IDs checks in editors code.

Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes
previous check (simple `ID_IS_LINKED()` macro) for many editing cases.

This allows to also take into account 'system override' (aka
non-editable override) case.

Ref: {T95707}.
This commit is contained in:
2022-03-28 17:34:36 +02:00
parent 354db59fb1
commit 5596f79821
45 changed files with 195 additions and 118 deletions

View File

@@ -19,6 +19,7 @@
#include "BKE_collection.h"
#include "BKE_global.h"
#include "BKE_lib_id.h"
#include "BKE_lib_remap.h"
#include "BKE_main.h"
#include "BKE_material.h"
@@ -124,8 +125,8 @@ void ED_editors_init(bContext *C)
if (obact == NULL || ob->type != obact->type) {
continue;
}
/* Object mode is enforced for linked data (or their obdata). */
if (ID_IS_LINKED(ob) || (ob_data != NULL && ID_IS_LINKED(ob_data))) {
/* Object mode is enforced for non-editable data (or their obdata). */
if (!BKE_id_is_editable(bmain, &ob->id) || (ob_data != NULL && !BKE_id_is_editable(bmain, ob_data))) {
continue;
}