Nodes: call init function for new node trees in ntreeAddTree

Issue found in D15033, for some more info see comments there.
This commit is contained in:
Jacques Lucke 2022-05-30 12:43:26 +02:00
parent ce1dd44c68
commit 2f77b2daac
1 changed files with 1 additions and 0 deletions

View File

@ -2668,6 +2668,7 @@ bNodeTree *ntreeAddTree(Main *bmain, const char *name, const char *idname)
flag |= LIB_ID_CREATE_NO_MAIN;
}
bNodeTree *ntree = (bNodeTree *)BKE_libblock_alloc(bmain, ID_NT, name, flag);
BKE_libblock_init_empty(&ntree->id);
if (is_embedded) {
ntree->id.flag |= LIB_EMBEDDED_DATA;
}