diff options
Diffstat (limited to 'source/blender/blenloader/intern/versioning_300.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 78 |
1 files changed, 52 insertions, 26 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 18baebf57fb..125f3be0dd1 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -1279,6 +1279,18 @@ static void version_geometry_nodes_set_position_node_offset(bNodeTree *ntree) } } +static void version_node_tree_socket_id_delim(bNodeTree *ntree) +{ + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) { + version_node_socket_id_delim(socket); + } + LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) { + version_node_socket_id_delim(socket); + } + } +} + static bool version_fix_seq_meta_range(Sequence *seq, void *user_data) { Scene *scene = (Scene *)user_data; @@ -2299,35 +2311,11 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 300, 42)) { - /* Update LibOverride operations regarding insertions in RNA collections (i.e. modifiers, - * constraints and NLA tracks). */ - ID *id_iter; - FOREACH_MAIN_ID_BEGIN (bmain, id_iter) { - if (ID_IS_OVERRIDE_LIBRARY_REAL(id_iter)) { - version_liboverride_rnacollections_insertion_animdata(id_iter); - if (GS(id_iter->name) == ID_OB) { - version_liboverride_rnacollections_insertion_object((Object *)id_iter); - } - } - } - FOREACH_MAIN_ID_END; - /* Use consistent socket identifiers for the math node. * The code to make unique identifiers from the names was inconsistent. */ FOREACH_NODETREE_BEGIN (bmain, ntree, id) { - if (ELEM(ntree->type, NTREE_SHADER, NTREE_GEOMETRY)) { - LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { - if (node->type == SH_NODE_MATH) { - bNodeSocket *value1 = ((bNodeSocket *)node->inputs.first)->next; - bNodeSocket *value2 = value1->next; - strcpy(value1->identifier, "Value_001"); - if (value2 != NULL) { - /* This can be null when file is quite old so that the socket did not exist - * (before 0406eb110332a8). */ - strcpy(value2->identifier, "Value_002"); - } - } - } + if (ntree->type != NTREE_CUSTOM) { + version_node_tree_socket_id_delim(ntree); } } FOREACH_NODETREE_END; @@ -2348,6 +2336,25 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + /* Change minimum zoom to 0.05f in the node editor. */ + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype == SPACE_NODE) { + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; + LISTBASE_FOREACH (ARegion *, region, regionbase) { + if (region->regiontype == RGN_TYPE_WINDOW) { + if (region->v2d.minzoom > 0.05f) { + region->v2d.minzoom = 0.05f; + } + } + } + } + } + } + } + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { Editing *ed = SEQ_editing_get(scene); /* Make sure range of meta strips is correct. @@ -2360,6 +2367,24 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + /* Special case to handle older in-dev 3.1 files, before change from 3.0 branch gets merged in + * master. */ + if (!MAIN_VERSION_ATLEAST(bmain, 300, 42) || + (bmain->versionfile == 301 && !MAIN_VERSION_ATLEAST(bmain, 301, 3))) { + /* Update LibOverride operations regarding insertions in RNA collections (i.e. modifiers, + * constraints and NLA tracks). */ + ID *id_iter; + FOREACH_MAIN_ID_BEGIN (bmain, id_iter) { + if (ID_IS_OVERRIDE_LIBRARY_REAL(id_iter)) { + version_liboverride_rnacollections_insertion_animdata(id_iter); + if (GS(id_iter->name) == ID_OB) { + version_liboverride_rnacollections_insertion_object((Object *)id_iter); + } + } + } + FOREACH_MAIN_ID_END; + } + /** * Versioning code until next subversion bump goes here. * @@ -2370,5 +2395,6 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) * \note Keep this message at the bottom of the function. */ { + /* Keep this block, even when empty. */ } } |