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.
This commit is contained in:
@@ -7015,6 +7015,15 @@ static void do_versions_nodetree_default_value(bNodeTree *ntree)
|
|||||||
do_versions_socket_default_value(sock);
|
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)
|
static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||||
{
|
{
|
||||||
/* WATCH IT!!!: pointers from libdata have not been converted */
|
/* 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;
|
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 */
|
/* put compatibility code here until next subversion bump */
|
||||||
|
|||||||
Reference in New Issue
Block a user