Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_280.c
| Show First 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | static void do_version_scene_collection_to_collection(Main *bmain, Scene *scene) | ||||
| /* Convert old 2.8 scene collections to new unified collections. */ | /* Convert old 2.8 scene collections to new unified collections. */ | ||||
| /* Temporarily clear view layers so we don't do any layer collection syncing | /* Temporarily clear view layers so we don't do any layer collection syncing | ||||
| * and destroy old flags that we want to restore. */ | * and destroy old flags that we want to restore. */ | ||||
| ListBase view_layers = scene->view_layers; | ListBase view_layers = scene->view_layers; | ||||
| BLI_listbase_clear(&scene->view_layers); | BLI_listbase_clear(&scene->view_layers); | ||||
| if (!scene->master_collection) { | if (!scene->master_collection) { | ||||
| scene->master_collection = BKE_collection_master_add(); | scene->master_collection = BKE_collection_master_add(scene); | ||||
| } | } | ||||
| /* Convert scene collections. */ | /* Convert scene collections. */ | ||||
| GHash *collection_map = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); | GHash *collection_map = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); | ||||
| if (scene->collection) { | if (scene->collection) { | ||||
| do_version_scene_collection_convert( | do_version_scene_collection_convert( | ||||
| bmain, &scene->id, scene->collection, scene->master_collection, collection_map); | bmain, &scene->id, scene->collection, scene->master_collection, collection_map); | ||||
| scene->collection = NULL; | scene->collection = NULL; | ||||
| Show All 27 Lines | |||||
| } | } | ||||
| #endif | #endif | ||||
| static void do_version_layers_to_collections(Main *bmain, Scene *scene) | static void do_version_layers_to_collections(Main *bmain, Scene *scene) | ||||
| { | { | ||||
| /* Since we don't have access to FileData we check the (always valid) first | /* Since we don't have access to FileData we check the (always valid) first | ||||
| * render layer instead. */ | * render layer instead. */ | ||||
| if (!scene->master_collection) { | if (!scene->master_collection) { | ||||
| scene->master_collection = BKE_collection_master_add(); | scene->master_collection = BKE_collection_master_add(scene); | ||||
| } | } | ||||
| if (scene->view_layers.first) { | if (scene->view_layers.first) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* Create collections from layers. */ | /* Create collections from layers. */ | ||||
| Collection *collection_master = scene->master_collection; | Collection *collection_master = scene->master_collection; | ||||
| ▲ Show 20 Lines • Show All 4,667 Lines • Show Last 20 Lines | |||||