Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-07-08 15:38:11 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-07-08 15:38:11 +0400
commitd75e0f320b4af13d5a35c5787a8ff992b959149e (patch)
tree0228762468e5093a3310994a38cc463f30c4dd32 /source/blender/blenloader
parentfa7e690a91258cfcfd266d48a4b084ba734d7b5f (diff)
Fix #36024. This part fixes user counting for node editor trees. The user count previously would only work correctly for node trees which are part of material, scene, etc. or linked by group nodes. Any
custom pynodes tree edited directly as library data would get a 0 user count on reload and subsequently not be saved. Now the node space follows the same pattern as the image space: the node tree(s) user count gets incremented on file load and opening in the editor ensures a real user. This leads to 1 "unreal" user for the editor (dropped on reload), but seems to be the only viable solution atm.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c9
1 files changed, 5 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;