Fix outliner contextual menu allowing to delete indirect libraries.
There is no way currently to prevent the option from showing in menu, so instead report a warning to user (and curse again current nightmarish system of operation in outliner...). Reported by @sergey, thanks.
This commit is contained in:
parent
0434053f13
commit
fa9bd04483
|
@ -309,9 +309,12 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto
|
|||
ID *id = tselem->id;
|
||||
|
||||
BLI_assert(te->idcode != 0 && id != NULL);
|
||||
BLI_assert(te->idcode != ID_LI || ((Library *)id)->parent == NULL);
|
||||
UNUSED_VARS_NDEBUG(te);
|
||||
|
||||
if (te->idcode == ID_LI && ((Library *)id)->parent != NULL) {
|
||||
BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked library '%s'", id->name);
|
||||
return;
|
||||
}
|
||||
if (id->tag & LIB_TAG_INDIRECT) {
|
||||
BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked id '%s'", id->name);
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue