ID management: use FOREACH_MAIN_ID in some places.
This commit is contained in:
parent
4c2330bd53
commit
00d2e9096f
|
@ -460,23 +460,16 @@ bool BKE_blendfile_read_from_memfile(
|
|||
void BKE_blendfile_read_make_empty(bContext *C)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
|
||||
ListBase *lbarray[MAX_LIBARRAY];
|
||||
ID *id;
|
||||
int a;
|
||||
|
||||
a = set_listbasepointers(bmain, lbarray);
|
||||
while (a--) {
|
||||
id = lbarray[a]->first;
|
||||
if (id != NULL) {
|
||||
if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
|
||||
continue;
|
||||
}
|
||||
while ((id = lbarray[a]->first)) {
|
||||
BKE_id_delete(bmain, id);
|
||||
}
|
||||
FOREACH_MAIN_ID_BEGIN(bmain, id)
|
||||
{
|
||||
if (ELEM(GS(id->name), ID_SCE, ID_SCR, ID_WM, ID_WS)) {
|
||||
break; /* Only breaks iter on that ID type, and continues with IDs of next type. */
|
||||
}
|
||||
BKE_id_delete(bmain, id);
|
||||
}
|
||||
FOREACH_MAIN_ID_END;
|
||||
}
|
||||
|
||||
/* only read the userdef from a .blend */
|
||||
|
|
Loading…
Reference in New Issue