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:
parent
1c1efe3ac6
commit
0df8c22c8a
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue