Fix #111721: Node interface root panel flag missing

The file in question does not have the default (internal) root panel
flag for allowing child panels. This was probably saved before the flag
was added. A simple versioning snippet takes care of this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111828
This commit is contained in:
Lukas Tönne 2023-09-02 15:58:19 +02:00
parent 5a7df8f587
commit 79a6a6977a
2 changed files with 9 additions and 1 deletions

@ -29,7 +29,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 21
#define BLENDER_FILE_SUBVERSION 22
/* 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

@ -1007,6 +1007,14 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
FOREACH_NODETREE_END;
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 22)) {
/* Initialize root panel flags in files created before these flags were added. */
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
ntree->tree_interface.root_panel.flag |= NODE_INTERFACE_PANEL_ALLOW_CHILD_PANELS;
}
FOREACH_NODETREE_END;
}
/**
* Versioning code until next subversion bump goes here.
*