Cleanup: use ntreeFromID

This commit is contained in:
Campbell Barton 2015-05-07 00:18:11 +10:00
parent 1d88bfce40
commit 14d55ab7a3
1 changed files with 4 additions and 9 deletions

View File

@ -1415,16 +1415,11 @@ void id_clear_lib_data(Main *bmain, ID *id)
/* internal bNodeTree blocks inside ID types below
* also stores id->lib, make sure this stays in sync.
*/
switch (GS(id->name)) {
case ID_SCE: ntree = ((Scene *)id)->nodetree; break;
case ID_MA: ntree = ((Material *)id)->nodetree; break;
case ID_LA: ntree = ((Lamp *)id)->nodetree; break;
case ID_WO: ntree = ((World *)id)->nodetree; break;
case ID_TE: ntree = ((Tex *)id)->nodetree; break;
case ID_LS: ntree = ((FreestyleLineStyle *)id)->nodetree; break;
}
if (ntree)
ntree = ntreeFromID(id);
if (ntree) {
ntree->id.lib = NULL;
}
}
/* next to indirect usage in read/writefile also in editobject.c scene.c */