Fix #112439: Don't hide sockets of Reroute node #112965
|
@ -29,7 +29,7 @@ extern "C" {
|
|||
|
||||
/* Blender file format version. */
|
||||
#define BLENDER_FILE_VERSION BLENDER_VERSION
|
||||
#define BLENDER_FILE_SUBVERSION 28
|
||||
#define BLENDER_FILE_SUBVERSION 29
|
||||
|
||||
/* Minimum Blender version that supports reading file written with the current
|
||||
* version. Older Blender versions will test this and cancel loading the file, showing a warning to
|
||||
|
|
|
@ -1546,6 +1546,19 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
|
|||
}
|
||||
}
|
||||
|
||||
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 29)) {
|
||||
/* Unhide all Reroute nodes. */
|
||||
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
|
||||
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
|
||||
if (node->is_reroute()) {
|
||||
static_cast<bNodeSocket *>(node->inputs.first)->flag &= ~SOCK_HIDDEN;
|
||||
static_cast<bNodeSocket *>(node->outputs.first)->flag &= ~SOCK_HIDDEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
FOREACH_NODETREE_END;
|
||||
}
|
||||
|
||||
/**
|
||||
* Versioning code until next subversion bump goes here.
|
||||
*
|
||||
|
|
|
@ -1102,6 +1102,11 @@ bool node_has_hidden_sockets(bNode *node)
|
|||
|
||||
void node_set_hidden_sockets(bNode *node, int set)
|
||||
{
|
||||
/* The Reroute node is the socket itself, do not hide this. */
|
||||
if (node->is_reroute()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (set == 0) {
|
||||
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
|
||||
sock->flag &= ~SOCK_HIDDEN;
|
||||
|
|
|
@ -293,6 +293,15 @@ static void rna_NodeSocket_hide_set(PointerRNA *ptr, bool value)
|
|||
return;
|
||||
}
|
||||
|
||||
bNodeTree *ntree = reinterpret_cast<bNodeTree *>(ptr->owner_id);
|
||||
bNode *node;
|
||||
nodeFindNode(ntree, sock, &node, nullptr);
|
||||
|
||||
/* The Reroute node is the socket itself, do not hide this. */
|
||||
if (node->is_reroute()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value) {
|
||||
sock->flag |= SOCK_HIDDEN;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue