LibOverrides: Tweak to ensure no overrides can be created on linked data.

Was already mostly the case, but from RNA API there was no proper check.
This commit is contained in:
Bastien Montagne 2022-03-08 11:01:34 +01:00
parent 1c1efe3ac6
commit 0df8c22c8a
2 changed files with 6 additions and 0 deletions

View File

@ -2854,6 +2854,7 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
bool BKE_lib_override_library_operations_create(Main *bmain, ID *local)
{
BLI_assert(!ID_IS_LINKED(local));
BLI_assert(local->override_library != NULL);
const bool is_template = (local->override_library->reference == NULL);
bool created = false;

View File

@ -744,6 +744,11 @@ static void rna_ID_override_library_operations_update(ID *id,
return;
}
if (ID_IS_LINKED(id)) {
BKE_reportf(reports, RPT_ERROR, "ID '%s' is linked, cannot edit its overrides", id->name);
return;
}
BKE_lib_override_library_operations_create(bmain, id);
WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);