diff options
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 55d88240100..d416f4faae4 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -212,6 +212,25 @@ void do_versions_after_linking_280(Main *main) } } +static void do_version_layer_collections_idproperties(ListBase *lb) +{ + IDPropertyTemplate val = {0}; + for (LayerCollection *lc = lb->first; lc; lc = lc->next) { + lc->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); + BKE_layer_collection_engine_settings_create(lc->properties); + + /* No overrides at first */ + for (IDProperty *prop = lc->properties->data.group.first; prop; prop = prop->next) { + while (prop->data.group.first) { + IDP_FreeFromGroup(prop, prop->data.group.first); + } + } + + /* Do it recursively */ + do_version_layer_collections_idproperties(&lc->layer_collections); + } +} + void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 280, 0)) { @@ -237,5 +256,15 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) ob->collection_properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); } } + + if (DNA_struct_elem_find(fd->filesdna, "LayerCollection", "ListBase", "engine_settings") && + !DNA_struct_elem_find(fd->filesdna, "LayerCollection", "IDProperty", "properties")) + { + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { + for (SceneLayer *sl = scene->render_layers.first; sl; sl = sl->next) { + do_version_layer_collections_idproperties(&sl->layer_collections); + } + } + } } } |