diff options
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5d30bf6ff73..a6da0762b1c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5708,8 +5708,9 @@ static void lib_link_screen(FileData *fd, Main *main) ntree = nodetree_from_id(snode->id); if (ntree) snode->nodetree = ntree; - else - snode->nodetree = newlibadr(fd, sc->id.lib, snode->nodetree); + else { + snode->nodetree = newlibadr_us(fd, sc->id.lib, snode->nodetree); + } for (path = snode->treepath.first; path; path = path->next) { if (path == snode->treepath.first) { @@ -5717,7 +5718,7 @@ static void lib_link_screen(FileData *fd, Main *main) path->nodetree = snode->nodetree; } else - path->nodetree = newlibadr(fd, sc->id.lib, path->nodetree); + path->nodetree = newlibadr_us(fd, sc->id.lib, path->nodetree); if (!path->nodetree) break; @@ -6046,7 +6047,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc path->nodetree = snode->nodetree; } else - path->nodetree= restore_pointer_by_name(newmain, (ID*)path->nodetree, 0); + path->nodetree= restore_pointer_by_name(newmain, (ID*)path->nodetree, 2); if (!path->nodetree) break; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 07fa6997e99..8d6363d3bbe 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -41,6 +41,7 @@ #include "BLI_math.h" #include "BKE_context.h" +#include "BKE_library.h" #include "BKE_screen.h" #include "BKE_node.h" @@ -83,6 +84,8 @@ void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from) BLI_strncpy(path->node_name, id->name + 2, sizeof(path->node_name)); BLI_addtail(&snode->treepath, path); + + id_us_ensure_real(&ntree->id); } /* update current tree */ @@ -116,6 +119,8 @@ void ED_node_tree_push(SpaceNode *snode, bNodeTree *ntree, bNode *gnode) BLI_addtail(&snode->treepath, path); + id_us_ensure_real(&ntree->id); + /* update current tree */ snode->edittree = ntree; |