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>2011-09-06 15:38:44 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2011-09-06 15:38:44 +0400
commitc6002873fa5b967ce30b9fc827fb6abc0931ef3c (patch)
tree0084c228f97f905e8290403f390c84d7c65b1997
parentaabd702dbdbba5af116f37c401f6a17f0ac714ca (diff)
Backward compatibility fix for SOCK_DYNAMICS flag on group sockets.
This is currently only needed for displaying the up/down buttons of group sockets. All regular group sockets should have this flag to indicate they are added by the user. More complex "group-type" trees may use non-dynamic sockets in the future for sockets that are not supposed to be manipulated.
-rw-r--r--source/blender/blenloader/intern/readfile.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 355fc14705a..66e38f1c5f8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -7015,6 +7015,15 @@ static void do_versions_nodetree_default_value(bNodeTree *ntree)
do_versions_socket_default_value(sock);
}
+static void do_versions_nodetree_dynamic_sockets(bNodeTree *ntree)
+{
+ bNodeSocket *sock;
+ for (sock=ntree->inputs.first; sock; sock=sock->next)
+ sock->flag |= SOCK_DYNAMIC;
+ for (sock=ntree->outputs.first; sock; sock=sock->next)
+ sock->flag |= SOCK_DYNAMIC;
+}
+
static void do_versions(FileData *fd, Library *lib, Main *main)
{
/* WATCH IT!!!: pointers from libdata have not been converted */
@@ -11972,6 +11981,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
tex->nodetree->update |= NTREE_UPDATE;
}
}
+
+ /* add SOCK_DYNAMIC flag to existing group sockets */
+ {
+ bNodeTree *ntree;
+ /* only need to do this for trees in main, local trees are not used as groups */
+ for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next) {
+ do_versions_nodetree_dynamic_sockets(ntree);
+ ntree->update |= NTREE_UPDATE;
+ }
+ }
}
/* put compatibility code here until next subversion bump */