diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-08 01:29:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-08 01:50:00 +0300 |
commit | 8f817de0cbef41dac81e6c7665ada509c3fe2988 (patch) | |
tree | 0802c3287116ce0bf600adc4bed8cba31cfc97b1 | |
parent | e68ac2827dd4f8ad346011a8a408b342e2718707 (diff) |
Cleanup: use plural names for Main lists
Convention was not to but after discussion on 918941483f7e we agree its
best to change the convention.
Names now mostly follow RNA.
Some exceptions:
- Use 'nodetrees' instead of 'nodegroups'
since the struct is called NodeTree.
- Use 'gpencils' instead of 'grease_pencil'
since 'gpencil' is a common abbreviation in the C code.
Other exceptions:
- Leave 'wm' as it's a list of one.
- Leave 'ipo' as is for versioning.
130 files changed, 1268 insertions, 1268 deletions
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 50d9567fba7..e7771827b2b 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -682,7 +682,7 @@ namespace utils { static void build_mat_map(const Main *bmain, std::map<std::string, Material *> &mat_map) { - Material *material = static_cast<Material *>(bmain->mat.first); + Material *material = static_cast<Material *>(bmain->materials.first); for (; material; material = static_cast<Material *>(material->id.next)) { mat_map[material->id.name + 2] = material; diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 48f9ac1a0da..03f9f9a21ea 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -84,42 +84,42 @@ typedef struct Main { BlendThumbnail *blen_thumb; struct Library *curlib; - ListBase scene; - ListBase library; - ListBase object; - ListBase mesh; - ListBase curve; - ListBase mball; - ListBase mat; - ListBase tex; - ListBase image; - ListBase lattice; - ListBase light; - ListBase camera; - ListBase ipo; // XXX deprecated - ListBase key; - ListBase world; - ListBase screen; - ListBase vfont; - ListBase text; - ListBase speaker; - ListBase lightprobe; - ListBase sound; - ListBase collection; - ListBase armature; - ListBase action; - ListBase nodetree; - ListBase brush; - ListBase particle; - ListBase palette; - ListBase paintcurve; - ListBase wm; - ListBase gpencil; - ListBase movieclip; - ListBase mask; - ListBase linestyle; - ListBase cachefile; - ListBase workspace; + ListBase scenes; + ListBase libraries; + ListBase objects; + ListBase meshes; + ListBase curves; + ListBase metaballs; + ListBase materials; + ListBase textures; + ListBase images; + ListBase lattices; + ListBase lights; + ListBase cameras; + ListBase ipo; /* Deprecated (only for versioning). */ + ListBase shapekeys; + ListBase worlds; + ListBase screens; + ListBase fonts; + ListBase texts; + ListBase speakers; + ListBase lightprobes; + ListBase sounds; + ListBase collections; + ListBase armatures; + ListBase actions; + ListBase nodetrees; + ListBase brushes; + ListBase particles; + ListBase palettes; + ListBase paintcurves; + ListBase wm; /* Singleton (exception). */ + ListBase gpencils; + ListBase movieclips; + ListBase masks; + ListBase linestyles; + ListBase cachefiles; + ListBase workspaces; /* Must be generated, used and freed by same code - never assume this is valid data unless you know * when, who and how it was created. diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 0a45e9c0172..9ba3a23df05 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1005,7 +1005,7 @@ void framechange_poses_clear_unkeyed(Main *bmain) /* This needs to be done for each object that has a pose */ /* TODO: proxies may/may not be correctly handled here... (this needs checking) */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* we only need to do this on objects with a pose */ if ((pose = ob->pose)) { for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 7c1c26948b4..33f19caf1cc 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1135,70 +1135,70 @@ void BKE_animdata_main_cb(Main *bmain, ID_AnimData_Edit_Callback func, void *use } (void)0 /* nodes */ - ANIMDATA_IDS_CB(bmain->nodetree.first); + ANIMDATA_IDS_CB(bmain->nodetrees.first); /* textures */ - ANIMDATA_NODETREE_IDS_CB(bmain->tex.first, Tex); + ANIMDATA_NODETREE_IDS_CB(bmain->textures.first, Tex); /* lights */ - ANIMDATA_NODETREE_IDS_CB(bmain->light.first, Light); + ANIMDATA_NODETREE_IDS_CB(bmain->lights.first, Light); /* materials */ - ANIMDATA_NODETREE_IDS_CB(bmain->mat.first, Material); + ANIMDATA_NODETREE_IDS_CB(bmain->materials.first, Material); /* cameras */ - ANIMDATA_IDS_CB(bmain->camera.first); + ANIMDATA_IDS_CB(bmain->cameras.first); /* shapekeys */ - ANIMDATA_IDS_CB(bmain->key.first); + ANIMDATA_IDS_CB(bmain->shapekeys.first); /* metaballs */ - ANIMDATA_IDS_CB(bmain->mball.first); + ANIMDATA_IDS_CB(bmain->metaballs.first); /* curves */ - ANIMDATA_IDS_CB(bmain->curve.first); + ANIMDATA_IDS_CB(bmain->curves.first); /* armatures */ - ANIMDATA_IDS_CB(bmain->armature.first); + ANIMDATA_IDS_CB(bmain->armatures.first); /* lattices */ - ANIMDATA_IDS_CB(bmain->lattice.first); + ANIMDATA_IDS_CB(bmain->lattices.first); /* meshes */ - ANIMDATA_IDS_CB(bmain->mesh.first); + ANIMDATA_IDS_CB(bmain->meshes.first); /* particles */ - ANIMDATA_IDS_CB(bmain->particle.first); + ANIMDATA_IDS_CB(bmain->particles.first); /* speakers */ - ANIMDATA_IDS_CB(bmain->speaker.first); + ANIMDATA_IDS_CB(bmain->speakers.first); /* movie clips */ - ANIMDATA_IDS_CB(bmain->movieclip.first); + ANIMDATA_IDS_CB(bmain->movieclips.first); /* objects */ - ANIMDATA_IDS_CB(bmain->object.first); + ANIMDATA_IDS_CB(bmain->objects.first); /* masks */ - ANIMDATA_IDS_CB(bmain->mask.first); + ANIMDATA_IDS_CB(bmain->masks.first); /* worlds */ - ANIMDATA_NODETREE_IDS_CB(bmain->world.first, World); + ANIMDATA_NODETREE_IDS_CB(bmain->worlds.first, World); /* scenes */ - ANIMDATA_NODETREE_IDS_CB(bmain->scene.first, Scene); + ANIMDATA_NODETREE_IDS_CB(bmain->scenes.first, Scene); /* line styles */ - ANIMDATA_IDS_CB(bmain->linestyle.first); + ANIMDATA_IDS_CB(bmain->linestyles.first); /* grease pencil */ - ANIMDATA_IDS_CB(bmain->gpencil.first); + ANIMDATA_IDS_CB(bmain->gpencils.first); /* palettes */ - ANIMDATA_IDS_CB(bmain->palette.first); + ANIMDATA_IDS_CB(bmain->palettes.first); /* cache files */ - ANIMDATA_IDS_CB(bmain->cachefile.first); + ANIMDATA_IDS_CB(bmain->cachefiles.first); } /* Fix all RNA-Paths throughout the database (directly access the Global.main version) @@ -1234,67 +1234,67 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha } (void)0 /* nodes */ - RENAMEFIX_ANIM_IDS(bmain->nodetree.first); + RENAMEFIX_ANIM_IDS(bmain->nodetrees.first); /* textures */ - RENAMEFIX_ANIM_NODETREE_IDS(bmain->tex.first, Tex); + RENAMEFIX_ANIM_NODETREE_IDS(bmain->textures.first, Tex); /* lights */ - RENAMEFIX_ANIM_NODETREE_IDS(bmain->light.first, Light); + RENAMEFIX_ANIM_NODETREE_IDS(bmain->lights.first, Light); /* materials */ - RENAMEFIX_ANIM_NODETREE_IDS(bmain->mat.first, Material); + RENAMEFIX_ANIM_NODETREE_IDS(bmain->materials.first, Material); /* cameras */ - RENAMEFIX_ANIM_IDS(bmain->camera.first); + RENAMEFIX_ANIM_IDS(bmain->cameras.first); /* shapekeys */ - RENAMEFIX_ANIM_IDS(bmain->key.first); + RENAMEFIX_ANIM_IDS(bmain->shapekeys.first); /* metaballs */ - RENAMEFIX_ANIM_IDS(bmain->mball.first); + RENAMEFIX_ANIM_IDS(bmain->metaballs.first); /* curves */ - RENAMEFIX_ANIM_IDS(bmain->curve.first); + RENAMEFIX_ANIM_IDS(bmain->curves.first); /* armatures */ - RENAMEFIX_ANIM_IDS(bmain->armature.first); + RENAMEFIX_ANIM_IDS(bmain->armatures.first); /* lattices */ - RENAMEFIX_ANIM_IDS(bmain->lattice.first); + RENAMEFIX_ANIM_IDS(bmain->lattices.first); /* meshes */ - RENAMEFIX_ANIM_IDS(bmain->mesh.first); + RENAMEFIX_ANIM_IDS(bmain->meshes.first); /* particles */ - RENAMEFIX_ANIM_IDS(bmain->particle.first); + RENAMEFIX_ANIM_IDS(bmain->particles.first); /* speakers */ - RENAMEFIX_ANIM_IDS(bmain->speaker.first); + RENAMEFIX_ANIM_IDS(bmain->speakers.first); /* movie clips */ - RENAMEFIX_ANIM_IDS(bmain->movieclip.first); + RENAMEFIX_ANIM_IDS(bmain->movieclips.first); /* objects */ - RENAMEFIX_ANIM_IDS(bmain->object.first); + RENAMEFIX_ANIM_IDS(bmain->objects.first); /* masks */ - RENAMEFIX_ANIM_IDS(bmain->mask.first); + RENAMEFIX_ANIM_IDS(bmain->masks.first); /* worlds */ - RENAMEFIX_ANIM_NODETREE_IDS(bmain->world.first, World); + RENAMEFIX_ANIM_NODETREE_IDS(bmain->worlds.first, World); /* linestyles */ - RENAMEFIX_ANIM_IDS(bmain->linestyle.first); + RENAMEFIX_ANIM_IDS(bmain->linestyles.first); /* grease pencil */ - RENAMEFIX_ANIM_IDS(bmain->gpencil.first); + RENAMEFIX_ANIM_IDS(bmain->gpencils.first); /* cache files */ - RENAMEFIX_ANIM_IDS(bmain->cachefile.first); + RENAMEFIX_ANIM_IDS(bmain->cachefiles.first); /* scenes */ - RENAMEFIX_ANIM_NODETREE_IDS(bmain->scene.first, Scene); + RENAMEFIX_ANIM_NODETREE_IDS(bmain->scenes.first, Scene); } /* *********************************** */ @@ -3608,7 +3608,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene * however, if there are some curves, we will need to make sure that their 'ctime' property gets * set correctly, so this optimization must be skipped in that case... */ - if (BLI_listbase_is_empty(&main->action) && BLI_listbase_is_empty(&main->curve)) { + if (BLI_listbase_is_empty(&main->actions) && BLI_listbase_is_empty(&main->curves)) { if (G.debug & G_DEBUG) printf("\tNo Actions, so no animation needs to be evaluated...\n"); @@ -3616,74 +3616,74 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene } /* nodes */ - EVAL_ANIM_IDS(main->nodetree.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->nodetrees.first, ADT_RECALC_ANIM); /* textures */ - EVAL_ANIM_NODETREE_IDS(main->tex.first, Tex, ADT_RECALC_ANIM); + EVAL_ANIM_NODETREE_IDS(main->textures.first, Tex, ADT_RECALC_ANIM); /* lights */ - EVAL_ANIM_NODETREE_IDS(main->light.first, Light, ADT_RECALC_ANIM); + EVAL_ANIM_NODETREE_IDS(main->lights.first, Light, ADT_RECALC_ANIM); /* materials */ - EVAL_ANIM_NODETREE_IDS(main->mat.first, Material, ADT_RECALC_ANIM); + EVAL_ANIM_NODETREE_IDS(main->materials.first, Material, ADT_RECALC_ANIM); /* cameras */ - EVAL_ANIM_IDS(main->camera.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->cameras.first, ADT_RECALC_ANIM); /* shapekeys */ - EVAL_ANIM_IDS(main->key.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->shapekeys.first, ADT_RECALC_ANIM); /* metaballs */ - EVAL_ANIM_IDS(main->mball.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->metaballs.first, ADT_RECALC_ANIM); /* curves */ - EVAL_ANIM_IDS(main->curve.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->curves.first, ADT_RECALC_ANIM); /* armatures */ - EVAL_ANIM_IDS(main->armature.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->armatures.first, ADT_RECALC_ANIM); /* lattices */ - EVAL_ANIM_IDS(main->lattice.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->lattices.first, ADT_RECALC_ANIM); /* meshes */ - EVAL_ANIM_IDS(main->mesh.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->meshes.first, ADT_RECALC_ANIM); /* particles */ - EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->particles.first, ADT_RECALC_ANIM); /* speakers */ - EVAL_ANIM_IDS(main->speaker.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->speakers.first, ADT_RECALC_ANIM); /* movie clips */ - EVAL_ANIM_IDS(main->movieclip.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->movieclips.first, ADT_RECALC_ANIM); /* linestyles */ - EVAL_ANIM_IDS(main->linestyle.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->linestyles.first, ADT_RECALC_ANIM); /* grease pencil */ - EVAL_ANIM_IDS(main->gpencil.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->gpencils.first, ADT_RECALC_ANIM); /* palettes */ - EVAL_ANIM_IDS(main->palette.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->palettes.first, ADT_RECALC_ANIM); /* cache files */ - EVAL_ANIM_IDS(main->cachefile.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->cachefiles.first, ADT_RECALC_ANIM); /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets * this tagged by Depsgraph on framechange. This optimization means that objects * linked from other (not-visible) scenes will not need their data calculated. */ - EVAL_ANIM_IDS(main->object.first, 0); + EVAL_ANIM_IDS(main->objects.first, 0); /* masks */ - EVAL_ANIM_IDS(main->mask.first, ADT_RECALC_ANIM); + EVAL_ANIM_IDS(main->masks.first, ADT_RECALC_ANIM); /* worlds */ - EVAL_ANIM_NODETREE_IDS(main->world.first, World, ADT_RECALC_ANIM); + EVAL_ANIM_NODETREE_IDS(main->worlds.first, World, ADT_RECALC_ANIM); /* scenes */ - EVAL_ANIM_NODETREE_IDS(main->scene.first, Scene, ADT_RECALC_ANIM); + EVAL_ANIM_NODETREE_IDS(main->scenes.first, Scene, ADT_RECALC_ANIM); } /* ***************************************** */ diff --git a/source/blender/blenkernel/intern/blender_copybuffer.c b/source/blender/blenkernel/intern/blender_copybuffer.c index a9ff96b4eb2..bc935f0b760 100644 --- a/source/blender/blenkernel/intern/blender_copybuffer.c +++ b/source/blender/blenkernel/intern/blender_copybuffer.c @@ -97,7 +97,7 @@ bool BKE_copybuffer_read(Main *bmain_dst, const char *libname, ReportList *repor BKE_main_lib_objects_recalc_all(bmain_dst); IMB_colormanagement_check_file_config(bmain_dst); /* Append, rather than linking. */ - Library *lib = BLI_findstring(&bmain_dst->library, libname, offsetof(Library, filepath)); + Library *lib = BLI_findstring(&bmain_dst->libraries, libname, offsetof(Library, filepath)); BKE_library_make_local(bmain_dst, lib, NULL, true, false); /* Important we unset, otherwise these object wont * link into other scenes from this blend file. @@ -147,7 +147,7 @@ bool BKE_copybuffer_paste(bContext *C, const char *libname, const short flag, Re IMB_colormanagement_check_file_config(bmain); /* append, rather than linking */ - lib = BLI_findstring(&bmain->library, libname, offsetof(Library, filepath)); + lib = BLI_findstring(&bmain->libraries, libname, offsetof(Library, filepath)); BKE_library_make_local(bmain, lib, NULL, true, false); /* important we unset, otherwise these object wont diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index e93788f18f1..455f73c65c0 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -82,7 +82,7 @@ static void clean_paths(Main *main) BKE_bpath_traverse_main(main, clean_paths_visit_cb, BKE_BPATH_TRAVERSE_SKIP_MULTIFILE, NULL); - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = main->scenes.first; scene; scene = scene->id.next) { BLI_path_native_slash(scene->r.pic); } } @@ -127,7 +127,7 @@ static void setup_app_data( BKE_report(reports, RPT_WARNING, "Library file, loading empty scene"); mode = LOAD_UI_OFF; } - else if (BLI_listbase_is_empty(&bfd->main->screen)) { + else if (BLI_listbase_is_empty(&bfd->main->screens)) { mode = LOAD_UNDO; } else if ((G.fileflags & G_FILE_NO_UI) && (is_startup == false)) { @@ -170,8 +170,8 @@ static void setup_app_data( /* comes from readfile.c */ SWAP(ListBase, bmain->wm, bfd->main->wm); - SWAP(ListBase, bmain->workspace, bfd->main->workspace); - SWAP(ListBase, bmain->screen, bfd->main->screen); + SWAP(ListBase, bmain->workspaces, bfd->main->workspaces); + SWAP(ListBase, bmain->screens, bfd->main->screens); /* we re-use current window and screen */ win = CTX_wm_window(C); @@ -183,7 +183,7 @@ static void setup_app_data( track_undo_scene = (mode == LOAD_UNDO && curscreen && curscene && bfd->main->wm.first); if (curscene == NULL) { - curscene = bfd->main->scene.first; + curscene = bfd->main->scenes.first; } /* empty file, we add a scene to make Blender work */ if (curscene == NULL) { @@ -278,10 +278,10 @@ static void setup_app_data( wmWindow *win = CTX_wm_window(C); /* in case we don't even have a local scene, add one */ - if (!bmain->scene.first) + if (!bmain->scenes.first) BKE_scene_add(bmain, "Empty"); - CTX_data_scene_set(C, bmain->scene.first); + CTX_data_scene_set(C, bmain->scenes.first); win->scene = CTX_data_scene(C); curscene = CTX_data_scene(C); } @@ -441,8 +441,8 @@ bool BKE_blendfile_read_from_memfile( /* remove the unused screens and wm */ while (bfd->main->wm.first) BKE_id_free(bfd->main, bfd->main->wm.first); - while (bfd->main->screen.first) - BKE_id_free(bfd->main, bfd->main->screen.first); + while (bfd->main->screens.first) + BKE_id_free(bfd->main, bfd->main->screens.first); setup_app_data(C, bfd, "<memory1>", params->is_startup, reports); } @@ -573,7 +573,7 @@ WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepat if (bfd) { workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__); workspace_config->main = bfd->main; - workspace_config->workspaces = bfd->main->workspace; + workspace_config->workspaces = bfd->main->workspaces; MEM_freeN(bfd); } @@ -588,7 +588,7 @@ bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, Rep BKE_blendfile_write_partial_begin(bmain); - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { BKE_blendfile_write_partial_tag_ID(&workspace->id, true); } diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 346066b961a..58813c9878d 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -527,7 +527,7 @@ void BKE_brush_gpencil_presets(bContext *C) void BKE_brush_update_material(Main *bmain, Material *ma, Brush *exclude_brush) { - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if ((exclude_brush != NULL) && (brush == exclude_brush)) { continue; } @@ -547,7 +547,7 @@ struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mo { Brush *brush; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->ob_mode & ob_mode) return brush; } diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index 4741984b07c..b4f64087f8c 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -177,7 +177,7 @@ void BKE_cachefile_update_frame( CacheFile *cache_file; char filename[FILE_MAX]; - for (cache_file = bmain->cachefile.first; cache_file; cache_file = cache_file->id.next) { + for (cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) { /* TODO: dependency graph should be updated to do drivers on cachefile. * Execute drivers only, as animation has already been done. */ BKE_animsys_evaluate_animdata(depsgraph, scene, &cache_file->id, cache_file->adt, ctime, ADT_RECALC_DRIVERS); @@ -231,7 +231,7 @@ float BKE_cachefile_time_offset(CacheFile *cache_file, const float time, const f /* TODO(kevin): replace this with some depsgraph mechanism, or something similar. */ void BKE_cachefile_clean(struct Main *bmain, CacheFile *cache_file) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md = modifiers_findByType(ob, eModifierType_MeshSequenceCache); if (md) { diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index beefe4b5ac2..8a71c0c2e10 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -517,7 +517,7 @@ static bool collection_object_cyclic_check_internal(Object *object, Collection * bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection *collection) { /* first flag all collections */ - BKE_main_id_tag_listbase(&bmain->collection, LIB_TAG_DOIT, true); + BKE_main_id_tag_listbase(&bmain->collections, LIB_TAG_DOIT, true); return collection_object_cyclic_check_internal(object, collection); } @@ -548,7 +548,7 @@ Collection *BKE_collection_object_find(Main *bmain, Collection *collection, Obje if (collection) collection = collection->id.next; else - collection = bmain->collection.first; + collection = bmain->collections.first; while (collection) { if (BKE_collection_has_object(collection, ob)) @@ -737,11 +737,11 @@ static void collection_object_remove_nulls(Collection *collection) void BKE_collections_object_remove_nulls(Main *bmain) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { collection_object_remove_nulls(scene->master_collection); } - for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = bmain->collections.first; collection; collection = collection->id.next) { collection_object_remove_nulls(collection); } } @@ -785,17 +785,17 @@ void BKE_collections_child_remove_nulls(Main *bmain, Collection *collection) * otherwise we can miss some cases... * Also, master collections are not in bmain, so we also need to loop over scenes. */ - for (collection = bmain->collection.first; collection != NULL; collection = collection->id.next) { + for (collection = bmain->collections.first; collection != NULL; collection = collection->id.next) { collection_null_children_remove(collection); } - for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { collection_null_children_remove(BKE_collection_master(scene)); } - for (collection = bmain->collection.first; collection != NULL; collection = collection->id.next) { + for (collection = bmain->collections.first; collection != NULL; collection = collection->id.next) { collection_missing_parents_remove(collection); } - for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { collection_missing_parents_remove(BKE_collection_master(scene)); } } diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index a3d19c7fe11..9b184713f0e 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -297,7 +297,7 @@ VFont *BKE_vfont_load_exists_ex(struct Main *bmain, const char *filepath, bool * BLI_path_abs(str, BKE_main_blendfile_path(bmain)); /* first search an identical filepath */ - for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) { + for (vfont = bmain->fonts.first; vfont; vfont = vfont->id.next) { BLI_strncpy(strtest, vfont->name, sizeof(vfont->name)); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &vfont->id)); @@ -342,7 +342,7 @@ VFont *BKE_vfont_builtin_get(void) { VFont *vfont; - for (vfont = G_MAIN->vfont.first; vfont; vfont = vfont->id.next) { + for (vfont = G_MAIN->fonts.first; vfont; vfont = vfont->id.next) { if (BKE_vfont_is_builtin(vfont)) { return vfont; } diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 38513f8b427..177601c4746 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -556,7 +556,7 @@ Image *BKE_image_load_exists_ex(Main *bmain, const char *filepath, bool *r_exist BLI_path_abs(str, BKE_main_blendfile_path_from_global()); /* first search an identical filepath */ - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (ima->source != IMA_SRC_VIEWER && ima->source != IMA_SRC_GENERATED) { STRNCPY(strtest, ima->name); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &ima->id)); @@ -912,12 +912,12 @@ void BKE_image_print_memlist(Main *bmain) Image *ima; uintptr_t size, totsize = 0; - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) totsize += image_mem_size(ima); printf("\ntotal image memory len: %.3f MB\n", (double)totsize / (double)(1024 * 1024)); - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { size = image_mem_size(ima); if (size) @@ -940,14 +940,14 @@ void BKE_image_free_all_textures(Main *bmain) uintptr_t tot_freed_size = 0; #endif - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) ima->id.tag &= ~LIB_TAG_DOIT; - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->textures.first; tex; tex = tex->id.next) if (tex->ima) tex->ima->id.tag |= LIB_TAG_DOIT; - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (ima->cache && (ima->id.tag & LIB_TAG_DOIT)) { #ifdef CHECK_FREED_SIZE uintptr_t old_size = image_mem_size(ima); @@ -987,7 +987,7 @@ void BKE_image_all_free_anim_ibufs(Main *bmain, int cfra) { Image *ima; - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) if (BKE_image_is_animated(ima)) BKE_image_free_anim_ibufs(ima, cfra); } @@ -2570,7 +2570,7 @@ Image *BKE_image_verify_viewer(Main *bmain, int type, const char *name) { Image *ima; - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) if (ima->source == IMA_SRC_VIEWER) if (ima->type == type) break; @@ -2759,27 +2759,27 @@ void BKE_image_walk_id_all_users(ID *id, void *customdata, void BKE_image_walk_all_users(const Main *mainp, void *customdata, void callback(Image *ima, ImageUser *iuser, void *customdata)) { - for (Scene *scene = mainp->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = mainp->scenes.first; scene; scene = scene->id.next) { BKE_image_walk_id_all_users(&scene->id, customdata, callback); } - for (Object *ob = mainp->object.first; ob; ob = ob->id.next) { + for (Object *ob = mainp->objects.first; ob; ob = ob->id.next) { BKE_image_walk_id_all_users(&ob->id, customdata, callback); } - for (bNodeTree *ntree = mainp->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = mainp->nodetrees.first; ntree; ntree = ntree->id.next) { BKE_image_walk_id_all_users(&ntree->id, customdata, callback); } - for (Material *ma = mainp->mat.first; ma; ma = ma->id.next) { + for (Material *ma = mainp->materials.first; ma; ma = ma->id.next) { BKE_image_walk_id_all_users(&ma->id, customdata, callback); } - for (Tex *tex = mainp->tex.first; tex; tex = tex->id.next) { + for (Tex *tex = mainp->textures.first; tex; tex = tex->id.next) { BKE_image_walk_id_all_users(&tex->id, customdata, callback); } - for (Camera *cam = mainp->camera.first; cam; cam = cam->id.next) { + for (Camera *cam = mainp->cameras.first; cam; cam = cam->id.next) { BKE_image_walk_id_all_users(&cam->id, customdata, callback); } @@ -2949,7 +2949,7 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal) * this also makes sure all scenes are accounted for. */ { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->nodetree) { nodeUpdateID(scene->nodetree, &ima->id); } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index cccbb4aefe4..954026ea560 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1697,7 +1697,7 @@ void do_versions_ipos_to_animato(Main *bmain) /* ----------- Animation Attached to Data -------------- */ /* objects */ - for (id = bmain->object.first; id; id = id->next) { + for (id = bmain->objects.first; id; id = id->next) { Object *ob = (Object *)id; bPoseChannel *pchan; bConstraint *con; @@ -1824,7 +1824,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* shapekeys */ - for (id = bmain->key.first; id; id = id->next) { + for (id = bmain->shapekeys.first; id; id = id->next) { Key *key = (Key *)id; if (G.debug & G_DEBUG) printf("\tconverting key %s\n", id->name + 2); @@ -1849,7 +1849,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* materials */ - for (id = bmain->mat.first; id; id = id->next) { + for (id = bmain->materials.first; id; id = id->next) { Material *ma = (Material *)id; if (G.debug & G_DEBUG) printf("\tconverting material %s\n", id->name + 2); @@ -1871,7 +1871,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* worlds */ - for (id = bmain->world.first; id; id = id->next) { + for (id = bmain->worlds.first; id; id = id->next) { World *wo = (World *)id; if (G.debug & G_DEBUG) printf("\tconverting world %s\n", id->name + 2); @@ -1893,7 +1893,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* sequence strips */ - for (id = bmain->scene.first; id; id = id->next) { + for (id = bmain->scenes.first; id; id = id->next) { Scene *scene = (Scene *)id; Editing *ed = scene->ed; if (ed && ed->seqbasep) { @@ -1946,7 +1946,7 @@ void do_versions_ipos_to_animato(Main *bmain) /* textures */ - for (id = bmain->tex.first; id; id = id->next) { + for (id = bmain->textures.first; id; id = id->next) { Tex *te = (Tex *)id; if (G.debug & G_DEBUG) printf("\tconverting texture %s\n", id->name + 2); @@ -1968,7 +1968,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* cameras */ - for (id = bmain->camera.first; id; id = id->next) { + for (id = bmain->cameras.first; id; id = id->next) { Camera *ca = (Camera *)id; if (G.debug & G_DEBUG) printf("\tconverting camera %s\n", id->name + 2); @@ -1990,7 +1990,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* lights */ - for (id = bmain->light.first; id; id = id->next) { + for (id = bmain->lights.first; id; id = id->next) { Light *la = (Light *)id; if (G.debug & G_DEBUG) printf("\tconverting light %s\n", id->name + 2); @@ -2012,7 +2012,7 @@ void do_versions_ipos_to_animato(Main *bmain) } /* curves */ - for (id = bmain->curve.first; id; id = id->next) { + for (id = bmain->curves.first; id; id = id->next) { Curve *cu = (Curve *)id; if (G.debug & G_DEBUG) printf("\tconverting curve %s\n", id->name + 2); @@ -2045,7 +2045,7 @@ void do_versions_ipos_to_animato(Main *bmain) */ /* actions */ - for (id = bmain->action.first; id; id = id->next) { + for (id = bmain->actions.first; id; id = id->next) { bAction *act = (bAction *)id; if (G.debug & G_DEBUG) printf("\tconverting action %s\n", id->name + 2); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index ebea589d402..a5360f34312 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -822,7 +822,7 @@ void BKE_main_collection_sync(const Main *bmain) /* TODO: optimize for file load so only linked collections get checked? */ - for (const Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (const Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BKE_scene_collection_sync(scene); } } @@ -832,7 +832,7 @@ void BKE_main_collection_sync_remap(const Main *bmain) /* On remapping of object or collection pointers free caches. */ /* TODO: try to make this faster */ - for (const Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (const Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { for (ViewLayer *view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { MEM_SAFE_FREE(view_layer->object_bases_array); @@ -843,7 +843,7 @@ void BKE_main_collection_sync_remap(const Main *bmain) } } - for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = bmain->collections.first; collection; collection = collection->id.next) { BKE_collection_object_cache_free(collection); DEG_id_tag_update_ex((Main *)bmain, &collection->id, ID_RECALC_COPY_ON_WRITE); } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index af76425c3c7..2db67939d42 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1005,7 +1005,7 @@ void BKE_main_lib_objects_recalc_all(Main *bmain) Object *ob; /* flag for full recalc */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ID_IS_LINKED(ob)) { DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); } @@ -1308,7 +1308,7 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int fla /* Grrrrrrrrr... Not adding 'root' nodetrees to bmain.... grrrrrrrrrrrrrrrrrrrr! */ /* This is taken from original ntree copy code, might be weak actually? */ const bool use_nodetree_alloc_exception = ((GS(id->name) == ID_NT) && (bmain != NULL) && - (BLI_findindex(&bmain->nodetree, id) < 0)); + (BLI_findindex(&bmain->nodetrees, id) < 0)); BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || bmain != NULL); BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || (flag & LIB_ID_CREATE_NO_ALLOCATE) == 0); @@ -1970,14 +1970,14 @@ void BKE_library_make_local( * and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations. * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */ /* Also, use this object loop to we handle rigid body resetting. */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) { BKE_pose_rebuild(bmain, ob, ob->data, true); } /* If there was ever any rigidbody settings in the object, we reset it. */ if (ob->rigidbody_object) { - for (Scene *scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) { + for (Scene *scene_iter = bmain->scenes.first; scene_iter; scene_iter = scene_iter->id.next) { if (scene_iter->rigidbody_world) { BKE_rigidbody_remove_object(bmain, scene_iter, ob); } diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 077ce059edf..04ccdc729da 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -320,14 +320,14 @@ static void libblock_remap_data_postprocess_object_update(Main *bmain, Object *o BKE_main_collection_sync_remap(bmain); if (old_ob == NULL) { - for (Object *ob = bmain->object.first; ob != NULL; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob != NULL; ob = ob->id.next) { if (ob->type == OB_MBALL && BKE_mball_is_basis(ob)) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } } } else { - for (Object *ob = bmain->object.first; ob != NULL; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob != NULL; ob = ob->id.next) { if (ob->type == OB_MBALL && BKE_mball_is_basis_for(ob, old_ob)) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); break; /* There is only one basis... */ @@ -536,7 +536,7 @@ void BKE_libblock_remap_locked( case ID_CU: case ID_MB: if (new_id) { /* Only affects us in case obdata was relinked (changed). */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { libblock_remap_data_postprocess_obdata_relink(bmain, ob, new_id); } } diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index a6a302b58bd..1f65212135b 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -322,77 +322,77 @@ ListBase *which_libbase(Main *bmain, short type) { switch ((ID_Type)type) { case ID_SCE: - return &(bmain->scene); + return &(bmain->scenes); case ID_LI: - return &(bmain->library); + return &(bmain->libraries); case ID_OB: - return &(bmain->object); + return &(bmain->objects); case ID_ME: - return &(bmain->mesh); + return &(bmain->meshes); case ID_CU: - return &(bmain->curve); + return &(bmain->curves); case ID_MB: - return &(bmain->mball); + return &(bmain->metaballs); case ID_MA: - return &(bmain->mat); + return &(bmain->materials); case ID_TE: - return &(bmain->tex); + return &(bmain->textures); case ID_IM: - return &(bmain->image); + return &(bmain->images); case ID_LT: - return &(bmain->lattice); + return &(bmain->lattices); case ID_LA: - return &(bmain->light); + return &(bmain->lights); case ID_CA: - return &(bmain->camera); + return &(bmain->cameras); case ID_IP: return &(bmain->ipo); case ID_KE: - return &(bmain->key); + return &(bmain->shapekeys); case ID_WO: - return &(bmain->world); + return &(bmain->worlds); case ID_SCR: - return &(bmain->screen); + return &(bmain->screens); case ID_VF: - return &(bmain->vfont); + return &(bmain->fonts); case ID_TXT: - return &(bmain->text); + return &(bmain->texts); case ID_SPK: - return &(bmain->speaker); + return &(bmain->speakers); case ID_LP: - return &(bmain->lightprobe); + return &(bmain->lightprobes); case ID_SO: - return &(bmain->sound); + return &(bmain->sounds); case ID_GR: - return &(bmain->collection); + return &(bmain->collections); case ID_AR: - return &(bmain->armature); + return &(bmain->armatures); case ID_AC: - return &(bmain->action); + return &(bmain->actions); case ID_NT: - return &(bmain->nodetree); + return &(bmain->nodetrees); case ID_BR: - return &(bmain->brush); + return &(bmain->brushes); case ID_PA: - return &(bmain->particle); + return &(bmain->particles); case ID_WM: return &(bmain->wm); case ID_GD: - return &(bmain->gpencil); + return &(bmain->gpencils); case ID_MC: - return &(bmain->movieclip); + return &(bmain->movieclips); case ID_MSK: - return &(bmain->mask); + return &(bmain->masks); case ID_LS: - return &(bmain->linestyle); + return &(bmain->linestyles); case ID_PAL: - return &(bmain->palette); + return &(bmain->palettes); case ID_PC: - return &(bmain->paintcurve); + return &(bmain->paintcurves); case ID_CF: - return &(bmain->cachefile); + return &(bmain->cachefiles); case ID_WS: - return &(bmain->workspace); + return &(bmain->workspaces); } return NULL; } @@ -409,52 +409,52 @@ int set_listbasepointers(Main *bmain, ListBase **lb) /* BACKWARDS! also watch order of free-ing! (mesh<->mat), first items freed last. * This is important because freeing data decreases usercounts of other datablocks, * if this data is its self freed it can crash. */ - lb[INDEX_ID_LI] = &(bmain->library); /* Libraries may be accessed from pretty much any other ID... */ + lb[INDEX_ID_LI] = &(bmain->libraries); /* Libraries may be accessed from pretty much any other ID... */ lb[INDEX_ID_IP] = &(bmain->ipo); - lb[INDEX_ID_AC] = &(bmain->action); /* moved here to avoid problems when freeing with animato (aligorith) */ - lb[INDEX_ID_KE] = &(bmain->key); - lb[INDEX_ID_PAL] = &(bmain->palette); /* referenced by gpencil, so needs to be before that to avoid crashes */ - lb[INDEX_ID_GD] = &(bmain->gpencil); /* referenced by nodes, objects, view, scene etc, before to free after. */ - lb[INDEX_ID_NT] = &(bmain->nodetree); - lb[INDEX_ID_IM] = &(bmain->image); - lb[INDEX_ID_TE] = &(bmain->tex); - lb[INDEX_ID_MA] = &(bmain->mat); - lb[INDEX_ID_VF] = &(bmain->vfont); + lb[INDEX_ID_AC] = &(bmain->actions); /* moved here to avoid problems when freeing with animato (aligorith) */ + lb[INDEX_ID_KE] = &(bmain->shapekeys); + lb[INDEX_ID_PAL] = &(bmain->palettes); /* referenced by gpencil, so needs to be before that to avoid crashes */ + lb[INDEX_ID_GD] = &(bmain->gpencils); /* referenced by nodes, objects, view, scene etc, before to free after. */ + lb[INDEX_ID_NT] = &(bmain->nodetrees); + lb[INDEX_ID_IM] = &(bmain->images); + lb[INDEX_ID_TE] = &(bmain->textures); + lb[INDEX_ID_MA] = &(bmain->materials); + lb[INDEX_ID_VF] = &(bmain->fonts); /* Important!: When adding a new object type, * the specific data should be inserted here */ - lb[INDEX_ID_AR] = &(bmain->armature); - - lb[INDEX_ID_CF] = &(bmain->cachefile); - lb[INDEX_ID_ME] = &(bmain->mesh); - lb[INDEX_ID_CU] = &(bmain->curve); - lb[INDEX_ID_MB] = &(bmain->mball); - - lb[INDEX_ID_LT] = &(bmain->lattice); - lb[INDEX_ID_LA] = &(bmain->light); - lb[INDEX_ID_CA] = &(bmain->camera); - - lb[INDEX_ID_TXT] = &(bmain->text); - lb[INDEX_ID_SO] = &(bmain->sound); - lb[INDEX_ID_GR] = &(bmain->collection); - lb[INDEX_ID_PAL] = &(bmain->palette); - lb[INDEX_ID_PC] = &(bmain->paintcurve); - lb[INDEX_ID_BR] = &(bmain->brush); - lb[INDEX_ID_PA] = &(bmain->particle); - lb[INDEX_ID_SPK] = &(bmain->speaker); - lb[INDEX_ID_LP] = &(bmain->lightprobe); - - lb[INDEX_ID_WO] = &(bmain->world); - lb[INDEX_ID_MC] = &(bmain->movieclip); - lb[INDEX_ID_SCR] = &(bmain->screen); - lb[INDEX_ID_OB] = &(bmain->object); - lb[INDEX_ID_LS] = &(bmain->linestyle); /* referenced by scenes */ - lb[INDEX_ID_SCE] = &(bmain->scene); - lb[INDEX_ID_WS] = &(bmain->workspace); /* before wm, so it's freed after it! */ + lb[INDEX_ID_AR] = &(bmain->armatures); + + lb[INDEX_ID_CF] = &(bmain->cachefiles); + lb[INDEX_ID_ME] = &(bmain->meshes); + lb[INDEX_ID_CU] = &(bmain->curves); + lb[INDEX_ID_MB] = &(bmain->metaballs); + + lb[INDEX_ID_LT] = &(bmain->lattices); + lb[INDEX_ID_LA] = &(bmain->lights); + lb[INDEX_ID_CA] = &(bmain->cameras); + + lb[INDEX_ID_TXT] = &(bmain->texts); + lb[INDEX_ID_SO] = &(bmain->sounds); + lb[INDEX_ID_GR] = &(bmain->collections); + lb[INDEX_ID_PAL] = &(bmain->palettes); + lb[INDEX_ID_PC] = &(bmain->paintcurves); + lb[INDEX_ID_BR] = &(bmain->brushes); + lb[INDEX_ID_PA] = &(bmain->particles); + lb[INDEX_ID_SPK] = &(bmain->speakers); + lb[INDEX_ID_LP] = &(bmain->lightprobes); + + lb[INDEX_ID_WO] = &(bmain->worlds); + lb[INDEX_ID_MC] = &(bmain->movieclips); + lb[INDEX_ID_SCR] = &(bmain->screens); + lb[INDEX_ID_OB] = &(bmain->objects); + lb[INDEX_ID_LS] = &(bmain->linestyles); /* referenced by scenes */ + lb[INDEX_ID_SCE] = &(bmain->scenes); + lb[INDEX_ID_WS] = &(bmain->workspaces); /* before wm, so it's freed after it! */ lb[INDEX_ID_WM] = &(bmain->wm); - lb[INDEX_ID_MSK] = &(bmain->mask); + lb[INDEX_ID_MSK] = &(bmain->masks); lb[INDEX_ID_NULL] = NULL; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 02225705102..a67f533ded5 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -1423,7 +1423,7 @@ void BKE_mask_evaluate_all_masks(Main *bmain, float ctime, const bool do_newfram { Mask *mask; - for (mask = bmain->mask.first; mask; mask = mask->id.next) { + for (mask = bmain->masks.first; mask; mask = mask->id.next) { BKE_mask_evaluate(mask, ctime, do_newframe); } } diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 5bc65bcda48..d821052f2f4 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -645,7 +645,7 @@ void test_all_objects_materials(Main *bmain, ID *id) } BKE_main_lock(bmain); - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->data == id) { BKE_material_resize_object(bmain, ob, *totcol, false); } @@ -972,7 +972,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) actcol = ob->actcol; - for (Object *obt = bmain->object.first; obt; obt = obt->id.next) { + for (Object *obt = bmain->objects.first; obt; obt = obt->id.next) { if (obt->data == ob->data) { /* Can happen when object material lists are used, see: T52953 */ if (actcol > obt->totcol) { diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index ad60cb9c49d..83a20758ab3 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -619,7 +619,7 @@ void BKE_mesh_from_nurbs_displist( ob->type = OB_MESH; /* other users */ - ob1 = bmain->object.first; + ob1 = bmain->objects.first; while (ob1) { if (ob1->data == cu) { ob1->type = OB_MESH; diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 3475ed73fe4..bfa4c4ba068 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -765,7 +765,7 @@ MovieClip *BKE_movieclip_file_add_exists_ex(Main *bmain, const char *filepath, b BLI_path_abs(str, BKE_main_blendfile_path(bmain)); /* first search an identical filepath */ - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { BLI_strncpy(strtest, clip->name, sizeof(clip->name)); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &clip->id)); @@ -1370,7 +1370,7 @@ void BKE_movieclip_reload(Main *bmain, MovieClip *clip) */ { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->nodetree) { nodeUpdateID(scene->nodetree, &clip->id); } diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 4eb8fa26b1e..09b44db02e5 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3692,13 +3692,13 @@ void free_nodesystem(void) void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain) { - ntreeiter->ngroup = bmain->nodetree.first; - ntreeiter->scene = bmain->scene.first; - ntreeiter->mat = bmain->mat.first; - ntreeiter->tex = bmain->tex.first; - ntreeiter->light = bmain->light.first; - ntreeiter->world = bmain->world.first; - ntreeiter->linestyle = bmain->linestyle.first; + ntreeiter->ngroup = bmain->nodetrees.first; + ntreeiter->scene = bmain->scenes.first; + ntreeiter->mat = bmain->materials.first; + ntreeiter->tex = bmain->textures.first; + ntreeiter->light = bmain->lights.first; + ntreeiter->world = bmain->worlds.first; + ntreeiter->linestyle = bmain->linestyles.first; } bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter, bNodeTree **r_nodetree, struct ID **r_id) diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 1743060aa97..bdca469dc8e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -749,7 +749,7 @@ bool BKE_object_exists_check(Main *bmain, const Object *obtest) if (obtest == NULL) return false; - ob = bmain->object.first; + ob = bmain->objects.first; while (ob) { if (ob == obtest) return true; ob = ob->id.next; @@ -3772,7 +3772,7 @@ bool BKE_object_is_animated(Scene *scene, Object *ob) int BKE_object_scenes_users_get(Main *bmain, Object *ob) { int num_scenes = 0; - for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { if (BKE_collection_has_object_recursive(BKE_collection_master(scene), ob)) { num_scenes++; } diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 5bd91c2c4ac..1f3680eb850 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -233,7 +233,7 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild DupliContext pctx; copy_dupli_context(&pctx, ctx, ctx->object, NULL, _base_id); - /* mballs have a different dupli handling */ + /* metaballs have a different dupli handling */ if (ob->type != OB_MBALL) { ob->flag |= OB_DONE; /* doesn't render */ } @@ -251,7 +251,7 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild DupliContext pctx; copy_dupli_context(&pctx, ctx, ctx->object, NULL, baseid); - /* mballs have a different dupli handling */ + /* metaballs have a different dupli handling */ if (ob->type != OB_MBALL) ob->flag |= OB_DONE; /* doesn't render */ @@ -445,7 +445,7 @@ static Object *find_family_object(Main *bmain, const char *family, size_t family ch_utf8[ch_utf8_len] = '\0'; ch_utf8_len += 1; /* compare with null terminator */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (STREQLEN(ob->id.name + 2 + family_len, ch_utf8, ch_utf8_len)) { if (STREQLEN(ob->id.name + 2, family, family_len)) { break; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 340acc5a96e..a039e0544d5 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -118,15 +118,15 @@ int countPackedFiles(Main *bmain) int count = 0; /* let's check if there are packed files... */ - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) if (BKE_image_has_packedfile(ima)) count ++; - for (vf = bmain->vfont.first; vf; vf = vf->id.next) + for (vf = bmain->fonts.first; vf; vf = vf->id.next) if (vf->packedfile) count++; - for (sound = bmain->sound.first; sound; sound = sound->id.next) + for (sound = bmain->sounds.first; sound; sound = sound->id.next) if (sound->packedfile) count++; @@ -222,7 +222,7 @@ void packAll(Main *bmain, ReportList *reports, bool verbose) bSound *sound; int tot = 0; - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (BKE_image_has_packedfile(ima) == false && !ID_IS_LINKED(ima)) { if (ima->source == IMA_SRC_FILE) { BKE_image_packfiles(reports, ima, ID_BLEND_PATH(bmain, &ima->id)); @@ -235,14 +235,14 @@ void packAll(Main *bmain, ReportList *reports, bool verbose) } } - for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) { + for (vfont = bmain->fonts.first; vfont; vfont = vfont->id.next) { if (vfont->packedfile == NULL && !ID_IS_LINKED(vfont) && BKE_vfont_is_builtin(vfont) == false) { vfont->packedfile = newPackedFile(reports, vfont->name, BKE_main_blendfile_path(bmain)); tot ++; } } - for (sound = bmain->sound.first; sound; sound = sound->id.next) { + for (sound = bmain->sounds.first; sound; sound = sound->id.next) { if (sound->packedfile == NULL && !ID_IS_LINKED(sound)) { sound->packedfile = newPackedFile(reports, sound->name, BKE_main_blendfile_path(bmain)); tot++; @@ -598,7 +598,7 @@ int unpackLibraries(Main *bmain, ReportList *reports) char *newname; int ret_value = RET_ERROR; - for (lib = bmain->library.first; lib; lib = lib->id.next) { + for (lib = bmain->libraries.first; lib; lib = lib->id.next) { if (lib->packedfile && lib->name[0]) { newname = unpackFile(reports, BKE_main_blendfile_path(bmain), lib->filepath, lib->filepath, lib->packedfile, PF_WRITE_ORIGINAL); @@ -623,7 +623,7 @@ void packLibraries(Main *bmain, ReportList *reports) Library *lib; /* test for relativenss */ - for (lib = bmain->library.first; lib; lib = lib->id.next) + for (lib = bmain->libraries.first; lib; lib = lib->id.next) if (!BLI_path_is_rel(lib->name)) break; @@ -632,7 +632,7 @@ void packLibraries(Main *bmain, ReportList *reports) return; } - for (lib = bmain->library.first; lib; lib = lib->id.next) + for (lib = bmain->libraries.first; lib; lib = lib->id.next) if (lib->packedfile == NULL) lib->packedfile = newPackedFile(reports, lib->name, BKE_main_blendfile_path(bmain)); } @@ -643,15 +643,15 @@ void unpackAll(Main *bmain, ReportList *reports, int how) VFont *vf; bSound *sound; - for (ima = bmain->image.first; ima; ima = ima->id.next) + for (ima = bmain->images.first; ima; ima = ima->id.next) if (BKE_image_has_packedfile(ima)) unpackImage(bmain, reports, ima, how); - for (vf = bmain->vfont.first; vf; vf = vf->id.next) + for (vf = bmain->fonts.first; vf; vf = vf->id.next) if (vf->packedfile) unpackVFont(bmain, reports, vf, how); - for (sound = bmain->sound.first; sound; sound = sound->id.next) + for (sound = bmain->sounds.first; sound; sound = sound->id.next) if (sound->packedfile) unpackSound(bmain, reports, sound, how); } diff --git a/source/blender/blenkernel/intern/paint_toolslots.c b/source/blender/blenkernel/intern/paint_toolslots.c index 39c25f6d7d0..24b801ce67f 100644 --- a/source/blender/blenkernel/intern/paint_toolslots.c +++ b/source/blender/blenkernel/intern/paint_toolslots.c @@ -50,7 +50,7 @@ static void paint_toolslots_init(Main *bmain, Paint *paint) } const eObjectMode ob_mode = paint->runtime.ob_mode; BLI_assert(paint->runtime.tool_offset && ob_mode); - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->ob_mode & ob_mode) { const int slot_index = BKE_brush_tool_get(brush, paint); BKE_paint_toolslots_len_ensure(paint, slot_index + 1); @@ -64,7 +64,7 @@ static void paint_toolslots_init(Main *bmain, Paint *paint) void BKE_paint_toolslots_init_from_main(struct Main *bmain) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; paint_toolslots_init(bmain, &ts->imapaint.paint); paint_toolslots_init(bmain, &ts->sculpt->paint); diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 10529543595..745c17c0919 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -1175,7 +1175,7 @@ void BKE_rigidbody_constraints_collection_validate(Scene *scene, RigidBodyWorld void BKE_rigidbody_main_collection_object_add(Main *bmain, Collection *collection, Object *object) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { RigidBodyWorld *rbw = scene->rigidbody_world; if (rbw == NULL) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1ae0de69005..abe0393f582 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -998,7 +998,7 @@ void BKE_scene_set_background(Main *bmain, Scene *scene) BKE_scene_validate_setscene(bmain, scene); /* deselect objects (for dataselect) */ - for (ob = bmain->object.first; ob; ob = ob->id.next) + for (ob = bmain->objects.first; ob; ob = ob->id.next) ob->flag &= ~SELECT; /* copy layers and flags from bases to objects */ @@ -1097,7 +1097,7 @@ int BKE_scene_base_iter_next(Depsgraph *depsgraph, SceneBaseIter *iter, else { if (iter->phase != F_DUPLI) { if (depsgraph && (*base)->object->transflag & OB_DUPLI) { - /* collections cannot be duplicated for mballs yet, + /* collections cannot be duplicated for metaballs yet, * this enters eternal loop because of * makeDispListMBall getting called inside of collection_duplilist */ if ((*base)->object->instance_collection == NULL) { @@ -1155,7 +1155,7 @@ int BKE_scene_base_iter_next(Depsgraph *depsgraph, SceneBaseIter *iter, Scene *BKE_scene_find_from_collection(const Main *bmain, const Collection *collection) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { for (ViewLayer *layer = scene->view_layers.first; layer; layer = layer->next) { if (BKE_view_layer_has_collection(layer, collection)) { return scene; @@ -1291,7 +1291,7 @@ bool BKE_scene_validate_setscene(Main *bmain, Scene *sce) int a, totscene; if (sce->set == NULL) return true; - totscene = BLI_listbase_count(&bmain->scene); + totscene = BLI_listbase_count(&bmain->scenes); for (a = 0, sce_iter = sce; sce_iter->set; sce_iter = sce_iter->set, a++) { /* more iterations than scenes means we have a cycle */ @@ -1393,10 +1393,10 @@ int BKE_scene_orientation_slot_get_index(const TransformOrientationSlot *orient_ static void scene_armature_depsgraph_workaround(Main *bmain, Depsgraph *depsgraph) { Object *ob; - if (BLI_listbase_is_empty(&bmain->armature) || !DEG_id_type_updated(depsgraph, ID_OB)) { + if (BLI_listbase_is_empty(&bmain->armatures) || !DEG_id_type_updated(depsgraph, ID_OB)) { return; } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->type == OB_ARMATURE && ob->adt) { if (ob->pose == NULL || (ob->pose->flag & POSE_RECALC)) { BKE_pose_rebuild(bmain, ob, ob->data, true); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 56e34bbeb11..f9a1eed0ba7 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1070,7 +1070,7 @@ void BKE_sequencer_clear_scene_in_allseqs(Main *bmain, Scene *scene) Scene *scene_iter; /* when a scene is deleted: test all seqs */ - for (scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) { + for (scene_iter = bmain->scenes.first; scene_iter; scene_iter = scene_iter->id.next) { if (scene_iter != scene && scene_iter->ed) { BKE_sequencer_base_recursive_apply(&scene_iter->ed->seqbase, clear_scene_in_allseqs_cb, scene); } @@ -5716,7 +5716,7 @@ static void sequencer_all_free_anim_ibufs(ListBase *seqbase, int cfra) void BKE_sequencer_all_free_anim_ibufs(Main *bmain, int cfra) { BKE_sequencer_cache_cleanup(); - for (Scene *scene = bmain->scene.first; + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index f344a524dc5..c909f00702d 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -91,7 +91,7 @@ bSound *BKE_sound_new_file_exists_ex(struct Main *bmain, const char *filepath, b BLI_path_abs(str, BKE_main_blendfile_path(bmain)); /* first search an identical filepath */ - for (sound = bmain->sound.first; sound; sound = sound->id.next) { + for (sound = bmain->sounds.first; sound; sound = sound->id.next) { BLI_strncpy(strtest, sound->name, sizeof(sound->name)); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &sound->id)); @@ -192,7 +192,7 @@ static void sound_sync_callback(void *data, int mode, float time) struct Main *bmain = (struct Main *)data; struct Scene *scene; - scene = bmain->scene.first; + scene = bmain->scenes.first; while (scene) { if (scene->audio.flag & AUDIO_SYNC) { if (mode) @@ -606,7 +606,7 @@ void BKE_sound_update_sequencer(struct Main *main, bSound *sound) { struct Scene *scene; - for (scene = main->scene.first; scene; scene = scene->id.next) { + for (scene = main->scenes.first; scene; scene = scene->id.next) { BKE_sequencer_update_sound(scene, sound); } } @@ -686,7 +686,7 @@ void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene) } animation_playing = 0; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { if (screen->animtimer) { animation_playing = 1; break; @@ -883,8 +883,8 @@ void BKE_sound_update_scene(Main *bmain, Scene *scene) float quat[4]; /* cheap test to skip looping over all objects (no speakers is a common case) */ - if (!BLI_listbase_is_empty(&bmain->speaker)) { - BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, true); + if (!BLI_listbase_is_empty(&bmain->speakers)) { + BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, true); for (ViewLayer *view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { for (base = view_layer->object_bases.first; base; base = base->next) { diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index c0591680742..c2bded42bc1 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -123,7 +123,7 @@ static bool UNUSED_FUNCTION(workspaces_is_screen_used) #endif (const Main *bmain, bScreen *screen) { - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { if (workspace_layout_find_exec(workspace, screen)) { return true; } @@ -185,7 +185,7 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain) WorkSpaceInstanceHook *hook = MEM_callocN(sizeof(WorkSpaceInstanceHook), __func__); /* set an active screen-layout for each possible window/workspace combination */ - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { BKE_workspace_hook_layout_for_workspace_set(hook, workspace, workspace->layouts.first); } @@ -194,10 +194,10 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain) void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook *hook) { /* workspaces should never be freed before wm (during which we call this function) */ - BLI_assert(!BLI_listbase_is_empty(&bmain->workspace)); + BLI_assert(!BLI_listbase_is_empty(&bmain->workspaces)); /* Free relations for this hook */ - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { for (WorkSpaceDataRelation *relation = workspace->hook_layout_relations.first, *relation_next; relation; relation = relation_next) @@ -287,7 +287,7 @@ WorkSpaceLayout *BKE_workspace_layout_find_global( *r_workspace = NULL; } - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { if ((layout = workspace_layout_find_exec(workspace, screen))) { if (r_workspace) { *r_workspace = workspace; diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 9f9571d250c..7fcacd8f30e 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -439,7 +439,7 @@ BlendFileData *BLO_read_from_memfile( } /* In any case, we need to move all lib datablocks themselves - those are 'first level data', * getting rid of them would imply updating spaces & co to prevent invalid pointers access. */ - BLI_movelisttolist(&newmain->library, &oldmain->library); + BLI_movelisttolist(&newmain->libraries, &oldmain->libraries); blo_join_main(&new_mainlist); } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index de997e7002d..e5d4da8db10 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -547,15 +547,15 @@ void blo_split_main(ListBase *mainlist, Main *main) mainlist->first = mainlist->last = main; main->next = NULL; - if (BLI_listbase_is_empty(&main->library)) + if (BLI_listbase_is_empty(&main->libraries)) return; /* (Library.temp_index -> Main), lookup table */ - const uint lib_main_array_len = BLI_listbase_count(&main->library); + const uint lib_main_array_len = BLI_listbase_count(&main->libraries); Main **lib_main_array = MEM_malloc_arrayN(lib_main_array_len, sizeof(*lib_main_array), __func__); int i = 0; - for (Library *lib = main->library.first; lib; lib = lib->id.next, i++) { + for (Library *lib = main->libraries.first; lib; lib = lib->id.next, i++) { Main *libmain = BKE_main_new(); libmain->curlib = lib; libmain->versionfile = lib->versionfile; @@ -1792,7 +1792,7 @@ static void change_link_placeholder_to_real_ID_pointer(ListBase *mainlist, FileD */ void blo_clear_proxy_pointers_from_lib(Main *oldmain) { - Object *ob = oldmain->object.first; + Object *ob = oldmain->objects.first; for (; ob; ob = ob->id.next) { if (ob->id.lib != NULL && ob->proxy_from != NULL && ob->proxy_from->id.lib == NULL) { @@ -1803,7 +1803,7 @@ void blo_clear_proxy_pointers_from_lib(Main *oldmain) void blo_make_scene_pointer_map(FileData *fd, Main *oldmain) { - Scene *sce = oldmain->scene.first; + Scene *sce = oldmain->scenes.first; fd->scenemap = oldnewmap_new(); @@ -1818,7 +1818,7 @@ void blo_make_scene_pointer_map(FileData *fd, Main *oldmain) void blo_end_scene_pointer_map(FileData *fd, Main *oldmain) { OldNew *entry = fd->scenemap->entries; - Scene *sce = oldmain->scene.first; + Scene *sce = oldmain->scenes.first; int i; /* used entries were restored, so we put them to zero */ @@ -1834,8 +1834,8 @@ void blo_end_scene_pointer_map(FileData *fd, Main *oldmain) void blo_make_image_pointer_map(FileData *fd, Main *oldmain) { - Image *ima = oldmain->image.first; - Scene *sce = oldmain->scene.first; + Image *ima = oldmain->images.first; + Scene *sce = oldmain->scenes.first; int a; fd->imamap = oldnewmap_new(); @@ -1874,8 +1874,8 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) void blo_end_image_pointer_map(FileData *fd, Main *oldmain) { OldNew *entry = fd->imamap->entries; - Image *ima = oldmain->image.first; - Scene *sce = oldmain->scene.first; + Image *ima = oldmain->images.first; + Scene *sce = oldmain->scenes.first; int i; /* used entries were restored, so we put them to zero */ @@ -1925,8 +1925,8 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain) { - MovieClip *clip = oldmain->movieclip.first; - Scene *sce = oldmain->scene.first; + MovieClip *clip = oldmain->movieclips.first; + Scene *sce = oldmain->scenes.first; fd->movieclipmap = oldnewmap_new(); @@ -1953,8 +1953,8 @@ void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain) void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain) { OldNew *entry = fd->movieclipmap->entries; - MovieClip *clip = oldmain->movieclip.first; - Scene *sce = oldmain->scene.first; + MovieClip *clip = oldmain->movieclips.first; + Scene *sce = oldmain->scenes.first; int i; /* used entries were restored, so we put them to zero */ @@ -1980,7 +1980,7 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain) void blo_make_sound_pointer_map(FileData *fd, Main *oldmain) { - bSound *sound = oldmain->sound.first; + bSound *sound = oldmain->sounds.first; fd->soundmap = oldnewmap_new(); @@ -1995,7 +1995,7 @@ void blo_make_sound_pointer_map(FileData *fd, Main *oldmain) void blo_end_sound_pointer_map(FileData *fd, Main *oldmain) { OldNew *entry = fd->soundmap->entries; - bSound *sound = oldmain->sound.first; + bSound *sound = oldmain->sounds.first; int i; /* used entries were restored, so we put them to zero */ @@ -2026,7 +2026,7 @@ void blo_make_packed_pointer_map(FileData *fd, Main *oldmain) fd->packedmap = oldnewmap_new(); - for (ima = oldmain->image.first; ima; ima = ima->id.next) { + for (ima = oldmain->images.first; ima; ima = ima->id.next) { ImagePackedFile *imapf; if (ima->packedfile) @@ -2037,15 +2037,15 @@ void blo_make_packed_pointer_map(FileData *fd, Main *oldmain) insert_packedmap(fd, imapf->packedfile); } - for (vfont = oldmain->vfont.first; vfont; vfont = vfont->id.next) + for (vfont = oldmain->fonts.first; vfont; vfont = vfont->id.next) if (vfont->packedfile) insert_packedmap(fd, vfont->packedfile); - for (sound = oldmain->sound.first; sound; sound = sound->id.next) + for (sound = oldmain->sounds.first; sound; sound = sound->id.next) if (sound->packedfile) insert_packedmap(fd, sound->packedfile); - for (lib = oldmain->library.first; lib; lib = lib->id.next) + for (lib = oldmain->libraries.first; lib; lib = lib->id.next) if (lib->packedfile) insert_packedmap(fd, lib->packedfile); @@ -2068,7 +2068,7 @@ void blo_end_packed_pointer_map(FileData *fd, Main *oldmain) entry->newp = NULL; } - for (ima = oldmain->image.first; ima; ima = ima->id.next) { + for (ima = oldmain->images.first; ima; ima = ima->id.next) { ImagePackedFile *imapf; ima->packedfile = newpackedadr(fd, ima->packedfile); @@ -2077,13 +2077,13 @@ void blo_end_packed_pointer_map(FileData *fd, Main *oldmain) imapf->packedfile = newpackedadr(fd, imapf->packedfile); } - for (vfont = oldmain->vfont.first; vfont; vfont = vfont->id.next) + for (vfont = oldmain->fonts.first; vfont; vfont = vfont->id.next) vfont->packedfile = newpackedadr(fd, vfont->packedfile); - for (sound = oldmain->sound.first; sound; sound = sound->id.next) + for (sound = oldmain->sounds.first; sound; sound = sound->id.next) sound->packedfile = newpackedadr(fd, sound->packedfile); - for (lib = oldmain->library.first; lib; lib = lib->id.next) + for (lib = oldmain->libraries.first; lib; lib = lib->id.next) lib->packedfile = newpackedadr(fd, lib->packedfile); } @@ -2605,7 +2605,7 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap) static void lib_link_brush(FileData *fd, Main *main) { /* only link ID pointers */ - for (Brush *brush = main->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = main->brushes.first; brush; brush = brush->id.next) { if (brush->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(brush->id.properties, fd); @@ -2670,7 +2670,7 @@ static void direct_link_brush(FileData *fd, Brush *brush) static void lib_link_palette(FileData *fd, Main *main) { /* only link ID pointers */ - for (Palette *palette = main->palette.first; palette; palette = palette->id.next) { + for (Palette *palette = main->palettes.first; palette; palette = palette->id.next) { if (palette->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(palette->id.properties, fd); @@ -2689,7 +2689,7 @@ static void direct_link_palette(FileData *fd, Palette *palette) static void lib_link_paint_curve(FileData *fd, Main *main) { /* only link ID pointers */ - for (PaintCurve *pc = main->paintcurve.first; pc; pc = pc->id.next) { + for (PaintCurve *pc = main->paintcurves.first; pc; pc = pc->id.next) { if (pc->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(pc->id.properties, fd); @@ -2956,7 +2956,7 @@ static void direct_link_fcurves(FileData *fd, ListBase *list) static void lib_link_action(FileData *fd, Main *main) { - for (bAction *act = main->action.first; act; act = act->id.next) { + for (bAction *act = main->actions.first; act; act = act->id.next) { if (act->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(act->id.properties, fd); @@ -3168,7 +3168,7 @@ static void direct_link_animdata(FileData *fd, AnimData *adt) static void lib_link_cachefiles(FileData *fd, Main *bmain) { /* only link ID pointers */ - for (CacheFile *cache_file = bmain->cachefile.first; cache_file; cache_file = cache_file->id.next) { + for (CacheFile *cache_file = bmain->cachefiles.first; cache_file; cache_file = cache_file->id.next) { if (cache_file->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(cache_file->id.properties, fd); lib_link_animdata(fd, &cache_file->id, cache_file->adt); @@ -3197,7 +3197,7 @@ static void direct_link_cachefile(FileData *fd, CacheFile *cache_file) static void lib_link_workspaces(FileData *fd, Main *bmain) { - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { ListBase *layouts = BKE_workspace_layouts_get(workspace); ID *id = (ID *)workspace; @@ -3311,7 +3311,7 @@ static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree) static void lib_link_nodetree(FileData *fd, Main *main) { /* only link ID pointers */ - for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = main->nodetrees.first; ntree; ntree = ntree->id.next) { if (ntree->id.tag & LIB_TAG_NEED_LINK) { lib_link_ntree(fd, &ntree->id, ntree); @@ -3388,7 +3388,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) * we have set the NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2 flag, so at this point we can do the * actual group node updates. */ - for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = main->nodetrees.first; ntree; ntree = ntree->id.next) { if (ntree->flag & NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2) { has_old_groups = 1; } @@ -3408,7 +3408,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) } FOREACH_NODETREE_END; } - for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = main->nodetrees.first; ntree; ntree = ntree->id.next) { ntree->flag &= ~NTREE_DO_VERSIONS_GROUP_EXPOSE_2_56_2; } } @@ -3516,7 +3516,7 @@ static void lib_verify_nodetree(Main *main, int UNUSED(open)) } /* verify all group user nodes */ - for (bNodeTree *ntree = main->nodetree.first; ntree; ntree = ntree->id.next) { + for (bNodeTree *ntree = main->nodetrees.first; ntree; ntree = ntree->id.next) { ntreeVerifyNodes(main, &ntree->id); } @@ -3876,7 +3876,7 @@ static void lib_link_bones(FileData *fd, Bone *bone) static void lib_link_armature(FileData *fd, Main *main) { - for (bArmature *arm = main->armature.first; arm; arm = arm->id.next) { + for (bArmature *arm = main->armatures.first; arm; arm = arm->id.next) { if (arm->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(arm->id.properties, fd); lib_link_animdata(fd, &arm->id, arm->adt); @@ -3935,7 +3935,7 @@ static void direct_link_armature(FileData *fd, bArmature *arm) static void lib_link_camera(FileData *fd, Main *main) { - for (Camera *ca = main->camera.first; ca; ca = ca->id.next) { + for (Camera *ca = main->cameras.first; ca; ca = ca->id.next) { if (ca->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(ca->id.properties, fd); lib_link_animdata(fd, &ca->id, ca->adt); @@ -3975,7 +3975,7 @@ static void direct_link_camera(FileData *fd, Camera *ca) static void lib_link_light(FileData *fd, Main *main) { - for (Light *la = main->light.first; la; la = la->id.next) { + for (Light *la = main->lights.first; la; la = la->id.next) { if (la->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(la->id.properties, fd); lib_link_animdata(fd, &la->id, la->adt); @@ -4028,7 +4028,7 @@ void blo_do_versions_key_uidgen(Key *key) static void lib_link_key(FileData *fd, Main *main) { - for (Key *key = main->key.first; key; key = key->id.next) { + for (Key *key = main->shapekeys.first; key; key = key->id.next) { BLI_assert((key->id.tag & LIB_TAG_EXTERN) == 0); if (key->id.tag & LIB_TAG_NEED_LINK) { @@ -4099,7 +4099,7 @@ static void direct_link_key(FileData *fd, Key *key) static void lib_link_mball(FileData *fd, Main *main) { - for (MetaBall *mb = main->mball.first; mb; mb = mb->id.next) { + for (MetaBall *mb = main->metaballs.first; mb; mb = mb->id.next) { if (mb->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(mb->id.properties, fd); lib_link_animdata(fd, &mb->id, mb->adt); @@ -4140,7 +4140,7 @@ static void direct_link_mball(FileData *fd, MetaBall *mb) static void lib_link_world(FileData *fd, Main *main) { - for (World *wrld = main->world.first; wrld; wrld = wrld->id.next) { + for (World *wrld = main->worlds.first; wrld; wrld = wrld->id.next) { if (wrld->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(wrld->id.properties, fd); lib_link_animdata(fd, &wrld->id, wrld->adt); @@ -4183,7 +4183,7 @@ static void direct_link_world(FileData *fd, World *wrld) static void lib_link_vfont(FileData *fd, Main *main) { - for (VFont *vf = main->vfont.first; vf; vf = vf->id.next) { + for (VFont *vf = main->fonts.first; vf; vf = vf->id.next) { if (vf->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(vf->id.properties, fd); @@ -4207,7 +4207,7 @@ static void direct_link_vfont(FileData *fd, VFont *vf) static void lib_link_text(FileData *fd, Main *main) { - for (Text *text = main->text.first; text; text = text->id.next) { + for (Text *text = main->texts.first; text; text = text->id.next) { if (text->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(text->id.properties, fd); @@ -4259,7 +4259,7 @@ static void direct_link_text(FileData *fd, Text *text) static void lib_link_image(FileData *fd, Main *main) { - for (Image *ima = main->image.first; ima; ima = ima->id.next) { + for (Image *ima = main->images.first; ima; ima = ima->id.next) { if (ima->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(ima->id.properties, fd); @@ -4334,7 +4334,7 @@ static void direct_link_image(FileData *fd, Image *ima) static void lib_link_curve(FileData *fd, Main *main) { - for (Curve *cu = main->curve.first; cu; cu = cu->id.next) { + for (Curve *cu = main->curves.first; cu; cu = cu->id.next) { if (cu->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(cu->id.properties, fd); lib_link_animdata(fd, &cu->id, cu->adt); @@ -4434,7 +4434,7 @@ static void direct_link_curve(FileData *fd, Curve *cu) static void lib_link_texture(FileData *fd, Main *main) { - for (Tex *tex = main->tex.first; tex; tex = tex->id.next) { + for (Tex *tex = main->textures.first; tex; tex = tex->id.next) { if (tex->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(tex->id.properties, fd); lib_link_animdata(fd, &tex->id, tex->adt); @@ -4479,7 +4479,7 @@ static void direct_link_texture(FileData *fd, Tex *tex) static void lib_link_material(FileData *fd, Main *main) { - for (Material *ma = main->mat.first; ma; ma = ma->id.next) { + for (Material *ma = main->materials.first; ma; ma = ma->id.next) { if (ma->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(ma->id.properties, fd); lib_link_animdata(fd, &ma->id, ma->adt); @@ -4620,7 +4620,7 @@ static void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd) static void lib_link_particlesettings(FileData *fd, Main *main) { - for (ParticleSettings *part = main->particle.first; part; part = part->id.next) { + for (ParticleSettings *part = main->particles.first; part; part = part->id.next) { if (part->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(part->id.properties, fd); lib_link_animdata(fd, &part->id, part->adt); @@ -4875,7 +4875,7 @@ static void lib_link_mesh(FileData *fd, Main *main) { Mesh *me; - for (me = main->mesh.first; me; me = me->id.next) { + for (me = main->meshes.first; me; me = me->id.next) { if (me->id.tag & LIB_TAG_NEED_LINK) { int i; @@ -4900,7 +4900,7 @@ static void lib_link_mesh(FileData *fd, Main *main) } } - for (me = main->mesh.first; me; me = me->id.next) { + for (me = main->meshes.first; me; me = me->id.next) { if (me->id.tag & LIB_TAG_NEED_LINK) { /*check if we need to convert mfaces to mpolys*/ if (me->totface && !me->totpoly) { @@ -5142,7 +5142,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) static void lib_link_latt(FileData *fd, Main *main) { - for (Lattice *lt = main->lattice.first; lt; lt = lt->id.next) { + for (Lattice *lt = main->lattices.first; lt; lt = lt->id.next) { if (lt->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(lt->id.properties, fd); lib_link_animdata(fd, <->id, lt->adt); @@ -5227,7 +5227,7 @@ static void lib_link_object(FileData *fd, Main *main) { bool warn = false; - for (Object *ob = main->object.first; ob; ob = ob->id.next) { + for (Object *ob = main->objects.first; ob; ob = ob->id.next) { if (ob->id.tag & LIB_TAG_NEED_LINK) { int a; @@ -6237,7 +6237,7 @@ static void lib_link_collection_data(FileData *fd, Library *lib, Collection *col static void lib_link_collection(FileData *fd, Main *main) { - for (Collection *collection = main->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = main->collections.first; collection; collection = collection->id.next) { if (collection->id.tag & LIB_TAG_NEED_LINK) { collection->id.tag &= ~LIB_TAG_NEED_LINK; IDP_LibLinkProperty(collection->id.properties, fd); @@ -6372,7 +6372,7 @@ static void lib_link_scene(FileData *fd, Main *main) int totscene = 0; #endif - for (Scene *sce = main->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = main->scenes.first; sce; sce = sce->id.next) { if (sce->id.tag & LIB_TAG_NEED_LINK) { /* Link ID Properties -- and copy this comment EXACTLY for easy finding * of library blocks that implement this.*/ @@ -6552,7 +6552,7 @@ static void lib_link_scene(FileData *fd, Main *main) #ifdef USE_SETSCENE_CHECK if (need_check_set) { - for (Scene *sce = main->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = main->scenes.first; sce; sce = sce->id.next) { if (sce->id.tag & LIB_TAG_NEED_LINK) { sce->id.tag &= ~LIB_TAG_NEED_LINK; if (!scene_validate_setscene__liblink(sce, totscene)) { @@ -6937,7 +6937,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) static void lib_link_gpencil(FileData *fd, Main *main) { /* Relink all datablock linked by GP datablock */ - for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = main->gpencils.first; gpd; gpd = gpd->id.next) { if (gpd->id.tag & LIB_TAG_NEED_LINK) { /* Layers */ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { @@ -7678,7 +7678,7 @@ static void lib_link_windowmanager(FileData *fd, Main *main) * check lib pointers in call below */ static void lib_link_screen(FileData *fd, Main *main) { - for (bScreen *sc = main->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = main->screens.first; sc; sc = sc->id.next) { if (sc->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(sc->id.properties, fd); @@ -7963,7 +7963,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main SpaceText *st = (SpaceText *)sl; st->text = restore_pointer_by_name(id_map, (ID *)st->text, USER_REAL); - if (st->text == NULL) st->text = newmain->text.first; + if (st->text == NULL) st->text = newmain->texts.first; } else if (sl->spacetype == SPACE_SCRIPT) { SpaceScript *scpt = (SpaceScript *)sl; @@ -8062,7 +8062,7 @@ void blo_lib_link_restore(Main *oldmain, Main *newmain, wmWindowManager *curwm, { struct IDNameLib_Map *id_map = BKE_main_idmap_create(newmain, true, oldmain); - for (WorkSpace *workspace = newmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = newmain->workspaces.first; workspace; workspace = workspace->id.next) { ListBase *layouts = BKE_workspace_layouts_get(workspace); for (WorkSpaceLayout *layout = layouts->first; layout; layout = layout->next) { @@ -8164,7 +8164,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) change_link_placeholder_to_real_ID_pointer(fd->mainlist, fd, lib, newmain->curlib); /* change_link_placeholder_to_real_ID_pointer_fd(fd, lib, newmain->curlib); */ - BLI_remlink(&main->library, lib); + BLI_remlink(&main->libraries, lib); MEM_freeN(lib); /* Now, since Blender always expect **latest** Main pointer from fd->mainlist to be the active library @@ -8200,7 +8200,7 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main) static void lib_link_library(FileData *UNUSED(fd), Main *main) { Library *lib; - for (lib = main->library.first; lib; lib = lib->id.next) { + for (lib = main->libraries.first; lib; lib = lib->id.next) { id_us_ensure_real(&lib->id); } } @@ -8211,7 +8211,7 @@ static void fix_relpaths_library(const char *basepath, Main *main) Library *lib; /* BLO_read_from_memory uses a blank filename */ if (basepath == NULL || basepath[0] == '\0') { - for (lib = main->library.first; lib; lib = lib->id.next) { + for (lib = main->libraries.first; lib; lib = lib->id.next) { /* when loading a linked lib into a file which has not been saved, * there is nothing we can be relative to, so instead we need to make * it absolute. This can happen when appending an object with a relative @@ -8223,7 +8223,7 @@ static void fix_relpaths_library(const char *basepath, Main *main) } } else { - for (lib = main->library.first; lib; lib = lib->id.next) { + for (lib = main->libraries.first; lib; lib = lib->id.next) { /* Libraries store both relative and abs paths, recreate relative paths, * relative to the blend file since indirectly linked libs will be relative to their direct linked library */ if (BLI_path_is_rel(lib->name)) { /* if this is relative to begin with? */ @@ -8242,7 +8242,7 @@ static void fix_relpaths_library(const char *basepath, Main *main) static void lib_link_lightprobe(FileData *fd, Main *main) { - for (LightProbe *prb = main->lightprobe.first; prb; prb = prb->id.next) { + for (LightProbe *prb = main->lightprobes.first; prb; prb = prb->id.next) { if (prb->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(prb->id.properties, fd); lib_link_animdata(fd, &prb->id, prb->adt); @@ -8268,7 +8268,7 @@ static void direct_link_lightprobe(FileData *fd, LightProbe *prb) static void lib_link_speaker(FileData *fd, Main *main) { - for (Speaker *spk = main->speaker.first; spk; spk = spk->id.next) { + for (Speaker *spk = main->speakers.first; spk; spk = spk->id.next) { if (spk->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(spk->id.properties, fd); lib_link_animdata(fd, &spk->id, spk->adt); @@ -8330,7 +8330,7 @@ static void direct_link_sound(FileData *fd, bSound *sound) static void lib_link_sound(FileData *fd, Main *main) { - for (bSound *sound = main->sound.first; sound; sound = sound->id.next) { + for (bSound *sound = main->sounds.first; sound; sound = sound->id.next) { if (sound->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(sound->id.properties, fd); @@ -8447,7 +8447,7 @@ static void lib_link_moviePlaneTracks(FileData *fd, MovieClip *clip, ListBase *t static void lib_link_movieclip(FileData *fd, Main *main) { - for (MovieClip *clip = main->movieclip.first; clip; clip = clip->id.next) { + for (MovieClip *clip = main->movieclips.first; clip; clip = clip->id.next) { if (clip->id.tag & LIB_TAG_NEED_LINK) { MovieTracking *tracking = &clip->tracking; @@ -8541,7 +8541,7 @@ static void lib_link_mask_parent(FileData *fd, Mask *mask, MaskParent *parent) static void lib_link_mask(FileData *fd, Main *main) { - for (Mask *mask = main->mask.first; mask; mask = mask->id.next) { + for (Mask *mask = main->masks.first; mask; mask = mask->id.next) { if (mask->id.tag & LIB_TAG_NEED_LINK) { IDP_LibLinkProperty(mask->id.properties, fd); lib_link_animdata(fd, &mask->id, mask->adt); @@ -8580,7 +8580,7 @@ static void lib_link_mask(FileData *fd, Main *main) static void lib_link_linestyle(FileData *fd, Main *main) { - for (FreestyleLineStyle *linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) { + for (FreestyleLineStyle *linestyle = main->linestyles.first; linestyle; linestyle = linestyle->id.next) { if (linestyle->id.tag & LIB_TAG_NEED_LINK) { LineStyleModifier *m; @@ -8949,9 +8949,9 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const int ta * a missing ID_LINK_PLACEHOLDER, we need to get the correct lib it is linked to! * Order is crucial, we cannot bulk-add it in BLO_read_from_memfile() like it used to be... */ BLI_remlink(fd->old_mainlist, libmain); - BLI_remlink_safe(&oldmain->library, libmain->curlib); + BLI_remlink_safe(&oldmain->libraries, libmain->curlib); BLI_addtail(fd->mainlist, libmain); - BLI_addtail(&main->library, libmain->curlib); + BLI_addtail(&main->libraries, libmain->curlib); if (r_id) { *r_id = NULL; /* Just in case... */ @@ -10787,7 +10787,7 @@ static bool object_in_any_scene(Main *bmain, Object *ob) { Scene *sce; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (BKE_scene_object_find(sce, ob)) { return true; } @@ -10806,7 +10806,7 @@ static void add_loose_objects_to_scene( BLI_assert(scene); /* Give all objects which are LIB_TAG_INDIRECT a base, or for a collection when *lib has been set. */ - for (Object *ob = mainvar->object.first; ob; ob = ob->id.next) { + for (Object *ob = mainvar->objects.first; ob; ob = ob->id.next) { bool do_it = (ob->id.tag & LIB_TAG_DOIT) != 0; if (do_it || ((ob->id.tag & LIB_TAG_INDIRECT) && (ob->id.tag & LIB_TAG_PRE_EXISTING) == 0)) { if (!is_link) { @@ -10870,7 +10870,7 @@ static void add_collections_to_scene( } /* Give all objects which are tagged a base. */ - for (Collection *collection = mainvar->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = mainvar->collections.first; collection; collection = collection->id.next) { if ((flag & FILE_GROUP_INSTANCE) && (collection->id.tag & LIB_TAG_DOIT)) { /* Any indirect collection should not have been tagged. */ BLI_assert((collection->id.tag & LIB_TAG_INDIRECT) == 0); @@ -11100,7 +11100,7 @@ static Main *library_link_begin(Main *mainvar, FileData **fd, const char *filepa (*fd)->mainlist = MEM_callocN(sizeof(ListBase), "FileData.mainlist"); /* clear for collection instantiating tag */ - BKE_main_id_tag_listbase(&(mainvar->collection), LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&(mainvar->collections), LIB_TAG_DOIT, false); /* make mains */ blo_split_main((*fd)->mainlist, mainvar); @@ -11227,8 +11227,8 @@ static void library_link_end( } /* Clear objects and collections instantiating tag. */ - BKE_main_id_tag_listbase(&(mainvar->object), LIB_TAG_DOIT, false); - BKE_main_id_tag_listbase(&(mainvar->collection), LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&(mainvar->objects), LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&(mainvar->collections), LIB_TAG_DOIT, false); /* patch to prevent switch_endian happens twice */ if ((*fd)->flags & FD_FLAGS_SWITCH_ENDIAN) { diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index 5d7f37db0d1..d8bd0e8d5b9 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -459,21 +459,21 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; if (v3d->gpd) { - versions_gpencil_add_main(&main->gpencil, (ID *)v3d->gpd, "GPencil View3D"); + versions_gpencil_add_main(&main->gpencils, (ID *)v3d->gpd, "GPencil View3D"); v3d->gpd = NULL; } } else if (sl->spacetype == SPACE_NODE) { SpaceNode *snode = (SpaceNode *)sl; if (snode->gpd) { - versions_gpencil_add_main(&main->gpencil, (ID *)snode->gpd, "GPencil Node"); + versions_gpencil_add_main(&main->gpencils, (ID *)snode->gpd, "GPencil Node"); snode->gpd = NULL; } } else if (sl->spacetype == SPACE_SEQ) { SpaceSeq *sseq = (SpaceSeq *)sl; if (sseq->gpd) { - versions_gpencil_add_main(&main->gpencil, (ID *)sseq->gpd, "GPencil Node"); + versions_gpencil_add_main(&main->gpencils, (ID *)sseq->gpd, "GPencil Node"); sseq->gpd = NULL; } } @@ -498,7 +498,7 @@ static void do_version_mdef_250(Main *main) ModifierData *md; MeshDeformModifierData *mmd; - for (ob = main->object.first; ob; ob = ob->id.next) { + for (ob = main->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_MeshDeform) { mmd = (MeshDeformModifierData *)md; @@ -641,14 +641,14 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) bSound *sound; Sequence *seq; - for (sound = bmain->sound.first; sound; sound = sound->id.next) { + for (sound = bmain->sounds.first; sound; sound = sound->id.next) { if (sound->newpackedfile) { sound->packedfile = sound->newpackedfile; sound->newpackedfile = NULL; } } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->ed && scene->ed->seqbasep) { SEQ_BEGIN(scene->ed, seq) { @@ -672,7 +672,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { do_versions_windowmanager_2_50(screen); do_versions_gpencil_2_50(bmain, screen); } @@ -680,13 +680,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* shader, composite and texture node trees have id.name empty, put something in * to have them show in RNA viewer and accessible otherwise. */ - for (ma = bmain->mat.first; ma; ma = ma->id.next) { + for (ma = bmain->materials.first; ma; ma = ma->id.next) { if (ma->nodetree && ma->nodetree->id.name[0] == '\0') strcpy(ma->nodetree->id.name, "NTShader Nodetree"); } /* and composite trees */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { enum { R_PANORAMA = (1 << 10) }; if (sce->nodetree && sce->nodetree->id.name[0] == '\0') strcpy(sce->nodetree->id.name, "NTCompositing Nodetree"); @@ -707,7 +707,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* and texture trees */ - for (tx = bmain->tex.first; tx; tx = tx->id.next) { + for (tx = bmain->textures.first; tx; tx = tx->id.next) { bNode *node; if (tx->nodetree) { @@ -722,7 +722,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* particle draw and render types */ - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (part->draw_as) { if (part->draw_as == PART_DRAW_DOT) { part->ren_as = PART_DRAW_HALO; @@ -741,7 +741,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* set old pointcaches to have disk cache flag */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { //BKE_ptcache_ids_from_object(&pidlist, ob); @@ -752,7 +752,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* type was a mixed flag & enum. move the 2d flag elsewhere */ - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { Nurb *nu; for (nu = cu->nurb.first; nu; nu = nu->next) { @@ -770,7 +770,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) //PTCacheID *pid; //ListBase pidlist; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { //BKE_ptcache_ids_from_object(&pidlist, ob); //for (pid = pidlist.first; pid; pid = pid->next) { @@ -804,12 +804,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* texture filter */ - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->afmax == 0) tex->afmax = 8; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { ts = sce->toolsettings; if (!ts->uv_selectmode || ts->vgroup_weight == 0.0f) { ts->selectmode = SCE_SELECT_VERTEX; @@ -830,7 +830,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 2)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->flag & 8192) // OB_POSEMODE = 8192 ob->mode |= OB_MODE_POSE; } @@ -842,11 +842,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ParticleSettings *part; bool do_gravity = false; - for (sce = bmain->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scenes.first; sce; sce = sce->id.next) if (sce->unit.scale_length == 0.0f) sce->unit.scale_length = 1.0f; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* fluid-sim stuff */ FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); if (fluidmd) @@ -856,7 +856,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ob->rotmode = ROT_MODE_EUL; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->audio.main == 0.0f) sce->audio.main = 1.0f; @@ -868,7 +868,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* Add default gravity to scenes */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if ((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0 && is_zero_v3(sce->physics_settings.gravity)) { @@ -881,11 +881,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */ if (do_gravity) { - for (part = bmain->particle.first; part; part = part->id.next) + for (part = bmain->particles.first; part; part = part->id.next) part->effector_weights->global_gravity = part->acc[2] / -9.81f; } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; if (do_gravity) { @@ -918,7 +918,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Object *ob; /* New variables for axis-angle rotations and/or quaternion rotations were added, and need proper initialization */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* new variables for all objects */ ob->quat[0] = 1.0f; ob->rotAxis[1] = 1.0f; @@ -947,7 +947,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* shape keys are no longer applied to the mesh itself, but rather * to the derivedmesh/displist, so here we ensure that the basis * shape key is always set in the mesh coordinates. */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, me->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(me->totvert, key->refkey->totelem); @@ -957,7 +957,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - for (lt = bmain->lattice.first; lt; lt = lt->id.next) { + for (lt = bmain->lattices.first; lt; lt = lt->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, lt->key)) && key->refkey) { data = key->refkey->data; tot = MIN2(lt->pntsu * lt->pntsv * lt->pntsw, key->refkey->totelem); @@ -967,7 +967,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, cu->key)) && key->refkey) { data = key->refkey->data; @@ -997,7 +997,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 250 || (bmain->versionfile == 250 && bmain->subversionfile < 8)) { { - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; while (sce) { if (sce->r.frame_step == 0) sce->r.frame_step = 1; @@ -1008,7 +1008,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { /* ensure all nodes have unique names */ - bNodeTree *ntree = bmain->nodetree.first; + bNodeTree *ntree = bmain->nodetrees.first; while (ntree) { bNode *node = ntree->nodes.first; @@ -1022,7 +1022,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } { - Object *ob = bmain->object.first; + Object *ob = bmain->objects.first; while (ob) { /* shaded mode disabled for now */ if (ob->dt == OB_MATERIAL) @@ -1036,7 +1036,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ScrArea *sa; SpaceLink *sl; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1051,9 +1051,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* only convert old 2.50 files with color management */ if (bmain->versionfile == 250) { - Scene *sce = bmain->scene.first; - Material *ma = bmain->mat.first; - Tex *tex = bmain->tex.first; + Scene *sce = bmain->scenes.first; + Material *ma = bmain->materials.first; + Tex *tex = bmain->textures.first; int i, convert = 0; /* convert to new color management system: @@ -1094,15 +1094,15 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Mesh *me; Object *ob; - for (sce = bmain->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scenes.first; sce; sce = sce->id.next) if (!sce->toolsettings->particle.selectmode) sce->toolsettings->particle.selectmode = SCE_SELECT_PATH; if (bmain->versionfile == 250 && bmain->subversionfile > 1) { - for (me = bmain->mesh.first; me; me = me->id.next) + for (me = bmain->meshes.first; me; me = me->id.next) multires_load_old_250(me); - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { MultiresModifierData *mmd = (MultiresModifierData *)modifiers_findByType(ob, eModifierType_Multires); if (mmd) { @@ -1119,7 +1119,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Object *ob; /* properly initialize hair clothsim data on old files */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { @@ -1139,7 +1139,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl; /* remove all preview window in wrong spaces */ - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype != SPACE_SEQ) { @@ -1176,7 +1176,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ScrArea *sa; SpaceLink *sl; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -1217,7 +1217,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Brush *brush; /* anim viz changes */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* initialize object defaults */ animviz_settings_init(&ob->avs); @@ -1262,7 +1262,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* brush texture changes */ - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { BKE_texture_mtex_default(&brush->mtex); BKE_texture_mtex_default(&brush->mask_mtex); } @@ -1274,7 +1274,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Object *ob; /* convert degrees to radians for internal use */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { bPoseChannel *pchan; do_version_constraints_radians_degrees_250(&ob->constraints); @@ -1300,7 +1300,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ScrArea *sa; SpaceLink *sl; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase; @@ -1329,7 +1329,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Sequence *seq; /* initialize to sane default so toggling on border shows something */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && sce->r.border.xmax == 0.0f && sce->r.border.ymax == 0.0f) { @@ -1349,7 +1349,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* particle brush strength factor was changed from int to float */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { ParticleEditSettings *pset = &sce->toolsettings->particle; int a; @@ -1363,7 +1363,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ScrArea *sa; SpaceLink *sl; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -1399,7 +1399,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) * This bit was used in the past for V3D_TRANSFORM_SNAP, which is now deprecated. * Here we clear it for old files so they don't come in with V3D_HIDE_OVERLAYS set, * which would cause cameras, lights, etc to become invisible */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1419,13 +1419,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Scene *scene; bNodeTree *ntree; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->curve) brush->curve->preset = CURVE_PRESET_SMOOTH; } /* properly initialize active flag for fluidsim modifiers */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Fluidsim) { @@ -1437,7 +1437,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* adjustment to color balance node values */ - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->nodetree) { bNode *node = scene->nodetree->nodes.first; @@ -1453,7 +1453,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } /* check inside node groups too */ - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) { bNode *node = ntree->nodes.first; while (node) { @@ -1473,7 +1473,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 252 || (bmain->versionfile == 252 && bmain->subversionfile < 2)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) + for (ob = bmain->objects.first; ob; ob = ob->id.next) blo_do_version_old_trackto_to_constraints(ob); } @@ -1481,7 +1481,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) bScreen *sc; /* Image editor scopes */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -1504,7 +1504,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Tex *tex; Brush *brush; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1541,7 +1541,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) do_version_mdef_250(bmain); /* parent type to modifier */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->parent) { Object *parent = (Object *)blo_do_versions_newlibadr(fd, lib, ob->parent); if (parent) { /* parent may not be in group */ @@ -1577,7 +1577,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* initialize scene active layer */ - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { int i; for (i = 0; i < 20; i++) { if (scene->lay & (1 << i)) { @@ -1587,7 +1587,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { /* if youre picky, this isn't correct until we do a version bump * since you could set saturation to be 0.0*/ if (tex->saturation == 0.0f) @@ -1596,12 +1596,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { Curve *cu; - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { cu->smallcaps_scale = 0.75f; } } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene) { Sequence *seq; SEQ_BEGIN(scene->ed, seq) @@ -1615,7 +1615,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* GSOC 2010 Sculpt - New settings for Brush */ - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { /* Sanity Check */ /* infinite number of dabs */ @@ -1691,7 +1691,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* GSOC Sculpt 2010 - Sanity check on Sculpt/Paint settings */ if (bmain->versionfile < 253) { Scene *sce; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->toolsettings->sculpt_paint_unified_alpha == 0) sce->toolsettings->sculpt_paint_unified_alpha = 0.5f; @@ -1706,7 +1706,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 253 || (bmain->versionfile == 253 && bmain->subversionfile < 1)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -1726,7 +1726,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* for now just add it to all flow objects in the scene */ { Object *ob2; - for (ob2 = bmain->object.first; ob2; ob2 = ob2->id.next) { + for (ob2 = bmain->objects.first; ob2; ob2 = ob2->id.next) { ModifierData *md2; for (md2 = ob2->modifiers.first; md2; md2 = md2->next) { if (md2->type == eModifierType_Smoke) { @@ -1754,12 +1754,12 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ParticleSettings *part; bScreen *sc; - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { if (br->ob_mode == 0) br->ob_mode = OB_MODE_ALL_PAINT; } - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (part->boids) part->boids->pitch = 1.0f; @@ -1767,7 +1767,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) part->kink_amp_clump = 1.f; /* keep old files looking similar */ } - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1798,7 +1798,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Object *ob; /* ocean res is now squared, reset old ones - will be massive */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Ocean) { @@ -1816,7 +1816,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Key *key; /* Fix for sample line scope initializing with no height */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { sa = sc->areabase.first; while (sa) { SpaceLink *sl; @@ -1835,7 +1835,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) * 2.4x would never reveal this to users as a dummy value always ended up getting used * instead */ - for (key = bmain->key.first; key; key = key->id.next) { + for (key = bmain->shapekeys.first; key; key = key->id.next) { KeyBlock *kb; for (kb = key->block.first; kb; kb = kb->next) { @@ -1851,13 +1851,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Bone *bone; Object *ob; - for (arm = bmain->armature.first; arm; arm = arm->id.next) + for (arm = bmain->armatures.first; arm; arm = arm->id.next) for (bone = arm->bonebase.first; bone; bone = bone->next) do_version_bone_roll_256(bone); /* fix for objects which have zero dquat's * since this is multiplied with the quat rather than added */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (is_zero_v4(ob->dquat)) { unit_qt(ob->dquat); } @@ -1876,7 +1876,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* node sockets are not exposed automatically any more, * this mimics the old behavior by adding all unlinked sockets to groups. */ - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) { /* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */ /* first make sure the own_index for new sockets is valid */ @@ -1952,7 +1952,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ParticleSettings *part; /* redraws flag in SpaceTime has been moved to Screen level */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { if (sc->redraws_flag == 0) { /* just initialize to default? */ /* XXX: we could also have iterated through areas, and taken them from the first timeline available... */ @@ -1960,13 +1960,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->height == 0) brush->height = 0.4f; } /* replace 'rim material' option for in offset*/ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Solidify) { @@ -1980,7 +1980,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* particle draw color from material */ - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (part->draw & PART_DRAW_MAT_COL) part->draw_col = PART_DRAW_COL_MAT; } @@ -1989,7 +1989,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 256 || (bmain->versionfile == 256 && bmain->subversionfile < 6)) { Mesh *me; - for (me = bmain->mesh.first; me; me = me->id.next) + for (me = bmain->meshes.first; me; me = me->id.next) BKE_mesh_calc_normals_tessface(me->mvert, me->totvert, me->mface, me->totface, NULL); } @@ -1997,7 +1997,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* update blur area sizes from 0..1 range to 0..100 percentage */ Scene *scene; bNode *node; - for (scene = bmain->scene.first; scene; scene = scene->id.next) + for (scene = bmain->scenes.first; scene; scene = scene->id.next) if (scene->nodetree) for (node = scene->nodetree->nodes.first; node; node = node->next) if (node->type == CMP_NODE_BLUR) { @@ -2013,7 +2013,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) * need to make less ugly - possibly an iterator? */ bScreen *screen; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; /* add regions */ for (sa = screen->areabase.first; sa; sa = sa->next) { @@ -2044,7 +2044,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { /* Initialize particle billboard scale */ part->bb_size[0] = part->bb_size[1] = 1.0f; } @@ -2056,7 +2056,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) Scene *scene; Sequence *seq; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->r.ffcodecdata.audio_channels = 2; scene->audio.volume = 1.0f; SEQ_BEGIN(scene->ed, seq) @@ -2068,7 +2068,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { bScreen *screen; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; /* add regions */ @@ -2109,7 +2109,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) bAction *act; FCurve *fcu; - for (act = bmain->action.first; act; act = act->id.next) { + for (act = bmain->actions.first; act; act = act->id.next) { for (fcu = act->curves.first; fcu; fcu = fcu->next) { BezTriple *bezt; uint i = 0; @@ -2164,7 +2164,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) */ bNodeTree *ntree; /* all node trees in bmain->nodetree are considered groups */ - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) ntree->nodetype = NODE_GROUP; } } @@ -2173,7 +2173,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) { /* Adaptive time step for particle systems */ ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { part->courant_target = 0.2f; part->time_flag &= ~PART_TIME_AUTOSF; } diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 86e4fd47479..31be2244d17 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -609,7 +609,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *sce; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { /* there are files with invalid audio_channels value, the real cause * is unknown, but we fix it here anyway to avoid crashes */ if (sce->r.ffcodecdata.audio_channels == 0) @@ -619,7 +619,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) do_versions_nodetree_image_default_alpha_output(sce->nodetree); } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_versions_nodetree_image_default_alpha_output(ntree); } @@ -627,7 +627,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* support old particle dupliobject rotation settings */ ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { part->draw |= PART_DRAW_ROTATE_OB; @@ -641,13 +641,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 1)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ob->collision_boundtype = ob->boundtype; } { Camera *cam; - for (cam = bmain->camera.first; cam; cam = cam->id.next) { + for (cam = bmain->cameras.first; cam; cam = cam->id.next) { if (cam->sensor_x < 0.01f) cam->sensor_x = DEFAULT_SENSOR_WIDTH; @@ -682,17 +682,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Material *mat; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) do_versions_nodetree_convert_angle(sce->nodetree); } - for (mat = bmain->mat.first; mat; mat = mat->id.next) { + for (mat = bmain->materials.first; mat; mat = mat->id.next) { if (mat->nodetree) do_versions_nodetree_convert_angle(mat->nodetree); } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_versions_nodetree_convert_angle(ntree); } @@ -701,7 +701,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) bScreen *sc; MovieClip *clip; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -725,7 +725,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingTrack *track; if (clip->aspx < 1.0f) { @@ -761,11 +761,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *sce; MovieClip *clip; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { do_versions_image_settings_2_60(sce); } - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingSettings *settings = &clip->tracking.settings; if (settings->default_pattern_size == 0.0f) { @@ -778,7 +778,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* convert delta addition into delta scale */ int i; for (i = 0; i < 3; i++) { @@ -800,7 +800,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * at some point this could be removed. */ else if (bmain->versionfile == 260 && bmain->subversionfile == 6) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (is_zero_v3(ob->dscale)) { copy_vn_fl(ob->dscale, 3, 1.0f); } @@ -810,7 +810,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 8)) { Brush *brush; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) brush->alpha = 1.0f; } @@ -825,32 +825,32 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) World *world; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) do_versions_nodetree_socket_use_flags_2_62(sce->nodetree); } - for (mat = bmain->mat.first; mat; mat = mat->id.next) { + for (mat = bmain->materials.first; mat; mat = mat->id.next) { if (mat->nodetree) do_versions_nodetree_socket_use_flags_2_62(mat->nodetree); } - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->nodetree) do_versions_nodetree_socket_use_flags_2_62(tex->nodetree); } - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { if (la->nodetree) do_versions_nodetree_socket_use_flags_2_62(la->nodetree); } - for (world = bmain->world.first; world; world = world->id.next) { + for (world = bmain->worlds.first; world; world = world->id.next) { if (world->nodetree) do_versions_nodetree_socket_use_flags_2_62(world->nodetree); } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) { do_versions_nodetree_socket_use_flags_2_62(ntree); } } @@ -858,7 +858,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) MovieClip *clip; Object *ob; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object = tracking->objects.first; @@ -878,7 +878,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { bConstraint *con; for (con = ob->constraints.first; con; con = con->next) { if (con->type == CONSTRAINT_TYPE_OBJECTSOLVER) { @@ -897,7 +897,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* convert deprecated sculpt_paint_unified_* fields to * UnifiedPaintSettings */ Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; UnifiedPaintSettings *ups = &ts->unified_paint_settings; ups->size = ts->sculpt_paint_unified_size; @@ -912,7 +912,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* convert extended ascii to utf-8 for text editor */ Text *text; - for (text = bmain->text.first; text; text = text->id.next) { + for (text = bmain->texts.first; text; text = text->id.next) { if (!(text->flags & TXT_ISEXT)) { TextLine *tl; @@ -930,7 +930,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* set new dynamic paint values */ Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_DynamicPaint) { @@ -952,7 +952,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 262) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -970,7 +970,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * try to correct it, if rate is 0.0 that's likely not intentional */ Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Fluidsim) { @@ -987,13 +987,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *sce; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) do_versions_nodetree_multi_file_output_format_2_62_1(sce, sce->nodetree); } /* XXX can't associate with scene for group nodes, image format will stay uninitialized */ - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_versions_nodetree_multi_file_output_format_2_62_1(NULL, ntree); } @@ -1001,7 +1001,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile == 262 && bmain->subversionfile == 1) { { Mesh *me; - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { do_versions_mesh_mloopcol_swap_2_62_1(me); } } @@ -1010,7 +1010,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 2)) { /* Set new idname of keyingsets from their now "label-only" name. */ Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { KeyingSet *ks; for (ks = scene->keyingsets.first; ks; ks = ks->next) { if (!ks->idname[0]) @@ -1023,7 +1023,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; ModifierData *md; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Lattice) { LatticeModifierData *lmd = (LatticeModifierData *)md; @@ -1037,7 +1037,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Read Viscosity presets from older files */ Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Fluidsim) { @@ -1060,7 +1060,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263) { /* Default for old files is to save particle rotations to pointcache */ ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { part->flag |= PART_ROTATIONS; } } @@ -1070,10 +1070,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *sce; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scenes.first; sce; sce = sce->id.next) if (sce->nodetree) do_versions_nodetree_multi_file_output_path_2_63_1(sce->nodetree); - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_versions_nodetree_multi_file_output_path_2_63_1(ntree); } @@ -1085,7 +1085,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * unified paint settings also have weight. Update unified * paint settings and brushes with a default weight value. */ - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; if (ts) { ts->unified_paint_settings.weight = ts->vgroup_weight; @@ -1093,7 +1093,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { brush->weight = 0.5; } } @@ -1101,7 +1101,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 2)) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1137,14 +1137,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Camera *cam; Curve *cu; - for (cam = bmain->camera.first; cam; cam = cam->id.next) { + for (cam = bmain->cameras.first; cam; cam = cam->id.next) { if (cam->flag & CAM_PANORAMA) { cam->type = CAM_PANO; cam->flag &= ~CAM_PANORAMA; } } - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { if (cu->bevfac2 == 0.0f) { cu->bevfac1 = 0.0f; cu->bevfac2 = 1.0f; @@ -1158,13 +1158,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *sce; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) { do_versions_nodetree_file_output_layers_2_64_5(sce->nodetree); do_versions_nodetree_image_layer_2_64_5(sce->nodetree); } } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) { do_versions_nodetree_file_output_layers_2_64_5(ntree); do_versions_nodetree_image_layer_2_64_5(ntree); } @@ -1179,34 +1179,34 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) World *world; bNodeTree *ntree; - for (sce = bmain->scene.first; sce; sce = sce->id.next) + for (sce = bmain->scenes.first; sce; sce = sce->id.next) if (sce->nodetree) do_versions_nodetree_frame_2_64_6(sce->nodetree); - for (mat = bmain->mat.first; mat; mat = mat->id.next) + for (mat = bmain->materials.first; mat; mat = mat->id.next) if (mat->nodetree) do_versions_nodetree_frame_2_64_6(mat->nodetree); - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->textures.first; tex; tex = tex->id.next) if (tex->nodetree) do_versions_nodetree_frame_2_64_6(tex->nodetree); - for (Light *la = bmain->light.first; la; la = la->id.next) + for (Light *la = bmain->lights.first; la; la = la->id.next) if (la->nodetree) do_versions_nodetree_frame_2_64_6(la->nodetree); - for (world = bmain->world.first; world; world = world->id.next) + for (world = bmain->worlds.first; world; world = world->id.next) if (world->nodetree) do_versions_nodetree_frame_2_64_6(world->nodetree); - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_versions_nodetree_frame_2_64_6(ntree); } if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 7)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { @@ -1242,7 +1242,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { Scene *scene; // composite redesign - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->nodetree) { if (scene->nodetree->chunksize == 0) { scene->nodetree->chunksize = 256; @@ -1268,7 +1268,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -1290,7 +1290,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { clip->start_frame = 1; } } @@ -1299,7 +1299,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 11)) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingTrack *track; track = clip->tracking.tracks.first; @@ -1347,7 +1347,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } FOREACH_NODETREE_END; /* keep compatibility for dupliobject particle size */ - for (part = bmain->particle.first; part; part = part->id.next) + for (part = bmain->particles.first; part; part = part->id.next) if (ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) if ((part->draw & PART_DRAW_ROTATE_OB) == 0) part->draw |= PART_DRAW_NO_SCALE_OB; @@ -1376,7 +1376,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 18)) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->ed) { Sequence *seq; @@ -1417,7 +1417,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* make scenes which are not using color management have got None as display device, * so they wouldn't perform linear-to-sRGB conversion on display */ - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if ((scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) == 0) { ColorManagedDisplaySettings *display_settings = &scene->display_settings; @@ -1430,7 +1430,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (ima->source == IMA_SRC_VIEWER) { ima->flag |= IMA_VIEW_AS_RENDER; } @@ -1451,7 +1451,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 20)) { Key *key; - for (key = bmain->key.first; key; key = key->id.next) { + for (key = bmain->shapekeys.first; key; key = key->id.next) { blo_do_versions_key_uidgen(key); } } @@ -1459,7 +1459,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 21)) { { Mesh *me; - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { CustomData_update_typemap(&me->vdata); CustomData_free_layers(&me->vdata, CD_MSTICKY, me->totvert); } @@ -1473,7 +1473,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 264) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pose) { if (ob->pose->avs.path_step == 0) { animviz_settings_init(&ob->pose->avs); @@ -1496,7 +1496,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 2)) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object; @@ -1517,7 +1517,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { @@ -1556,7 +1556,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1580,7 +1580,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* set a unwrapping margin and ABF by default */ Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->toolsettings->uvcalc_margin == 0.0f) { scene->toolsettings->uvcalc_margin = 0.001f; scene->toolsettings->unwrapper = 0; @@ -1612,7 +1612,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->r.tilex == 0 || scene->r.tiley == 1) { scene->r.tilex = scene->r.tiley = 64; } @@ -1622,7 +1622,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) /* collision masks */ { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->col_group == 0) { ob->col_group = 0x01; ob->col_mask = 0xff; @@ -1634,7 +1634,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 264 || (bmain->versionfile == 264 && bmain->subversionfile < 7)) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingTrack *track; MovieTrackingObject *object; @@ -1652,7 +1652,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 3)) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1698,7 +1698,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *scene; Tex *tex; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { Sequence *seq; SEQ_BEGIN (scene->ed, seq) @@ -1716,7 +1716,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) scene->r.bake_samples = 256; } - for (Image *image = bmain->image.first; image; image = image->id.next) { + for (Image *image = bmain->images.first; image; image = image->id.next) { if (image->flag & IMA_DO_PREMUL) { image->alpha_mode = IMA_ALPHA_STRAIGHT; } @@ -1725,7 +1725,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->type == TEX_IMAGE && (tex->imaflag & TEX_USEALPHA) == 0) { Image *image = blo_do_versions_newlibadr(fd, tex->id.lib, tex->ima); @@ -1755,7 +1755,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * for compatibility all textures assumed it to be enabled */ Tex *tex; - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->textures.first; tex; tex = tex->id.next) if (tex->type == TEX_IMAGE) tex->imaflag |= TEX_USEALPHA; } @@ -1763,7 +1763,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (bmain->versionfile < 265 || (bmain->versionfile == 265 && bmain->subversionfile < 7)) { Curve *cu; - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { if (cu->flag & (CU_FRONT | CU_BACK)) { if (cu->ext1 != 0.0f || cu->ext2 != 0.0f) { Nurb *nu; @@ -1797,14 +1797,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (MAIN_VERSION_OLDER(bmain, 265, 9)) { Mesh *me; - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { BKE_mesh_do_versions_cd_flag_init(me); } } if (MAIN_VERSION_OLDER(bmain, 265, 10)) { Brush *br; - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { if (br->ob_mode & OB_MODE_TEXTURE_PAINT) { br->mtex.brush_map_mode = MTEX_MAP_MODE_TILED; } @@ -1833,7 +1833,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (MAIN_VERSION_OLDER(bmain, 266, 2)) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1907,7 +1907,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 266, 4)) { Brush *brush; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { BKE_texture_mtex_default(&brush->mask_mtex); if (brush->ob_mode & OB_MODE_TEXTURE_PAINT) { @@ -1920,7 +1920,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Brush *brush; #define BRUSH_TEXTURE_OVERLAY (1 << 21) - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { brush->overlay_flags = 0; if (brush->flag & BRUSH_TEXTURE_OVERLAY) brush->overlay_flags |= (BRUSH_OVERLAY_PRIMARY | BRUSH_OVERLAY_CURSOR); @@ -1932,7 +1932,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) //if (!DNA_struct_elem_find(fd->filesdna, "Brush", "int", "stencil_pos")) { Brush *brush; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->stencil_dimension[0] == 0) { brush->stencil_dimension[0] = 256; brush->stencil_dimension[1] = 256; @@ -1962,7 +1962,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) SceneRenderLayer *srl; FreestyleLineStyle *linestyle; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->r.line_thickness_mode == 0) { sce->r.line_thickness_mode = R_LINE_THICKNESS_ABSOLUTE; sce->r.unit_line_thickness = 1.0f; @@ -1998,7 +1998,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) { + for (linestyle = bmain->linestyles.first; linestyle; linestyle = linestyle->id.next) { #if 1 /* disable the Misc panel for now */ if (linestyle->panel == LS_PANEL_MISC) { @@ -2022,7 +2022,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *scene; bNodeInstanceKey active_viewer_key = {0}; /* simply pick the first node space and use that for the active viewer key */ - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; for (sa = screen->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -2044,7 +2044,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) break; } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { /* NB: scene->nodetree is a local ID block, has been direct_link'ed */ if (scene->nodetree) scene->nodetree->active_viewer_key = active_viewer_key; @@ -2054,7 +2054,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (MAIN_VERSION_OLDER(bmain, 267, 1)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { @@ -2074,7 +2074,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 268, 1)) { Brush *brush; - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { brush->spacing = MAX2(1, brush->spacing); } } @@ -2082,7 +2082,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 268, 2)) { Brush *brush; #define BRUSH_FIXED (1 << 6) - for (brush = bmain->brush.first; brush; brush = brush->id.next) { + for (brush = bmain->brushes.first; brush; brush = brush->id.next) { brush->flag &= ~BRUSH_FIXED; if (brush->cursor_overlay_alpha < 2) @@ -2100,7 +2100,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) bScreen *sc; Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { bConstraint *con; for (con = ob->constraints.first; con; con = con->next) { if (con->type == CONSTRAINT_TYPE_SHRINKWRAP) { @@ -2113,7 +2113,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { @@ -2132,7 +2132,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) * * We moved this check to the do versions to be sure the value makes any sense. */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -2153,7 +2153,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) ScrArea *sa; /* add missing (+) expander in node editor */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { for (sa = sc->areabase.first; sa; sa = sa->next) { ARegion *ar, *arnew; @@ -2232,7 +2232,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *scene; /* Update files using invalid (outdated) outlinevis Outliner values. */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { for (sa = sc->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_OUTLINER) { @@ -2253,7 +2253,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingTrack", "float", "weight")) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object; for (tracking_object = tracking->objects.first; @@ -2274,7 +2274,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "TriangulateModifierData", "int", "quad_method")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Triangulate) { @@ -2292,7 +2292,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { /* this can now be turned off */ ToolSettings *ts = scene->toolsettings; if (ts->sculpt) @@ -2318,11 +2318,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) Scene *scene; Object *ob; - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->spotsize = DEG2RADF(la->spotsize); } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -2337,7 +2337,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { Sequence *seq; SEQ_BEGIN (scene->ed, seq) { @@ -2371,7 +2371,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingPlaneTrack *plane_track; for (plane_track = clip->tracking.plane_tracks.first; plane_track; @@ -2385,7 +2385,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 269, 7)) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { Sculpt *sd = scene->toolsettings->sculpt; if (sd) { @@ -2412,7 +2412,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 269, 8)) { Curve *cu; - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { if (cu->str) { cu->len_wchar = BLI_strlen_utf8(cu->str); } @@ -2422,7 +2422,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 269, 9)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Build) { @@ -2438,7 +2438,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 269, 11)) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *space_link; diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index ab32a6d60a1..3ea9c812d15 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -406,7 +406,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Bevel) { @@ -433,7 +433,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) { bScreen *screen; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *area; for (area = screen->areabase.first; area; area = area->next) { SpaceLink *space_link; @@ -451,7 +451,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingSettings", "float", "default_weight")) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { clip->tracking.settings.default_weight = 1.0f; } } @@ -461,7 +461,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; /* Update Transform constraint (another deg -> rad stuff). */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { do_version_constraints_radians_degrees_270_1(&ob->constraints); if (ob->pose) { @@ -478,7 +478,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Mesh *me; /* Mesh smoothresh deg->rad. */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { me->smoothresh = DEG2RADF(me->smoothresh); } } @@ -486,7 +486,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 270, 3)) { FreestyleLineStyle *linestyle; - for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) { + for (linestyle = bmain->linestyles.first; linestyle; linestyle = linestyle->id.next) { linestyle->flag |= LS_NO_SORTING; linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA; linestyle->integration_type = LS_INTEGRATION_MEAN; @@ -499,7 +499,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) */ bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -520,7 +520,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; /* Update Transform constraint (again :|). */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { do_version_constraints_radians_degrees_270_5(&ob->constraints); if (ob->pose) { @@ -537,7 +537,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "BakeData", "bake")) { Scene *sce; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->r.bake.flag = R_BAKE_CLEAR; sce->r.bake.width = 512; sce->r.bake.height = 512; @@ -559,7 +559,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "FreestyleLineStyle", "float", "texstep")) { FreestyleLineStyle *linestyle; - for (linestyle = bmain->linestyle.first; linestyle; linestyle = linestyle->id.next) { + for (linestyle = bmain->linestyles.first; linestyle; linestyle = linestyle->id.next) { linestyle->flag |= LS_TEXTURE; linestyle->texstep = 1.0; } @@ -567,7 +567,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { int num_layers = BLI_listbase_count(&scene->r.layers); scene->r.actlay = min_ff(scene->r.actlay, num_layers - 1); } @@ -578,7 +578,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line_col[4]")) { Material *mat; - for (mat = bmain->mat.first; mat; mat = mat->id.next) { + for (mat = bmain->materials.first; mat; mat = mat->id.next) { mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f; mat->line_col[3] = mat->alpha; } @@ -586,7 +586,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->r.preview_start_resolution = 64; } } @@ -595,13 +595,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 271, 3)) { Brush *br; - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { br->fill_threshold = 0.2f; } if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "int", "mat")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -616,7 +616,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 271, 6)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -633,7 +633,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 272, 0)) { if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->r.preview_start_resolution = 64; } } @@ -641,7 +641,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 272, 1)) { Brush *br; - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { if ((br->ob_mode & OB_MODE_SCULPT) && ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK)) br->alpha = 1.0f; } @@ -650,7 +650,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 272, 2)) { if (!DNA_struct_elem_find(fd->filesdna, "Image", "float", "gen_color")) { Image *image; - for (image = bmain->image.first; image != NULL; image = image->id.next) { + for (image = bmain->images.first; image != NULL; image = image->id.next) { image->gen_color[3] = 1.0f; } } @@ -659,7 +659,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; /* Update Transform constraint (again :|). */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { do_version_constraints_stretch_to_limits(&ob->constraints); if (ob->pose) { @@ -679,7 +679,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Brush *br; - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { if (br->flag & BRUSH_RAKE) { br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE; br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RAKE; @@ -701,7 +701,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "Scene", "DisplaySafeAreas", "safe_areas")) { Scene *scene; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { copy_v2_fl2(scene->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f); copy_v2_fl2(scene->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f); copy_v2_fl2(scene->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f); @@ -712,7 +712,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 273, 3)) { ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (part->clumpcurve) part->child_flag |= PART_CHILD_USE_CLUMP_CURVE; if (part->roughcurve) @@ -724,7 +724,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "bending_damping")) { Object *ob; ModifierData *md; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData *)md; @@ -742,21 +742,21 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "float", "clump_noise_size")) { ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { part->clump_noise_size = 1.0f; } } if (!DNA_struct_elem_find(fd->filesdna, "ParticleSettings", "int", "kink_extra_steps")) { ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { part->kink_extra_steps = 4; } } if (!DNA_struct_elem_find(fd->filesdna, "MTex", "float", "kinkampfac")) { ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { int a; for (a = 0; a < MAX_MTEX; a++) { MTex *mtex = part->mtex[a]; @@ -770,7 +770,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "HookModifierData", "char", "flag")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Hook) { @@ -800,7 +800,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) { Camera *ca; - for (ca = bmain->camera.first; ca; ca = ca->id.next) { + for (ca = bmain->cameras.first; ca; ca = ca->id.next) { ca->gpu_dof.fstop = 128.0f; ca->gpu_dof.focal_length = 1.0f; ca->gpu_dof.focus_distance = 1.0f; @@ -811,7 +811,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 273, 8)) { Object *ob; - for (ob = bmain->object.first; ob != NULL; ob = ob->id.next) { + for (ob = bmain->objects.first; ob != NULL; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.last; md != NULL; md = md->prev) { if (modifier_unique_name(&ob->modifiers, md)) { @@ -830,7 +830,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *ar; /* Make sure sequencer preview area limits zoom */ - for (scr = bmain->screen.first; scr; scr = scr->id.next) { + for (scr = bmain->screens.first; scr; scr = scr->id.next) { for (sa = scr->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -853,7 +853,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) { Object *ob; ParticleSystem *psys; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (psys = ob->particlesystem.first; psys; psys = psys->next) { if ((psys->pointcache->flag & PTCACHE_BAKED) == 0) { psys->recalc |= ID_RECALC_PSYS_RESET; @@ -865,7 +865,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) /* hysteresis setted to 10% but not actived */ if (!DNA_struct_elem_find(fd->filesdna, "LodLevel", "int", "obhysteresis")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { LodLevel *level; for (level = ob->lodlevels.first; level; level = level->next) { level->obhysteresis = 10; @@ -883,7 +883,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Camera *cam; Image *ima; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { Sequence *seq; BKE_scene_add_render_view(scene, STEREO_LEFT_NAME); @@ -912,7 +912,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } SEQ_END; } - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; for (sa = screen->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -939,12 +939,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (cam = bmain->camera.first; cam; cam = cam->id.next) { + for (cam = bmain->cameras.first; cam; cam = cam->id.next) { cam->stereo.interocular_distance = 0.065f; cam->stereo.convergence_distance = 30.0f * 0.065f; } - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { ima->stereo3d_format = MEM_callocN(sizeof(Stereo3dFormat), "Image Stereo 3d Format"); if (ima->packedfile) { @@ -968,7 +968,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) bScreen *screen; if (!DNA_struct_elem_find(fd->filesdna, "FileSelectParams", "int", "thumbnail_size")) { - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; for (sa = screen->areabase.first; sa; sa = sa->next) { @@ -989,7 +989,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "short", "simplify_subsurf_render")) { Scene *scene; - for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { scene->r.simplify_subsurf_render = scene->r.simplify_subsurf; scene->r.simplify_particles_render = scene->r.simplify_particles; } @@ -998,7 +998,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "DecimateModifierData", "float", "defgrp_factor")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Decimate) { @@ -1013,7 +1013,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 275, 3)) { Brush *br; #define BRUSH_TORUS (1 << 1) - for (br = bmain->brush.first; br; br = br->id.next) { + for (br = bmain->brushes.first; br; br = br->id.next) { br->flag &= ~BRUSH_TORUS; } #undef BRUSH_TORUS @@ -1023,7 +1023,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "custom_scale")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pose) { bPoseChannel *pchan; for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { @@ -1036,7 +1036,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) { bScreen *screen; #define RV3D_VIEW_PERSPORTHO 7 - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; for (sa = screen->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1064,7 +1064,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) { #define LA_YF_PHOTON 5 - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { if (la->type == LA_YF_PHOTON) { la->type = LA_LOCAL; } @@ -1076,7 +1076,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 276, 3)) { if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "CurveMapping", "mblur_shutter_curve")) { Scene *scene; - for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { CurveMapping *curve_mapping = &scene->r.mblur_shutter_curve; curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f); curvemapping_initialize(curve_mapping); @@ -1089,7 +1089,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 276, 4)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; if (ts->gp_sculpt.brush[0].size == 0) { @@ -1164,7 +1164,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { bool enabled = false; /* Ensure that the datablock's onionskinning toggle flag @@ -1198,13 +1198,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 276, 7)) { Scene *scene; - for (scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { scene->r.bake.pass_filter = R_BAKE_PASS_FILTER_ALL; } } if (!MAIN_VERSION_ATLEAST(bmain, 277, 1)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ParticleEditSettings *pset = &scene->toolsettings->particle; for (int a = 0; a < ARRAY_SIZE(pset->brush); a++) { if (pset->brush[a].strength > 1.0f) { @@ -1213,7 +1213,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; @@ -1246,7 +1246,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { CurvePaintSettings *cps = &scene->toolsettings->curve_paint_settings; if (cps->error_threshold == 0) { cps->curve_type = CU_BEZIER; @@ -1257,7 +1257,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { Sequence *seq; SEQ_BEGIN (scene->ed, seq) @@ -1280,7 +1280,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Adding "Properties" region to DopeSheet */ - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { /* handle pushed-back space data first */ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { @@ -1300,12 +1300,12 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 277, 2)) { if (!DNA_struct_elem_find(fd->filesdna, "Bone", "float", "scaleIn")) { - for (bArmature *arm = bmain->armature.first; arm; arm = arm->id.next) { + for (bArmature *arm = bmain->armatures.first; arm; arm = arm->id.next) { do_version_bones_super_bbone(&arm->bonebase); } } if (!DNA_struct_elem_find(fd->filesdna, "bPoseChannel", "float", "scaleIn")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pose) { for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { /* see do_version_bones_super_bbone()... */ @@ -1325,7 +1325,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Camera *camera = bmain->camera.first; camera != NULL; camera = camera->id.next) { + for (Camera *camera = bmain->cameras.first; camera != NULL; camera = camera->id.next) { if (camera->stereo.pole_merge_angle_from == 0.0f && camera->stereo.pole_merge_angle_to == 0.0f) { @@ -1337,7 +1337,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "NormalEditModifierData", "float", "mix_limit")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_NormalEdit) { @@ -1350,7 +1350,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "BooleanModifierData", "float", "double_threshold")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Boolean) { @@ -1361,7 +1361,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Brush *br = bmain->brush.first; br; br = br->id.next) { + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { if (br->sculpt_tool == SCULPT_TOOL_FLATTEN) { br->flag |= BRUSH_ACCUMULATE; } @@ -1370,7 +1370,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "float", "time_scale")) { Object *ob; ModifierData *md; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData *)md; @@ -1390,7 +1390,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 277, 3)) { /* ------- init of grease pencil initialization --------------- */ if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", "bGPDpalettecolor", "*palcolor")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; /* initialize use position for sculpt brushes */ ts->gp_sculpt.flag |= GP_SCULPT_SETT_FLAG_APPLY_POSITION; @@ -1409,7 +1409,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Convert Grease Pencil to new palettes/brushes * Loop all strokes and create the palette and all colors */ - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { if (BLI_listbase_is_empty(&gpd->palettes)) { /* create palette */ bGPDpalette *palette = BKE_gpencil_palette_addnew(gpd, "GP_Palette"); @@ -1456,7 +1456,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 278, 0)) { if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingTrack", "float", "weight_stab")) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object; for (tracking_object = tracking->objects.first; @@ -1477,7 +1477,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingStabilization", "int", "tot_rot_track")) { MovieClip *clip; - for (clip = bmain->movieclip.first; clip != NULL; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip != NULL; clip = clip->id.next) { if (clip->tracking.stabilization.rot_track) { migrate_single_rot_stabilization_track_settings(&clip->tracking.stabilization); } @@ -1499,13 +1499,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 278, 2)) { if (!DNA_struct_elem_find(fd->filesdna, "FFMpegCodecData", "int", "ffmpeg_preset")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* "medium" is the preset FFmpeg uses when no presets are given. */ scene->r.ffcodecdata.ffmpeg_preset = FFM_PRESET_MEDIUM; } } if (!DNA_struct_elem_find(fd->filesdna, "FFMpegCodecData", "int", "constant_rate_factor")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* fall back to behavior from before we introduced CRF for old files */ scene->r.ffcodecdata.constant_rate_factor = FFM_CRF_NONE; } @@ -1515,7 +1515,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; ModifierData *md; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData *)md; @@ -1531,7 +1531,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 278, 3)) { - for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { if (scene->toolsettings != NULL) { ToolSettings *ts = scene->toolsettings; ParticleEditSettings *pset = &ts->particle; @@ -1545,7 +1545,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyCon", "float", "spring_stiffness_ang_x")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { RigidBodyCon *rbc = ob->rigidbody_constraint; if (rbc) { rbc->spring_stiffness_ang_x = 10.0; @@ -1560,7 +1560,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) /* constant detail for sculpting is now a resolution value instead of * a percentage, we reuse old DNA struct member but convert it */ - for (Scene *scene = bmain->scene.first; scene != NULL; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) { if (scene->toolsettings != NULL) { ToolSettings *ts = scene->toolsettings; if (ts->sculpt && ts->sculpt->constant_detail != 0.0f) { @@ -1572,14 +1572,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 278, 4)) { const float sqrt_3 = (float)M_SQRT3; - for (Brush *br = bmain->brush.first; br; br = br->id.next) { + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { br->fill_threshold /= sqrt_3; } /* Custom motion paths */ if (!DNA_struct_elem_find(fd->filesdna, "bMotionPath", "int", "line_thickness")) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { bMotionPath *mpath; bPoseChannel *pchan; mpath = ob->mpath; @@ -1609,7 +1609,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 278, 5)) { /* Mask primitive adding code was not initializing correctly id_type of its points' parent. */ - for (Mask *mask = bmain->mask.first; mask; mask = mask->id.next) { + for (Mask *mask = bmain->masks.first; mask; mask = mask->id.next) { for (MaskLayer *mlayer = mask->masklayers.first; mlayer; mlayer = mlayer->next) { for (MaskSpline *mspline = mlayer->splines.first; mspline; mspline = mspline->next) { int i = 0; @@ -1647,7 +1647,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "float", "mat[4][4]")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_SurfaceDeform) { SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md; @@ -1665,14 +1665,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 279, 0)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->r.im_format.exr_codec == R_IMF_EXR_CODEC_DWAB) { scene->r.im_format.exr_codec = R_IMF_EXR_CODEC_DWAA; } } /* Fix related to VGroup modifiers creating named defgroup CD layers! See T51520. */ - for (Mesh *me = bmain->mesh.first; me; me = me->id.next) { + for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { CustomData_set_layer_name(&me->vdata, CD_MDEFORMVERT, 0, ""); } } @@ -1682,7 +1682,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Object *ob; ModifierData *md; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData *)md; @@ -1697,7 +1697,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 279, 4)) { /* Fix for invalid state of screen due to bug in older versions. */ - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { if (sa->full && sc->state == SCREENNORMAL) { sa->full = NULL; @@ -1706,7 +1706,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "Brush", "float", "falloff_angle")) { - for (Brush *br = bmain->brush.first; br; br = br->id.next) { + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { br->falloff_angle = DEG2RADF(80); br->flag &= ~( BRUSH_FLAG_DEPRECATED_1 | BRUSH_FLAG_DEPRECATED_6 | @@ -1714,7 +1714,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) BRUSH_FRONTFACE_FALLOFF); } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; for (int i = 0; i < 2; i++) { VPaint *vp = i ? ts->vpaint : ts->wpaint; @@ -1729,7 +1729,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Simple deform modifier no longer assumes Z axis (X for bend type). * Must set previous defaults. */ if (!DNA_struct_elem_find(fd->filesdna, "SimpleDeformModifierData", "char", "deform_axis")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_SimpleDeform) { SimpleDeformModifierData *smd = (SimpleDeformModifierData *)md; @@ -1739,7 +1739,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { int preset = scene->r.ffcodecdata.ffmpeg_preset; if (preset == FFM_PRESET_NONE || preset >= FFM_PRESET_GOOD) { continue; @@ -1757,7 +1757,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_ParticleInstance) { ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d00554e7cd4..d68f0fe5d2c 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -113,7 +113,7 @@ static bScreen *screen_parent_find(const bScreen *screen) static void do_version_workspaces_create_from_screens(Main *bmain) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { const bScreen *screen_parent = screen_parent_find(screen); WorkSpace *workspace; if (screen->temp) { @@ -124,7 +124,7 @@ static void do_version_workspaces_create_from_screens(Main *bmain) /* fullscreen with "Back to Previous" option, don't create * a new workspace, add layout workspace containing parent */ workspace = BLI_findstring( - &bmain->workspace, screen_parent->id.name + 2, offsetof(ID, name) + 2); + &bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2); } else { workspace = BKE_workspace_add(bmain, screen->id.name + 2); @@ -177,7 +177,7 @@ static void do_version_area_change_space_to_space_action(ScrArea *area, const Sc */ static void do_version_workspaces_after_lib_link(Main *bmain) { - BLI_assert(BLI_listbase_is_empty(&bmain->workspace)); + BLI_assert(BLI_listbase_is_empty(&bmain->workspaces)); do_version_workspaces_create_from_screens(bmain); @@ -195,7 +195,7 @@ static void do_version_workspaces_after_lib_link(Main *bmain) continue; } - WorkSpace *workspace = BLI_findstring(&bmain->workspace, screen->id.name + 2, offsetof(ID, name) + 2); + WorkSpace *workspace = BLI_findstring(&bmain->workspaces, screen->id.name + 2, offsetof(ID, name) + 2); BLI_assert(workspace != NULL); ListBase *layouts = BKE_workspace_layouts_get(workspace); @@ -219,7 +219,7 @@ static void do_version_workspaces_after_lib_link(Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { /* Deprecated from now on! */ BLI_freelistN(&screen->scene->transform_spaces); screen->scene = NULL; @@ -571,7 +571,7 @@ void do_versions_after_linking_280(Main *bmain) use_collection_compat_28 = false; /* Convert group layer visibility flags to hidden nested collection. */ - for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = bmain->collections.first; collection; collection = collection->id.next) { /* Add fake user for all existing groups. */ id_fake_user_set(&collection->id); @@ -612,18 +612,18 @@ void do_versions_after_linking_280(Main *bmain) /* We need to assign lib pointer to generated hidden collections *after* all have been created, otherwise we'll * end up with several datablocks sharing same name/library, which is FORBIDDEN! * Note: we need this to be recursive, since a child collection may be sorted before its parent in bmain... */ - for (Collection *collection = bmain->collection.first; collection != NULL; collection = collection->id.next) { + for (Collection *collection = bmain->collections.first; collection != NULL; collection = collection->id.next) { do_version_collection_propagate_lib_to_children(collection); } /* Convert layers to collections. */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { do_version_layers_to_collections(bmain, scene); } } if (!MAIN_VERSION_ATLEAST(bmain, 280, 0)) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { /* same render-layer as do_version_workspaces_after_lib_link will activate, * so same layer as BKE_view_layer_default_view would return */ ViewLayer *layer = screen->scene->view_layers.first; @@ -664,7 +664,7 @@ void do_versions_after_linking_280(Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 2)) { /* Cleanup any remaining SceneRenderLayer data for files that were created * with Blender 2.8 before the SceneRenderLayer > RenderLayer refactor. */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) { if (srl->prop) { IDP_FreeProperty(srl->prop); @@ -679,7 +679,7 @@ void do_versions_after_linking_280(Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 3)) { /* Due to several changes to particle RNA and draw code particles from older files may no longer * be visible. Here we correct this by setting a default draw size for those files. */ - for (Object *object = bmain->object.first; object; object = object->id.next) { + for (Object *object = bmain->objects.first; object; object = object->id.next) { for (ParticleSystem *psys = object->particlesystem.first; psys; psys = psys->next) { if (psys->part->draw_size == 0.0f) { psys->part->draw_size = 0.1f; @@ -689,7 +689,7 @@ void do_versions_after_linking_280(Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 4)) { - for (Object *object = bmain->object.first; object; object = object->id.next) { + for (Object *object = bmain->objects.first; object; object = object->id.next) { if (object->particlesystem.first) { object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT; for (ParticleSystem *psys = object->particlesystem.first; psys; psys = psys->next) { @@ -708,7 +708,7 @@ void do_versions_after_linking_280(Main *bmain) } /* Cleanup deprecated flag from particlesettings data-blocks. */ - for (ParticleSettings *part = bmain->particle.first; part; part = part->id.next) { + for (ParticleSettings *part = bmain->particles.first; part; part = part->id.next) { part->draw &= ~PART_DRAW_EMITTER; } } @@ -716,7 +716,7 @@ void do_versions_after_linking_280(Main *bmain) /* SpaceTime & SpaceLogic removal/replacing */ if (!MAIN_VERSION_ATLEAST(bmain, 280, 9)) { const wmWindowManager *wm = bmain->wm.first; - const Scene *scene = bmain->scene.first; + const Scene *scene = bmain->scenes.first; if (wm != NULL) { /* Action editors need a scene for creation. First, update active @@ -736,7 +736,7 @@ void do_versions_after_linking_280(Main *bmain) } } if (scene != NULL) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { if (ELEM(area->butspacetype, SPACE_TIME, SPACE_LOGIC)) { /* Areas that were already handled won't be handled again */ @@ -752,11 +752,11 @@ void do_versions_after_linking_280(Main *bmain) #ifdef USE_COLLECTION_COMPAT_28 if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 14)) { - for (Collection *group = bmain->collection.first; group; group = group->id.next) { + for (Collection *group = bmain->collections.first; group; group = group->id.next) { do_version_group_collection_to_collection(bmain, group); } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { do_version_scene_collection_to_collection(bmain, scene); } } @@ -764,7 +764,7 @@ void do_versions_after_linking_280(Main *bmain) /* Update Curve object Shape Key data layout to include the Radius property */ if (!MAIN_VERSION_ATLEAST(bmain, 280, 23)) { - for (Curve *cu = bmain->curve.first; cu; cu = cu->id.next) { + for (Curve *cu = bmain->curves.first; cu; cu = cu->id.next) { if (!cu->key || cu->key->elemsize != sizeof(float[4])) continue; @@ -832,7 +832,7 @@ void do_versions_after_linking_280(Main *bmain) /* Move B-Bone custom handle settings from bPoseChannel to Bone. */ if (!MAIN_VERSION_ATLEAST(bmain, 280, 25)) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { bArmature *arm = ob->data; /* If it is an armature from the same file. */ @@ -865,7 +865,7 @@ void do_versions_after_linking_280(Main *bmain) /* Tag pose rebuild for all objects that use this armature. */ if (rebuild) { - for (Object *ob2 = bmain->object.first; ob2; ob2 = ob2->id.next) { + for (Object *ob2 = bmain->objects.first; ob2; ob2 = ob2->id.next) { if (ob2->pose && ob2->data == arm) { ob2->pose->flag |= POSE_RECALC; } @@ -876,7 +876,7 @@ void do_versions_after_linking_280(Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 30)) { - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->gpencil_settings != NULL) { brush->gpencil_tool = brush->gpencil_settings->brush_type; } @@ -886,7 +886,7 @@ void do_versions_after_linking_280(Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 38)) { /* Ensure we get valid rigidbody object/constraint data in relevant collections' objects. */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { RigidBodyWorld *rbw = scene->rigidbody_world; if (rbw == NULL) { @@ -918,20 +918,20 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 0)) { use_collection_compat_28 = false; - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->r.gauss = 1.5f; } } if (!MAIN_VERSION_ATLEAST(bmain, 280, 1)) { if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "bleedexp")) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->bleedexp = 2.5f; } } if (!DNA_struct_elem_find(fd->filesdna, "GPUDOFSettings", "float", "ratio")) { - for (Camera *ca = bmain->camera.first; ca; ca = ca->id.next) { + for (Camera *ca = bmain->cameras.first; ca; ca = ca->id.next) { ca->gpu_dof.ratio = 1.0f; } } @@ -939,7 +939,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* MTexPoly now removed. */ if (DNA_struct_find(fd->filesdna, "MTexPoly")) { const int cd_mtexpoly = 15; /* CD_MTEXPOLY, deprecated */ - for (Mesh *me = bmain->mesh.first; me; me = me->id.next) { + for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { /* If we have UV's, so this file will have MTexPoly layers too! */ if (me->mloopuv != NULL) { CustomData_update_typemap(&me->pdata); @@ -952,7 +952,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 2)) { if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "cascade_max_dist")) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->cascade_max_dist = 1000.0f; la->cascade_count = 4; la->cascade_exponent = 0.8f; @@ -961,7 +961,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "contact_dist")) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->contact_dist = 0.2f; la->contact_bias = 0.03f; la->contact_spread = 0.2f; @@ -970,7 +970,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "LightProbe", "float", "vis_bias")) { - for (LightProbe *probe = bmain->lightprobe.first; probe; probe = probe->id.next) { + for (LightProbe *probe = bmain->lightprobes.first; probe; probe = probe->id.next) { probe->vis_bias = 1.0f; probe->vis_blur = 0.2f; } @@ -1038,7 +1038,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) (DNA_struct_elem_find(fd->filesdna, "ViewLayer", "FreestyleConfig", "freestyle_config") == false) && DNA_struct_elem_find(fd->filesdna, "Scene", "ListBase", "view_layers")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ViewLayer *view_layer; for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { view_layer->flag |= VIEW_LAYER_FREESTYLE; @@ -1054,7 +1054,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) { /* Grease pencil sculpt and paint cursors */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "int", "weighttype")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* sculpt brushes */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if (gset) { @@ -1069,7 +1069,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f); GP_Sculpt_Data *gp_brush; - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; /* sculpt brushes */ GP_Sculpt_Settings *gset = &ts->gp_sculpt; @@ -1084,21 +1084,21 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Init grease pencil edit line color */ if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "float", "line_color[4]")) { - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { ARRAY_SET_ITEMS(gpd->line_color, 0.6f, 0.6f, 0.6f, 0.5f); } } /* Init grease pencil pixel size factor */ if (!DNA_struct_elem_find(fd->filesdna, "bGPdata", "int", "pixfactor")) { - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { gpd->pixfactor = GP_DEFAULT_PIX_FACTOR; } } /* Grease pencil multiframe falloff curve */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_falloff")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* sculpt brushes */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if ((gset) && (gset->cur_falloff == NULL)) { @@ -1116,14 +1116,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) #ifdef USE_COLLECTION_COMPAT_28 if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 3)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ViewLayer *view_layer; for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { do_version_view_layer_visibility(view_layer); } } - for (Collection *group = bmain->collection.first; group; group = group->id.next) { + for (Collection *group = bmain->collections.first; group; group = group->id.next) { if (group->view_layer != NULL) { do_version_view_layer_visibility(group->view_layer); } @@ -1134,7 +1134,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 3)) { /* init grease pencil grids and paper */ if (!DNA_struct_elem_find(fd->filesdna, "gp_paper_opacity", "float", "gpencil_paper_color[3]")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1155,7 +1155,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) SpaceLink *sl; /* Update files using invalid (outdated) outlinevis Outliner values. */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { for (sa = sc->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_OUTLINER) { @@ -1177,12 +1177,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "LightProbe", "float", "intensity")) { - for (LightProbe *probe = bmain->lightprobe.first; probe; probe = probe->id.next) { + for (LightProbe *probe = bmain->lightprobes.first; probe; probe = probe->id.next) { probe->intensity = 1.0f; } } - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { bConstraint *con, *con_next; con = ob->constraints.first; while (con) { @@ -1196,7 +1196,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1220,7 +1220,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) * development, we assume any files saved in 2.8 had Eevee set * as scene render engine. */ if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); } } @@ -1228,7 +1228,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 8)) { /* Blender Internal removal */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { if (STREQ(scene->r.engine, "BLENDER_RENDER") || STREQ(scene->r.engine, "BLENDER_GAME")) { @@ -1238,7 +1238,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) scene->r.bake_mode = 0; } - for (Tex *tex = bmain->tex.first; tex; tex = tex->id.next) { + for (Tex *tex = bmain->textures.first; tex; tex = tex->id.next) { /* Removed envmap, pointdensity, voxeldata, ocean textures. */ if (ELEM(tex->type, 10, 14, 15, 16)) { tex->type = 0; @@ -1250,7 +1250,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) { /* Remove info editor, but only if at the top of the window. */ - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { /* Calculate window width/height from screen vertices */ int win_width = 0, win_height = 0; for (ScrVert *vert = screen->vertbase.first; vert; vert = vert->next) { @@ -1281,7 +1281,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { if (la->mode & (1 << 13)) { /* LA_SHAD_RAY */ la->mode |= LA_SHADOW; la->mode &= ~(1 << 13); @@ -1291,7 +1291,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 12)) { /* Remove tool property regions. */ - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_CLIP)) { @@ -1314,13 +1314,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 13)) { /* Initialize specular factor. */ if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "spec_fac")) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->spec_fac = 1.0f; } } /* Initialize new view3D options. */ - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1342,24 +1342,24 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 14)) { if (!DNA_struct_elem_find(fd->filesdna, "Scene", "SceneDisplay", "display")) { /* Initialize new scene.SceneDisplay */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { copy_v3_v3(scene->display.light_direction, (float[3]){-M_SQRT1_3, -M_SQRT1_3, M_SQRT1_3}); } } if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "float", "shadow_shift")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->display.shadow_shift = 0.1; } } if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "transform_pivot_point")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEDIAN; } } if (!DNA_struct_find(fd->filesdna, "SceneEEVEE")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* First set the default for all the properties. */ scene->eevee.gi_diffuse_bounces = 3; @@ -1540,13 +1540,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->display.matcap_ssao_distance = 0.2f; scene->display.matcap_ssao_attenuation = 1.0f; scene->display.matcap_ssao_samples = 16; } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_OUTLINER) { @@ -1558,7 +1558,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { switch (scene->toolsettings->snap_mode) { case 0: scene->toolsettings->snap_mode = SCE_SNAP_MODE_INCREMENT; break; case 1: scene->toolsettings->snap_mode = SCE_SNAP_MODE_VERTEX ; break; @@ -1579,7 +1579,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } ParticleSettings *part; - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { part->shape_flag = PART_SHAPE_CLOSE_TIP; part->shape = 0.0f; part->rad_root = 1.0f; @@ -1592,7 +1592,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 18)) { if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "roughness")) { - for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) { + for (Material *mat = bmain->materials.first; mat; mat = mat->id.next) { if (mat->use_nodes) { if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) { mat->roughness = mat->gloss_mir; @@ -1607,7 +1607,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) mat->metallic = mat->ray_mirror; } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1620,7 +1620,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "xray_alpha")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1635,7 +1635,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) StudioLight *default_matcap = BKE_studiolight_find_default(STUDIOLIGHT_TYPE_MATCAP); /* when loading the internal file is loaded before the matcaps */ if (default_matcap) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1648,7 +1648,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "wireframe_threshold")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1660,7 +1660,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "cavity_valley_factor")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1673,7 +1673,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "xray_alpha_bone")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1688,7 +1688,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 19)) { if (!DNA_struct_elem_find(fd->filesdna, "Image", "ListBase", "renderslot")) { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { if (ima->type == IMA_TYPE_R_RESULT) { for (int i = 0; i < 8; i++) { RenderSlot *slot = MEM_callocN(sizeof(RenderSlot), "Image Render Slot Init"); @@ -1699,7 +1699,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "SpaceAction", "char", "mode_prev")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_ACTION) { @@ -1714,7 +1714,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1732,14 +1732,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 21)) { - for (Scene *sce = bmain->scene.first; sce != NULL; sce = sce->id.next) { + for (Scene *sce = bmain->scenes.first; sce != NULL; sce = sce->id.next) { if (sce->ed != NULL && sce->ed->seqbase.first != NULL) { do_versions_seq_unique_name_all_strips(sce, &sce->ed->seqbase); } } if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "texture_paint_mode_opacity")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1756,7 +1756,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "background_type")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1769,20 +1769,20 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_cubemap_draw_size")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->eevee.gi_irradiance_draw_size = 0.1f; scene->eevee.gi_cubemap_draw_size = 0.3f; } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { if (scene->toolsettings->gizmo_flag == 0) { scene->toolsettings->gizmo_flag = SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE; } } if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { RigidBodyWorld *rbw = scene->rigidbody_world; if (rbw == NULL) { @@ -1808,7 +1808,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SoftBody", "SoftBody_Shared", "*shared")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { SoftBody *sb = ob->soft; if (sb == NULL) { continue; @@ -1827,7 +1827,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "short", "type")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1844,13 +1844,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "View3DShading", "shading")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BKE_screen_view3d_shading_init(&scene->display.shading); } } /* initialize grease pencil view data */ if (!DNA_struct_elem_find(fd->filesdna, "SpaceView3D", "float", "vertex_opacity")) { - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1867,13 +1867,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 22)) { if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "annotate_v3d_align")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->toolsettings->annotate_v3d_align = GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR; scene->toolsettings->annotate_thickness = 3; } } if (!DNA_struct_elem_find(fd->filesdna, "bGPDlayer", "short", "line_change")) { - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { gpl->line_change = gpl->thickness; if ((gpl->thickness < 1) || (gpl->thickness > 10)) { @@ -1883,7 +1883,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_paper_opacity")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1895,7 +1895,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_grid_opacity")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -1909,7 +1909,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* default loc axis */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "int", "lock_axis")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* lock axis */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if (gset) { @@ -1920,7 +1920,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Versioning code for Subsurf modifier. */ if (!DNA_struct_elem_find(fd->filesdna, "SubsurfModifier", "short", "uv_smooth")) { - for (Object *object = bmain->object.first; object != NULL; object = object->id.next) { + for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) { for (ModifierData *md = object->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Subsurf) { SubsurfModifierData *smd = (SubsurfModifierData *)md; @@ -1936,7 +1936,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SubsurfModifier", "short", "quality")) { - for (Object *object = bmain->object.first; object != NULL; object = object->id.next) { + for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) { for (ModifierData *md = object->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Subsurf) { SubsurfModifierData *smd = (SubsurfModifierData *)md; @@ -1947,7 +1947,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Versioning code for Multires modifier. */ if (!DNA_struct_elem_find(fd->filesdna, "MultiresModifier", "short", "quality")) { - for (Object *object = bmain->object.first; object != NULL; object = object->id.next) { + for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) { for (ModifierData *md = object->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Multires) { MultiresModifierData *mmd = (MultiresModifierData *)md; @@ -1964,7 +1964,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "short", "bending_model")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { ClothModifierData *clmd = NULL; if (md->type == eModifierType_Cloth) { @@ -1993,7 +1993,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "float", "era_strength_f")) { - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->gpencil_settings != NULL) { BrushGpencilSettings *gp = brush->gpencil_settings; if (gp->brush_type == GPAINT_TOOL_ERASE) { @@ -2004,7 +2004,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Cloth) { ClothModifierData *clmd = (ClothModifierData *)md; @@ -2033,7 +2033,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 24)) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2054,7 +2054,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "ShrinkwrapModifierData", "char", "shrinkMode")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ModifierData *md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Shrinkwrap) { ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md; @@ -2068,7 +2068,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "PartDeflect", "float", "pdef_cfrict")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pd) { ob->pd->pdef_cfrict = 5.0f; } @@ -2084,7 +2084,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "xray_alpha_wire")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2095,7 +2095,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2109,7 +2109,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 25)) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { UnitSettings *unit = &scene->unit; if (unit->system != USER_UNIT_NONE) { unit->length_unit = bUnit_GetBaseUnitOfType(scene->unit.system, B_UNIT_LENGTH); @@ -2119,7 +2119,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* gpencil grid settings */ - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); // Color ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); // Scale gpd->grid.lines = GP_DEFAULT_GRID_LINES; // Number of lines @@ -2127,7 +2127,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 29)) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2142,7 +2142,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_PROPERTIES) { @@ -2168,7 +2168,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* grease pencil fade layer opacity */ if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_fade_layer")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2183,7 +2183,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 30)) { /* grease pencil main material show switches */ - for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) { + for (Material *mat = bmain->materials.first; mat; mat = mat->id.next) { if (mat->gp_style) { mat->gp_style->flag |= GP_STYLE_STROKE_SHOW; mat->gp_style->flag |= GP_STYLE_FILL_SHOW; @@ -2198,7 +2198,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARRAY_SET_ITEMS(curcolor_add, 1.0f, 0.6f, 0.6f); ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f); - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* sculpt brushes */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if (gset) { @@ -2215,12 +2215,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "overscan")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->eevee.overscan = 3.0f; } } - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { /* Removed Hemi lights. */ if (!ELEM(la->type, LA_LOCAL, LA_SUN, LA_SPOT, LA_AREA)) { la->type = LA_SUN; @@ -2228,25 +2228,25 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "light_threshold")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->eevee.light_threshold = 0.01f; } } if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_irradiance_smoothing")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->eevee.gi_irradiance_smoothing = 0.1f; } } if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_filter_quality")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->eevee.gi_filter_quality = 1.0f; } } if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "att_dist")) { - for (Light *la = bmain->light.first; la; la = la->id.next) { + for (Light *la = bmain->lights.first; la; la = la->id.next) { la->att_dist = la->clipend; } } @@ -2276,7 +2276,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) #define PAINT_BLEND_ALPHA_SUB 19 #define PAINT_BLEND_ALPHA_ADD 20 - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->ob_mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) { const char tool_init = brush->vertexpaint_tool; bool is_blend = false; @@ -2352,7 +2352,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 34)) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *slink = area->spacedata.first; slink; slink = slink->next) { if (slink->spacetype == SPACE_USERPREF) { @@ -2377,7 +2377,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 36)) { if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "curvature_ridge_factor")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2391,7 +2391,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Rename OpenGL to Workbench. */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { if (STREQ(scene->r.engine, "BLENDER_OPENGL")) { STRNCPY(scene->r.engine, RE_engine_id_BLENDER_WORKBENCH); } @@ -2399,7 +2399,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* init Annotations onion skin */ if (!DNA_struct_elem_find(fd->filesdna, "bGPDlayer", "int", "gstep")) { - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { ARRAY_SET_ITEMS(gpl->gcolor_prev, 0.302f, 0.851f, 0.302f); ARRAY_SET_ITEMS(gpl->gcolor_next, 0.250f, 0.1f, 1.0f); @@ -2409,7 +2409,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Move studio_light selection to lookdev_light. */ if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "lookdev_light[256]")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2423,7 +2423,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Change Solid mode shadow orientation. */ if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "float", "shadow_focus")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { float *dir = scene->display.light_direction; SWAP(float, dir[2], dir[1]); dir[2] = -dir[2]; @@ -2433,10 +2433,10 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 37)) { - for (Camera *ca = bmain->camera.first; ca; ca = ca->id.next) { + for (Camera *ca = bmain->cameras.first; ca; ca = ca->id.next) { ca->drawsize *= 2.0f; } - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->type != OB_EMPTY) { if (UNLIKELY(ob->transflag & OB_DUPLICOLLECTION)) { BKE_object_type_set_empty_for_versioning(ob); @@ -2446,7 +2446,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Grease pencil primitive curve */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_primitive")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if ((gset) && (gset->cur_primitive == NULL)) { gset->cur_primitive = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); @@ -2464,7 +2464,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 38)) { if (DNA_struct_elem_find(fd->filesdna, "Object", "char", "empty_image_visibility_flag")) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { ob->empty_image_visibility_flag ^= ( OB_EMPTY_IMAGE_HIDE_PERSPECTIVE | OB_EMPTY_IMAGE_HIDE_ORTHOGRAPHIC | @@ -2472,7 +2472,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { switch (sl->spacetype) { @@ -2562,7 +2562,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->r.mode &= ~( R_MODE_DEPRECATED_1 | R_MODE_DEPRECATED_2 | @@ -2615,7 +2615,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - for (World *world = bmain->world.first; world; world = world->id.next) { + for (World *world = bmain->worlds.first; world; world = world->id.next) { world->flag &= ~( WO_MODE_DEPRECATED_1 | WO_MODE_DEPRECATED_2 | @@ -2625,7 +2625,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) WO_MODE_DEPRECATED_7); } - for (Image *image = bmain->image.first; image; image = image->id.next) { + for (Image *image = bmain->images.first; image; image = image->id.next) { image->flag &= ~( IMA_FLAG_DEPRECATED_0 | IMA_FLAG_DEPRECATED_1 | @@ -2636,7 +2636,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) IMA_FLAG_DEPRECATED_16); } - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { ob->flag &= ~( OB_FLAG_DEPRECATED_11 | OB_FLAG_DEPRECATED_12); @@ -2646,7 +2646,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ob->shapeflag &= ~OB_SHAPE_FLAG_DEPRECATED_1; } - for (Mesh *me = bmain->mesh.first; me; me = me->id.next) { + for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { me->flag &= ~( ME_FLAG_DEPRECATED_0 | ME_FLAG_DEPRECATED_1 | @@ -2657,7 +2657,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ME_FLAG_DEPRECATED_8); } - for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) { + for (Material *mat = bmain->materials.first; mat; mat = mat->id.next) { mat->blend_flag &= ~( MA_BL_FLAG_DEPRECATED_2); } @@ -2665,13 +2665,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 40)) { if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "snap_transform_mode_flag")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { scene->toolsettings->snap_transform_mode_flag = SCE_SNAP_TRANSFORM_MODE_TRANSLATE; } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { switch (sl->spacetype) { @@ -2691,7 +2691,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_find(fd->filesdna, "TransformOrientationSlot")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { for (int i = 0; i < ARRAY_SIZE(scene->orientation_slots); i++) { scene->orientation_slots[i].index_custom = -1; } @@ -2700,7 +2700,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Grease pencil target weight */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "float", "weight")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* sculpt brushes */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if (gset) { @@ -2714,7 +2714,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Grease pencil cutter/select segment intersection threshold */ if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "float", "isect_threshold")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if (gset) { gset->isect_threshold = 0.1f; @@ -2723,13 +2723,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Fix anamorphic bokeh eevee rna limits.*/ - for (Camera *ca = bmain->camera.first; ca; ca = ca->id.next) { + for (Camera *ca = bmain->cameras.first; ca; ca = ca->id.next) { if (ca->gpu_dof.ratio < 0.01f) { ca->gpu_dof.ratio = 0.01f; } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_USERPREF) { @@ -2762,12 +2762,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 44)) { if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "a")) { - for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) { + for (Material *mat = bmain->materials.first; mat; mat = mat->id.next) { mat->a = 1.0f; } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { enum { R_ALPHAKEY = 2, }; @@ -2788,7 +2788,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 45)) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area; area = area->next) { for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SEQ) { @@ -2803,7 +2803,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 46)) { /* Add wireframe color. */ if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "wire_color_type")) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -2816,7 +2816,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find(fd->filesdna, "View3DCursor", "short", "rotation_mode")) { - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { if (is_zero_v3(scene->cursor.rotation_axis)) { scene->cursor.rotation_mode = ROT_MODE_XYZ; scene->cursor.rotation_quaternion[0] = 1.0f; @@ -2827,14 +2827,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 280, 47)) { - LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { ParticleEditSettings *pset = &scene->toolsettings->particle; if (pset->brushtype < 0) { pset->brushtype = PE_BRUSH_COMB; } } - LISTBASE_FOREACH (Object *, ob, &bmain->object) { + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { { enum { PARCURVE = 1, PARKEY = 2, PAR_DEPRECATED = 16}; if (ELEM(ob->partype, PARCURVE, PARKEY, PAR_DEPRECATED)) { @@ -2859,7 +2859,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ob->nlaflag &= ~(OB_ADS_DEPRECATED_1 | OB_ADS_DEPRECATED_2); } - LISTBASE_FOREACH (bArmature *, arm, &bmain->armature) { + LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) { arm->flag &= ~( ARM_FLAG_DEPRECATED_1 | ARM_FLAG_DEPRECATED_5 | @@ -2867,7 +2867,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARM_FLAG_DEPRECATED_12); } - LISTBASE_FOREACH (Text *, text, &bmain->text) { + LISTBASE_FOREACH (Text *, text, &bmain->texts) { enum { TXT_READONLY = 1 << 8, TXT_FOLLOW = 1 << 9}; text->flags &= ~(TXT_READONLY | TXT_FOLLOW); } diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 4a49dddfd2c..1f8bf3724db 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -140,7 +140,7 @@ static ID *rename_id_for_versioning(Main *bmain, const short id_type, const char void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) { /* For all startup.blend files. */ - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { /* Remove all stored panels, we want to use defaults (order, open/closed) as defined by UI code here! */ @@ -192,7 +192,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) { /* Default only has one window. */ wmWindow *win = ((wmWindowManager *)bmain->wm.first)->windows.first; - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { WorkSpaceLayout *layout = BKE_workspace_hook_layout_for_workspace_get(win->workspace_hook, workspace); bScreen *screen = layout->screen; BLI_strncpy(screen->id.name + 2, workspace->id.name + 2, sizeof(screen->id.name) - 2); @@ -202,7 +202,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) { /* 'UV Editing' should use UV mode. */ - bScreen *screen = BLI_findstring(&bmain->screen, "UV Editing", offsetof(ID, name) + 2); + bScreen *screen = BLI_findstring(&bmain->screens, "UV Editing", offsetof(ID, name) + 2); for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { @@ -218,7 +218,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) /* For 2D animation template. */ if (app_template && STREQ(app_template, "2D_Animation")) { - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { const char *name = workspace->id.name + 2; if (STREQ(name, "Drawing")) { @@ -226,7 +226,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } /* set object in drawing mode */ - for (Object *object = bmain->object.first; object; object = object->id.next) { + for (Object *object = bmain->objects.first; object; object = object->id.next) { if (object->type == OB_GPENCIL) { bGPdata *gpd = (bGPdata *)object->data; object->mode = OB_MODE_PAINT_GPENCIL; @@ -236,7 +236,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } /* Be sure curfalloff and primitive are initializated */ - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; if (ts->gp_sculpt.cur_falloff == NULL) { ts->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f); @@ -271,13 +271,13 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) if (builtin_template) { /* Clear all tools to use default options instead, ignore the tool saved in the file. */ - for (WorkSpace *workspace = bmain->workspace.first; workspace; workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { while (!BLI_listbase_is_empty(&workspace->tools)) { BKE_workspace_tool_remove(workspace, workspace->tools.first); } } - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { /* Hide channels in timelines. */ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { SpaceAction *saction = (sa->spacetype == SPACE_ACTION) ? sa->spacedata.first : NULL; @@ -292,7 +292,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); scene->r.cfra = 1.0f; @@ -330,13 +330,13 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) rename_id_for_versioning(bmain, ID_OB, "Light", "Light"); rename_id_for_versioning(bmain, ID_LA, "Light", "Light"); - for (Mesh *mesh = bmain->mesh.first; mesh; mesh = mesh->id.next) { + for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) { /* Match default for new meshes. */ mesh->smoothresh = DEG2RADF(30); } } - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { @@ -347,7 +347,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { copy_v3_v3(scene->display.light_direction, (float[3]){M_SQRT1_3, M_SQRT1_3, M_SQRT1_3}); copy_v2_fl2(scene->safe_areas.title, 0.1f, 0.05f); copy_v2_fl2(scene->safe_areas.action, 0.035f, 0.035f); diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 9f26ddf4ffd..5d7905b200e 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -479,7 +479,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile == 100) { /* tex->extend and tex->imageflag have changed: */ - Tex *tex = bmain->tex.first; + Tex *tex = bmain->textures.first; while (tex) { if (tex->id.tag & LIB_TAG_NEED_LINK) { @@ -500,7 +500,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 101) { /* frame mapping */ - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; while (sce) { sce->r.framapto = 100; sce->r.images = 100; @@ -511,7 +511,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 103) { /* new variable in object: colbits */ - Object *ob = bmain->object.first; + Object *ob = bmain->objects.first; int a; while (ob) { ob->colbits = 0; @@ -527,7 +527,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 104) { /* timeoffs moved */ - Object *ob = bmain->object.first; + Object *ob = bmain->objects.first; while (ob) { if (ob->transflag & 1) { ob->transflag -= 1; @@ -538,7 +538,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 106) { /* mcol changed */ - Mesh *me = bmain->mesh.first; + Mesh *me = bmain->meshes.first; while (me) { if (me->mcol) vcol_to_fcol(me); @@ -549,7 +549,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 107) { Object *ob; - ob = bmain->object.first; + ob = bmain->objects.first; while (ob) { if (ob->dt == 0) ob->dt = OB_SOLID; @@ -560,7 +560,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 109) { /* new variable: gridlines */ - bScreen *sc = bmain->screen.first; + bScreen *sc = bmain->screens.first; while (sc) { ScrArea *sa = sc->areabase.first; while (sa) { @@ -581,7 +581,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 134) { - Tex *tex = bmain->tex.first; + Tex *tex = bmain->textures.first; while (tex) { if ((tex->rfac == 0.0f) && (tex->gfac == 0.0f) && @@ -598,7 +598,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 140) { /* r-g-b-fac in texture */ - Tex *tex = bmain->tex.first; + Tex *tex = bmain->textures.first; while (tex) { if ((tex->rfac == 0.0f) && (tex->gfac == 0.0f) && @@ -614,7 +614,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 153) { - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; while (sce) { if (sce->r.blurfac == 0.0f) sce->r.blurfac = 1.0f; @@ -623,7 +623,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 163) { - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; while (sce) { if (sce->r.frs_sec == 0) sce->r.frs_sec = 25; @@ -632,7 +632,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 164) { - Mesh *me = bmain->mesh.first; + Mesh *me = bmain->meshes.first; while (me) { me->smoothresh = 30; me = me->id.next; @@ -640,7 +640,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 165) { - Mesh *me = bmain->mesh.first; + Mesh *me = bmain->meshes.first; TFace *tface; int nr; char *cp; @@ -667,7 +667,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 169) { - Mesh *me = bmain->mesh.first; + Mesh *me = bmain->meshes.first; while (me) { if (me->subdiv == 0) me->subdiv = 1; @@ -676,7 +676,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 169) { - bScreen *sc = bmain->screen.first; + bScreen *sc = bmain->screens.first; while (sc) { ScrArea *sa = sc->areabase.first; while (sa) { @@ -695,7 +695,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 170) { - Object *ob = bmain->object.first; + Object *ob = bmain->objects.first; PartEff *paf; while (ob) { paf = blo_do_version_give_parteff_245(ob); @@ -709,7 +709,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 171) { - bScreen *sc = bmain->screen.first; + bScreen *sc = bmain->screens.first; while (sc) { ScrArea *sa = sc->areabase.first; while (sa) { @@ -729,7 +729,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 173) { int a, b; - Mesh *me = bmain->mesh.first; + Mesh *me = bmain->meshes.first; while (me) { if (me->tface) { TFace *tface = me->tface; @@ -747,7 +747,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 204) { bSound *sound; - sound = bmain->sound.first; + sound = bmain->sounds.first; while (sound) { if (sound->volume < 0.01f) { sound->volume = 1.0f; @@ -760,7 +760,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bSound *sound; Mesh *me; - sound = bmain->sound.first; + sound = bmain->sounds.first; while (sound) { sound->max_gain = 1.0; sound->min_gain = 0.0; @@ -779,7 +779,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) * it a subsurf, and reset the subdiv level because subsurf * takes a lot more work to calculate. */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { enum { ME_SMESH = (1 << 6), ME_SUBSURF = (1 << 7), @@ -806,7 +806,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) * old file vertex colors are undefined, reset them * to be fully opaque. -zr */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { if (me->mcol) { int i; @@ -833,7 +833,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 223) { VFont *vf; - for (vf = bmain->vfont.first; vf; vf = vf->id.next) { + for (vf = bmain->fonts.first; vf; vf = vf->id.next) { if (STREQ(vf->name + strlen(vf->name) - 6, ".Bfont")) { strcpy(vf->name, FO_BUILTIN_NAME); } @@ -846,7 +846,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Mesh *me; bScreen *sc; - for (sound = bmain->sound.first; sound; sound = sound->id.next) { + for (sound = bmain->sounds.first; sound; sound = sound->id.next) { if (sound->packedfile) { if (sound->newpackedfile == NULL) { sound->newpackedfile = sound->packedfile; @@ -855,19 +855,19 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } /* Make sure that old subsurf meshes don't have zero subdivision level for rendering */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { enum { ME_SUBSURF = (1 << 7) }; if ((me->flag & ME_SUBSURF) && (me->subdivr == 0)) { me->subdivr = me->subdiv; } } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->r.stereomode = 1; // no stereo } /* some oldfile patch, moved from set_func_space */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -891,7 +891,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* As of now, this insures that the transition from the old Track system * to the new full constraint Track is painless for everyone. - theeth */ - ob = bmain->object.first; + ob = bmain->objects.first; while (ob) { ListBase *list; @@ -934,13 +934,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) ob = ob->id.next; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->audio.mixrate = 48000; sce->audio.flag |= AUDIO_SCRUB; } /* patch for old wrong max view2d settings, allows zooming out more */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -967,7 +967,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* As of now, this insures that the transition from the old Track system * to the new full constraint Track is painless for everyone. */ - ob = bmain->object.first; + ob = bmain->objects.first; while (ob) { ListBase *list; @@ -1007,7 +1007,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } /* convert old mainb values for new button panels */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -1077,7 +1077,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bScreen *sc; /* new variable blockscale, for panels in any area */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -1095,7 +1095,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 231) { - bScreen *sc = bmain->screen.first; + bScreen *sc = bmain->screens.first; /* new bit flags for showing/hiding grid floor and axes */ @@ -1123,8 +1123,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 232) { - Tex *tex = bmain->tex.first; - World *wrld = bmain->world.first; + Tex *tex = bmain->textures.first; + World *wrld = bmain->worlds.first; bScreen *sc; while (tex) { @@ -1161,7 +1161,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* new variable blockscale, for panels in any area, do again because new * areas didnt initialize it to 0.7 yet */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1179,7 +1179,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 233) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1196,7 +1196,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 234) { bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; @@ -1212,8 +1212,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 235) { - Tex *tex = bmain->tex.first; - Scene *sce = bmain->scene.first; + Tex *tex = bmain->textures.first; + Scene *sce = bmain->scenes.first; Sequence *seq; Editing *ed; @@ -1238,7 +1238,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 236) { Object *ob; - Camera *cam = bmain->camera.first; + Camera *cam = bmain->cameras.first; while (cam) { if (cam->ortho_scale == 0.0f) { @@ -1252,7 +1252,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* set time line var */ /* softbody init new vars */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->soft) { if (ob->soft->defgoal == 0.0f) ob->soft->defgoal = 0.7f; @@ -1282,13 +1282,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Bone *bone; /* armature recode checks */ - for (arm = bmain->armature.first; arm; arm = arm->id.next) { + for (arm = bmain->armatures.first; arm; arm = arm->id.next) { BKE_armature_where_is(arm); for (bone = arm->bonebase.first; bone; bone = bone->next) do_version_bone_head_tail_237(bone); } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->parent) { Object *parent = blo_do_versions_newlibadr(fd, lib, ob->parent); if (parent && parent->type == OB_LATTICE) @@ -1362,7 +1362,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bArmature *arm; Mesh *me; Key *key; - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; while (sce) { if (sce->toolsettings == NULL) { @@ -1372,7 +1372,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) sce = sce->id.next; } - for (lt = bmain->lattice.first; lt; lt = lt->id.next) { + for (lt = bmain->lattices.first; lt; lt = lt->id.next) { if (lt->fu == 0.0f && lt->fv == 0.0f && lt->fw == 0.0f) { calc_lat_fudu(lt->flag, lt->pntsu, <->fu, <->du); calc_lat_fudu(lt->flag, lt->pntsv, <->fv, <->dv); @@ -1380,7 +1380,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; PartEff *paf; @@ -1447,12 +1447,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (arm = bmain->armature.first; arm; arm = arm->id.next) { + for (arm = bmain->armatures.first; arm; arm = arm->id.next) { bone_version_238(&arm->bonebase); arm->deformflag |= ARM_DEF_VGROUP; } - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { if (!me->medge) { BKE_mesh_calc_edges_legacy(me, true); /* true = use mface->edcode */ } @@ -1461,7 +1461,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (key = bmain->key.first; key; key = key->id.next) { + for (key = bmain->shapekeys.first; key; key = key->id.next) { KeyBlock *kb; int index = 1; @@ -1483,12 +1483,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile <= 239) { bArmature *arm; Object *ob; - Scene *sce = bmain->scene.first; - Camera *cam = bmain->camera.first; + Scene *sce = bmain->scenes.first; + Camera *cam = bmain->cameras.first; int set_passepartout = 0; /* deformflag is local in modifier now */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { @@ -1504,7 +1504,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } /* updating stepsize for ghost drawing */ - for (arm = bmain->armature.first; arm; arm = arm->id.next) { + for (arm = bmain->armatures.first; arm; arm = arm->id.next) { bone_version_239(&arm->bonebase); if (arm->layer == 0) arm->layer = 1; @@ -1539,12 +1539,12 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bNodeTree *ntree; /* updating layers still */ - for (arm = bmain->armature.first; arm; arm = arm->id.next) { + for (arm = bmain->armatures.first; arm; arm = arm->id.next) { bone_version_239(&arm->bonebase); if (arm->layer == 0) arm->layer = 1; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->audio.mixrate == 0) sce->audio.mixrate = 48000; @@ -1571,15 +1571,15 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) ntree_version_241(ntree); - for (la = bmain->light.first; la; la = la->id.next) + for (la = bmain->lights.first; la; la = la->id.next) if (la->buffers == 0) la->buffers = 1; /* for empty drawsize and drawtype */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->empty_drawsize == 0.0f) { ob->empty_drawtype = OB_ARROWS; ob->empty_drawsize = 1.0; @@ -1589,7 +1589,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* during 2.41 images with this name were used for viewer node output, lets fix that */ if (bmain->versionfile == 241) { Image *ima; - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (STREQ(ima->name, "Compositor")) { strcpy(ima->id.name + 2, "Viewer Node"); strcpy(ima->name, "Viewer Node"); @@ -1612,7 +1612,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bNodeTree *ntree; int a; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; sa = sc->areabase.first; while (sa) { @@ -1629,7 +1629,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { enum { R_THREADS = (1 << 19), }; @@ -1645,11 +1645,11 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) ntree_version_242(sce->nodetree); } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) ntree_version_242(ntree); /* add default radius values to old curve points */ - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { for (nu = cu->nurb.first; nu; nu = nu->next) { if (nu) { if (nu->bezt) { @@ -1668,7 +1668,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; ListBase *list; list = &ob->constraints; @@ -1756,15 +1756,15 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } - for (ma = bmain->mat.first; ma; ma = ma->id.next) { + for (ma = bmain->materials.first; ma; ma = ma->id.next) { if (ma->nodetree) ntree_version_242(ma->nodetree); } - for (me = bmain->mesh.first; me; me = me->id.next) + for (me = bmain->meshes.first; me; me = me->id.next) customdata_version_242(me); - for (collection = bmain->collection.first; collection; collection = collection->id.next) + for (collection = bmain->collections.first; collection; collection = collection->id.next) if (collection->layer == 0) collection->layer = (1 << 20) - 1; @@ -1774,7 +1774,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Tex *tex; /* Image refactor initialize */ - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { ima->source = IMA_SRC_FILE; ima->type = IMA_TYPE_IMAGE; @@ -1791,7 +1791,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { enum { TEX_ANIMCYCLIC = (1 << 6), TEX_ANIM5 = (1 << 7), @@ -1808,19 +1808,19 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) tex->iuser.sfra = tex->sfra; tex->iuser.cycl = (tex->imaflag & TEX_ANIMCYCLIC) != 0; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) do_version_ntree_242_2(sce->nodetree); } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) do_version_ntree_242_2(ntree); - for (ma = bmain->mat.first; ma; ma = ma->id.next) + for (ma = bmain->materials.first; ma; ma = ma->id.next) if (ma->nodetree) do_version_ntree_242_2(ma->nodetree); } if (bmain->subversionfile < 4) { - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->r.bake_mode = 1; /* prevent to include render stuff here */ sce->r.bake_filter = 16; sce->r.bake_flag = R_BAKE_CLEAR; @@ -1829,7 +1829,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile <= 243) { - Object *ob = bmain->object.first; + Object *ob = bmain->objects.first; for (; ob; ob = ob->id.next) { bDeformGroup *curdef; @@ -1870,7 +1870,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* render layer added, this is not the active layer */ if (bmain->versionfile <= 243 || bmain->subversionfile < 2) { Mesh *me; - for (me = bmain->mesh.first; me; me = me->id.next) + for (me = bmain->meshes.first; me; me = me->id.next) customdata_version_243(me); } @@ -1881,7 +1881,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile != 244 || bmain->subversionfile < 2) { /* correct older action editors - incorrect scrolling */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; sa = sc->areabase.first; while (sa) { @@ -1921,7 +1921,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) && ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0)) ) { - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ListBase *list; list = &ob->constraints; @@ -1991,13 +1991,13 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile != 245) { /* repair preview from 242 - 244*/ - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { ima->preview = NULL; } } /* add point caches */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->soft && !ob->soft->pointcache) ob->soft->pointcache = BKE_ptcache_add(&ob->soft->ptcaches); @@ -2025,7 +2025,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* Copy over old per-level multires vertex data * into a single vertex array in struct Multires */ - for (me = bmain->mesh.first; me; me = me->id.next) { + for (me = bmain->meshes.first; me; me = me->id.next) { if (me->mr && !me->mr->verts) { MultiresLevel *lvl = me->mr->levels.last; if (lvl) { @@ -2041,7 +2041,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile != 245 || bmain->subversionfile < 1) { - for (la = bmain->light.first; la; la = la->id.next) { + for (la = bmain->lights.first; la; la = la->id.next) { la->falloff_type = LA_FALLOFF_INVLINEAR; if (la->curfalloff == NULL) { @@ -2051,18 +2051,18 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (ma = bmain->mat.first; ma; ma = ma->id.next) { + for (ma = bmain->materials.first; ma; ma = ma->id.next) { if (ma->gloss_mir == 0.0f) { ma->gloss_mir = 1.0f; } } - for (part = bmain->particle.first; part; part = part->id.next) { + for (part = bmain->particles.first; part; part = part->id.next) { if (part->ren_child_nbr == 0) part->ren_child_nbr = part->child_nbr; } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) ntree_version_245(fd, lib, sce->nodetree); @@ -2072,18 +2072,18 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) + for (ntree = bmain->nodetrees.first; ntree; ntree = ntree->id.next) ntree_version_245(fd, lib, ntree); /* fix for temporary flag changes during 245 cycle */ - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (ima->flag & IMA_OLD_PREMUL) { ima->flag &= ~IMA_OLD_PREMUL; ima->alpha_mode = IMA_ALPHA_STRAIGHT; } } - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->iuser.flag & IMA_OLD_PREMUL) { tex->iuser.flag &= ~IMA_OLD_PREMUL; } @@ -2100,7 +2100,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Image *ima; /* initialize 1:1 Aspect */ - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { ima->aspx = ima->aspy = 1.0f; } } @@ -2110,10 +2110,10 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) ModifierData *md; Object *ob; - for (arm = bmain->armature.first; arm; arm = arm->id.next) + for (arm = bmain->armatures.first; arm; arm = arm->id.next) arm->deformflag |= ARM_DEF_B_BONE_REST; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Armature) ((ArmatureModifierData *)md)->deformflag |= ARM_DEF_B_BONE_REST; @@ -2124,7 +2124,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 5)) { /* foreground color needs to be something other then black */ Scene *sce; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f; sce->r.fg_stamp[3] = 1.0f; /* don't use text alpha yet */ sce->r.bg_stamp[3] = 0.25f; /* make sure the background has full alpha */ @@ -2135,7 +2135,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 6)) { Scene *sce; /* fix frs_sec_base */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->r.frs_sec_base == 0) { sce->r.frs_sec_base = 1; } @@ -2146,7 +2146,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Object *ob; bPoseChannel *pchan; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pose) { for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { do_version_constraints_245(&pchan->constraints); @@ -2176,7 +2176,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Object *ob; PartEff *paf = NULL; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->soft && ob->soft->keys) { SoftBody *sb = ob->soft; int k; @@ -2283,7 +2283,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* dupliobjects */ if (ob->transflag & OB_DUPLIVERTS) { - Object *dup = bmain->object.first; + Object *dup = bmain->objects.first; for (; dup; dup = dup->id.next) { if (ob == blo_do_versions_newlibadr(fd, lib, dup->parent)) { @@ -2311,7 +2311,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { ParticleEditSettings *pset = &sce->toolsettings->particle; int a; @@ -2336,7 +2336,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Object *ob; /* dupliface scale */ - for (ob = bmain->object.first; ob; ob = ob->id.next) + for (ob = bmain->objects.first; ob; ob = ob->id.next) ob->instance_faces_scale = 1.0f; } @@ -2345,7 +2345,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bActionStrip *strip; /* nla-strips - scale */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { for (strip = ob->nlastrips.first; strip; strip = strip->next) { float length, actlength, repeat; @@ -2374,7 +2374,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Scene *sce; Sequence *seq; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { SEQ_BEGIN (sce->ed, seq) { if (seq->blend_mode == 0) @@ -2385,38 +2385,38 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* fix broken group lengths in id properties */ if ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile < 15)) { - idproperties_fix_group_lengths(bmain->scene); - idproperties_fix_group_lengths(bmain->library); - idproperties_fix_group_lengths(bmain->object); - idproperties_fix_group_lengths(bmain->mesh); - idproperties_fix_group_lengths(bmain->curve); - idproperties_fix_group_lengths(bmain->mball); - idproperties_fix_group_lengths(bmain->mat); - idproperties_fix_group_lengths(bmain->tex); - idproperties_fix_group_lengths(bmain->image); - idproperties_fix_group_lengths(bmain->lattice); - idproperties_fix_group_lengths(bmain->light); - idproperties_fix_group_lengths(bmain->camera); + idproperties_fix_group_lengths(bmain->scenes); + idproperties_fix_group_lengths(bmain->libraries); + idproperties_fix_group_lengths(bmain->objects); + idproperties_fix_group_lengths(bmain->meshes); + idproperties_fix_group_lengths(bmain->curves); + idproperties_fix_group_lengths(bmain->metaballs); + idproperties_fix_group_lengths(bmain->materials); + idproperties_fix_group_lengths(bmain->textures); + idproperties_fix_group_lengths(bmain->images); + idproperties_fix_group_lengths(bmain->lattices); + idproperties_fix_group_lengths(bmain->lights); + idproperties_fix_group_lengths(bmain->cameras); idproperties_fix_group_lengths(bmain->ipo); - idproperties_fix_group_lengths(bmain->key); - idproperties_fix_group_lengths(bmain->world); - idproperties_fix_group_lengths(bmain->screen); - idproperties_fix_group_lengths(bmain->vfont); - idproperties_fix_group_lengths(bmain->text); - idproperties_fix_group_lengths(bmain->sound); - idproperties_fix_group_lengths(bmain->collection); - idproperties_fix_group_lengths(bmain->armature); - idproperties_fix_group_lengths(bmain->action); - idproperties_fix_group_lengths(bmain->nodetree); - idproperties_fix_group_lengths(bmain->brush); - idproperties_fix_group_lengths(bmain->particle); + idproperties_fix_group_lengths(bmain->shapekeys); + idproperties_fix_group_lengths(bmain->worlds); + idproperties_fix_group_lengths(bmain->screens); + idproperties_fix_group_lengths(bmain->fonts); + idproperties_fix_group_lengths(bmain->texts); + idproperties_fix_group_lengths(bmain->sounds); + idproperties_fix_group_lengths(bmain->collections); + idproperties_fix_group_lengths(bmain->armatures); + idproperties_fix_group_lengths(bmain->actions); + idproperties_fix_group_lengths(bmain->nodetrees); + idproperties_fix_group_lengths(bmain->brushes); + idproperties_fix_group_lengths(bmain->particles); } /* convert fluids to modifier */ if (bmain->versionfile < 246 || (bmain->versionfile == 246 && bmain->subversionfile < 1)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->fluidsimSettings) { FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifier_new(eModifierType_Fluidsim); BLI_addhead(&ob->modifiers, (ModifierData *)fluidmd); @@ -2435,7 +2435,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) if (bmain->versionfile < 246 || (bmain->versionfile == 246 && bmain->subversionfile < 1)) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pd && (ob->pd->forcefield == PFIELD_WIND)) ob->pd->f_noise = 0.0f; } @@ -2446,7 +2446,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Curve *cu; Nurb *nu; - for (cu = bmain->curve.first; cu; cu = cu->id.next) { + for (cu = bmain->curves.first; cu; cu = cu->id.next) { for (nu = cu->nurb.first; nu; nu = nu->next) { if (nu) { nu->radius_interp = 3; @@ -2468,7 +2468,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) Scene *sce; /* Note, these will need to be added for painting */ - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { sce->toolsettings->imapaint.seam_bleed = 2; sce->toolsettings->imapaint.normal_angle = 80; } @@ -2478,7 +2478,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) bScreen *sc; /* adjust default settings for Animation Editors */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { @@ -2515,7 +2515,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* correct introduce of seed for wind force */ if (bmain->versionfile < 249 && bmain->subversionfile < 1) { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->pd) ob->pd->seed = ((uint)(ceil(PIL_check_seconds_timer())) + 1) % 128; } @@ -2523,7 +2523,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } if (bmain->versionfile < 249 && bmain->subversionfile < 2) { - Scene *sce = bmain->scene.first; + Scene *sce = bmain->scenes.first; Sequence *seq; Editing *ed; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 4226b111d16..c2cd6f282e8 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1206,7 +1206,7 @@ static void write_renderinfo(WriteData *wd, Main *mainvar) /* XXX in future, handle multiple windows with multiple screens? */ current_screen_compat(mainvar, false, &curscreen, &curscene, &view_layer); - for (sce = mainvar->scene.first; sce; sce = sce->id.next) { + for (sce = mainvar->scenes.first; sce; sce = sce->id.next) { if (sce->id.lib == NULL && (sce == curscene || (sce->r.scemode & R_BG_RENDER))) { data.sfra = sce->r.sfra; data.efra = sce->r.efra; diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index c5557eb91c2..8254b8a2202 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -708,7 +708,7 @@ void BM_mesh_bm_to_me( ModifierData *md; BMVert **vertMap = NULL; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if ((ob->parent) && (ob->parent->data == me) && ELEM(ob->partype, PARVERT1, PARVERT3)) { if (vertMap == NULL) { diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index faf00cf11d8..79ad79f6735 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -190,7 +190,7 @@ std::vector<bAction *> bc_getSceneActions(const bContext *C, Object *ob, bool al Main *bmain = CTX_data_main(C); ID *id; - for (id = (ID *)bmain->action.first; id; id = (ID *)(id->next)) { + for (id = (ID *)bmain->actions.first; id; id = (ID *)(id->next)) { bAction *act = (bAction *)id; /* XXX This currently creates too many actions. TODO Need to check if the action is compatible to the given object diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc index 4e5f18198ba..36a9d53d670 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc @@ -132,15 +132,15 @@ void DepsgraphNodeBuilder::build_view_layer( build_compositor(scene); } /* Cache file. */ - LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefile) { + LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) { build_cachefile(cachefile); } /* Masks. */ - LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { + LISTBASE_FOREACH (Mask *, mask, &bmain_->masks) { build_mask(mask); } /* Movie clips. */ - LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclips) { build_movieclip(clip); } /* Material override. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc index 8d5f74337b6..622bb4a8a02 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc @@ -111,11 +111,11 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la build_compositor(scene); } /* Masks. */ - LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { + LISTBASE_FOREACH (Mask *, mask, &bmain_->masks) { build_mask(mask); } /* Movie clips. */ - LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclips) { build_movieclip(clip); } /* Material override. */ diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index ffd0f9da31a..3cec2b45ea4 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -330,7 +330,7 @@ void DEG_graph_relations_update(Depsgraph *graph, void DEG_relations_tag_update(Main *bmain) { DEG_GLOBAL_DEBUG_PRINTF(TAG, "%s: Tagging relations for update.\n", __func__); - LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 031ae7bb697..493247e252f 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -572,7 +572,7 @@ NodeType geometry_tag_to_component(const ID *id) void id_tag_update(Main *bmain, ID *id, int flag, eUpdateSource update_source) { graph_id_tag_update(bmain, NULL, id, flag, update_source); - LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, @@ -701,7 +701,7 @@ void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type) void DEG_id_type_tag(Main *bmain, short id_type) { - LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, @@ -731,7 +731,7 @@ void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph) void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time)) { - LISTBASE_FOREACH (Scene *, scene, &bmain->scene) { + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 5a0deaddb35..af2037ef376 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1761,7 +1761,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, ListBase *anim_data, voi /* Grab all Grease Pencil datablocks directly from main, * but only those that seem to be useful somewhere */ - for (gpd = ac->bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (gpd = ac->bmain->gpencils.first; gpd; gpd = gpd->id.next) { /* only show if gpd is used by something... */ if (ID_REAL_USERS(gpd) < 1) continue; @@ -1884,7 +1884,7 @@ static size_t animdata_filter_mask(Main *bmain, ListBase *anim_data, void *UNUSE /* for now, grab mask datablocks directly from main */ // XXX: this is not good... - for (mask = bmain->mask.first; mask; mask = mask->id.next) { + for (mask = bmain->masks.first; mask; mask = mask->id.next) { ListBase tmp_data = {NULL, NULL}; size_t tmp_items = 0; @@ -2841,7 +2841,7 @@ static size_t animdata_filter_dopesheet_movieclips(bAnimContext *ac, ListBase *a { size_t items = 0; MovieClip *clip; - for (clip = ac->bmain->movieclip.first; clip != NULL; clip = clip->id.next) { + for (clip = ac->bmain->movieclips.first; clip != NULL; clip = clip->id.next) { /* only show if gpd is used by something... */ if (ID_REAL_USERS(clip) < 1) { continue; @@ -2981,7 +2981,7 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, b /* Cache files level animations (frame duration and such). */ if (!(ads->filterflag2 & ADS_FILTER_NOCACHEFILES) && !(ads->filterflag & ADS_FILTER_ONLYSEL)) { - CacheFile *cache_file = ac->bmain->cachefile.first; + CacheFile *cache_file = ac->bmain->cachefiles.first; for (; cache_file; cache_file = cache_file->id.next) { items += animdata_filter_ds_cachefile(ac, anim_data, ads, cache_file, filter_mode); } diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 81f555630eb..7a9bb1df477 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1499,7 +1499,7 @@ static void MARKER_OT_rename(wmOperatorType *ot) static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op) { ListBase *markers = ED_context_get_markers(C); - Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); + Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scenes, RNA_enum_get(op->ptr, "scene")); TimeMarker *marker, *marker_new; if (scene_to == NULL) { diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index aac7559774f..444e4634644 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -607,7 +607,7 @@ void ANIM_keyingset_info_unregister(Main *bmain, KeyingSetInfo *ksi) BKE_keyingset_free(ks); BLI_remlink(&builtin_keyingsets, ks); - for (scene = bmain->scene.first; scene; scene = scene->id.next) + for (scene = bmain->scenes.first; scene; scene = scene->id.next) BLI_remlink_safe(&scene->keyingsets, ks); MEM_freeN(ks); diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index c14973d793b..6d4babe9674 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -177,7 +177,7 @@ void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, DEG_id_tag_update(&arm->id, ID_RECALC_COPY_ON_WRITE); /* do entire dbase - objects */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ModifierData *md; /* we have the object using the armature */ @@ -207,7 +207,7 @@ void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, } /* Update any object constraints to use the new bone name */ - for (cob = bmain->object.first; cob; cob = cob->id.next) { + for (cob = bmain->objects.first; cob; cob = cob->id.next) { if (cob->constraints.first) constraint_bone_name_fix(ob, &cob->constraints, oldname, newname); if (cob->pose) { @@ -320,7 +320,7 @@ void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, /* correct view locking */ { bScreen *screen; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { ScrArea *sa; /* add regions */ for (sa = screen->areabase.first; sa; sa = sa->next) { diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index a6e4632ef9d..5928e1cd12c 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -205,7 +205,7 @@ static void joined_armature_fix_links(Main *bmain, Object *tarArm, Object *srcAr bPoseChannel *pchant; /* let's go through all objects in database */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* do some object-type specific things */ if (ob->type == OB_ARMATURE) { pose = ob->pose; @@ -417,7 +417,7 @@ static void separated_armature_fix_links(Main *bmain, Object *origArm, Object *n npchans = &newArm->pose->chanbase; /* let's go through all objects in database */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* do some object-type specific things */ if (ob->type == OB_ARMATURE) { for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index f310092942b..6b09912064e 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -730,7 +730,7 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm) armature_finalize_restpose(&arm->bonebase, arm->edbo); /* so all users of this armature should get rebuilt */ - for (obt = bmain->object.first; obt; obt = obt->id.next) { + for (obt = bmain->objects.first; obt; obt = obt->id.next) { if (obt->data == arm) { BKE_pose_rebuild(bmain, obt, arm, true); } diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 0a78669d743..3c21919a7ac 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -74,7 +74,7 @@ static void applyarmature_fix_boneparents(const bContext *C, Scene *scene, Objec Object workob, *ob; /* go through all objects in database */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { /* if parent is bone in this armature, apply corrections */ if ((ob->parent == armob) && (ob->partype == PARBONE)) { /* apply current transform from parent (not yet destroyed), @@ -471,8 +471,8 @@ static int pose_copy_exec(bContext *C, wmOperator *op) Object ob_copy = *ob; bArmature arm_copy = *((bArmature *)ob->data); ob_copy.data = &arm_copy; - BLI_addtail(&temp_bmain->object, &ob_copy); - BLI_addtail(&temp_bmain->armature, &arm_copy); + BLI_addtail(&temp_bmain->objects, &ob_copy); + BLI_addtail(&temp_bmain->armatures, &arm_copy); /* begin copy buffer on a temp bmain. */ BKE_copybuffer_begin(temp_bmain); /* Store the whole object to the copy buffer because pose can't be @@ -485,8 +485,8 @@ static int pose_copy_exec(bContext *C, wmOperator *op) * This is required because objects in temp bmain shares same pointers * as the real ones. */ - BLI_listbase_clear(&temp_bmain->object); - BLI_listbase_clear(&temp_bmain->armature); + BLI_listbase_clear(&temp_bmain->objects); + BLI_listbase_clear(&temp_bmain->armatures); BKE_main_free(temp_bmain); /* We are all done! */ BKE_report(op->reports, RPT_INFO, "Copied pose to buffer"); @@ -536,13 +536,13 @@ static int pose_paste_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } /* Make sure data from this file is usable for pose paste. */ - if (BLI_listbase_count_at_most(&tmp_bmain->object, 2) != 1) { + if (BLI_listbase_count_at_most(&tmp_bmain->objects, 2) != 1) { BKE_report(op->reports, RPT_ERROR, "Copy buffer is not from pose mode"); BKE_main_free(tmp_bmain); return OPERATOR_CANCELLED; } - Object *object_from = tmp_bmain->object.first; + Object *object_from = tmp_bmain->objects.first; bPose *pose_from = object_from->pose; if (pose_from == NULL) { BKE_report(op->reports, RPT_ERROR, "Copy buffer has no pose"); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index a1595839980..fe3ac8fc947 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1132,7 +1132,7 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit) return; } - for (object = bmain->object.first; object; object = object->id.next) { + for (object = bmain->objects.first; object; object = object->id.next) { ModifierData *md; int index; if ((object->parent) && diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index e1e1d6a2814..088282c0f02 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -992,7 +992,7 @@ static GHash *gp_strokes_copypastebuf_colors_material_to_name_create(Main *bmain { GHash *ma_to_name = BLI_ghash_ptr_new(__func__); - for (Material *ma = bmain->mat.first; ma != NULL; ma = ma->id.next) { + for (Material *ma = bmain->materials.first; ma != NULL; ma = ma->id.next) { char *name = BKE_id_to_unique_string_key(&ma->id); BLI_ghash_insert(ma_to_name, ma, name); } @@ -1009,7 +1009,7 @@ static GHash *gp_strokes_copypastebuf_colors_name_to_material_create(Main *bmain { GHash *name_to_ma = BLI_ghash_str_new(__func__); - for (Material *ma = bmain->mat.first; ma != NULL; ma = ma->id.next) { + for (Material *ma = bmain->materials.first; ma != NULL; ma = ma->id.next) { char *name = BKE_id_to_unique_string_key(&ma->id); BLI_ghash_insert(name_to_ma, name, ma); } diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index e26acb76a51..680568a96c5 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -1124,9 +1124,9 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op) /* delete temp image */ if (tgpf->ima) { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { if (ima == tgpf->ima) { - BLI_remlink(&bmain->image, ima); + BLI_remlink(&bmain->images, ima); BKE_image_free(tgpf->ima); MEM_SAFE_FREE(tgpf->ima); break; diff --git a/source/blender/editors/gpencil/gpencil_old.c b/source/blender/editors/gpencil/gpencil_old.c index 6f3a9bba4e2..b1924b3cacd 100644 --- a/source/blender/editors/gpencil/gpencil_old.c +++ b/source/blender/editors/gpencil/gpencil_old.c @@ -165,7 +165,7 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *UNUSED(op)) #if 0 /* GPXX */ /* Handle object-linked grease pencil datablocks */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->gpd) { if (ob->type == OB_GPENCIL) { /* GP Object - remap the links */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 817d10d4b2f..6cd76fb71ed 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1731,7 +1731,7 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts) Brush *brush_dft = NULL; Paint *paint = &ts->gp_paint->paint; Brush *brush_old = paint->brush; - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if ((brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { @@ -1773,7 +1773,7 @@ static void gp_set_default_eraser(Main *bmain, Brush *brush_dft) return; } - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if ((brush->gpencil_settings) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { if (brush == brush_dft) { brush->gpencil_settings->flag |= GP_BRUSH_DEFAULT_ERASER; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 5544e0c5c4c..5f703808d53 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1969,7 +1969,7 @@ void ED_gpencil_update_color_uv(Main *bmain, Material *mat) { Material *gps_ma = NULL; /* read all strokes */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->type == OB_GPENCIL) { bGPdata *gpd = ob->data; if (gpd == NULL) { diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 615259077b5..d39fe514f99 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1133,7 +1133,7 @@ static int editsource_text_edit( /* Developers may wish to copy-paste to an external editor. */ printf("%s:%d\n", filepath, line); - for (text = bmain->text.first; text; text = text->id.next) { + for (text = bmain->texts.first; text; text = text->id.next) { if (text->name && BLI_path_cmp(text->name, filepath) == 0) { break; } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1d79832f88f..987a2e56948 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -4614,7 +4614,7 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) else { Scene *scene; /* another scene can be rendering too, for example via compositor */ - for (scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) { + for (scene = CTX_data_main(C)->scenes.first; scene; scene = scene->id.next) { if (WM_jobs_test(wm, scene, WM_JOB_TYPE_RENDER)) { handle_event = B_STOPRENDER; icon = ICON_SCENE; diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 99b0b856d70..ed6ab38e5ab 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -355,7 +355,7 @@ void EDBM_mesh_load(Main *bmain, Object *ob) * cycles. */ #if 0 - for (Object *other_object = bmain->object.first; + for (Object *other_object = bmain->objects.first; other_object != NULL; other_object = other_object->id.next) { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index d131534b5ca..4a27e05815f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1201,7 +1201,7 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) } } else - collection = BLI_findlink(&CTX_data_main(C)->collection, RNA_enum_get(op->ptr, "collection")); + collection = BLI_findlink(&CTX_data_main(C)->collections, RNA_enum_get(op->ptr, "collection")); if (!ED_object_add_generic_get_opts(C, op, 'Z', loc, rot, NULL, &local_view_bits, NULL)) { return OPERATOR_CANCELLED; @@ -1381,7 +1381,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) /* remove from Grease Pencil parent */ /* XXX This is likely not correct? Will also remove parent from grease pencil from other scenes, * even when use_global is false... */ - for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { if (gpl->parent != NULL) { if (gpl->parent == ob) { @@ -1397,7 +1397,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) if (use_global) { Scene *scene_iter; - for (scene_iter = bmain->scene.first; scene_iter; scene_iter = scene_iter->id.next) { + for (scene_iter = bmain->scenes.first; scene_iter; scene_iter = scene_iter->id.next) { if (scene_iter != scene && !ID_IS_LINKED(scene_iter)) { if (is_indirectly_used && ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0) { BKE_reportf(op->reports, RPT_WARNING, @@ -1420,7 +1420,7 @@ static int object_delete_exec(bContext *C, wmOperator *op) } /* delete has to handle all open scenes */ - BKE_main_id_tag_listbase(&bmain->scene, LIB_TAG_DOIT, true); + BKE_main_id_tag_listbase(&bmain->scenes, LIB_TAG_DOIT, true); for (win = wm->windows.first; win; win = win->next) { scene = WM_window_get_active_scene(win); @@ -1687,7 +1687,7 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, } if (base->object->transflag & OB_DUPLICOLLECTION && base->object->instance_collection) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->proxy_group == base->object) { ob->proxy = NULL; ob->proxy_from = NULL; @@ -2021,7 +2021,7 @@ static int convert_exec(bContext *C, wmOperator *op) if (!keep_original) { /* other users */ if (cu->id.us > 1) { - for (ob1 = bmain->object.first; ob1; ob1 = ob1->id.next) { + for (ob1 = bmain->objects.first; ob1; ob1 = ob1->id.next) { if (ob1->data == ob->data) { ob1->type = OB_CURVE; DEG_id_tag_update(&ob1->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); @@ -2241,7 +2241,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer // XXX: is 2) really a good measure here? if (ob->rigidbody_object || ob->rigidbody_constraint) { Collection *collection; - for (collection = bmain->collection.first; collection; collection = collection->id.next) { + for (collection = bmain->collections.first; collection; collection = collection->id.next) { if (BKE_collection_has_object(collection, ob)) BKE_collection_object_add(bmain, collection, obn); } diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index 1dda976c8a8..08bf08d0b62 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -547,7 +547,7 @@ static bool bake_objects_check(Main *bmain, ViewLayer *view_layer, Object *ob, L static void bake_images_clear(Main *bmain, const bool is_tangent) { Image *image; - for (image = bmain->image.first; image; image = image->id.next) { + for (image = bmain->images.first; image; image = image->id.next) { if ((image->id.tag & LIB_TAG_DOIT) != 0) { RE_bake_ibuf_clear(image, is_tangent); } @@ -764,7 +764,7 @@ static int bake( } if (is_cage && custom_cage[0] != '\0') { - ob_cage = BLI_findstring(&bmain->object, custom_cage, offsetof(ID, name) + 2); + ob_cage = BLI_findstring(&bmain->objects, custom_cage, offsetof(ID, name) + 2); if (ob_cage == NULL || ob_cage->type != OB_MESH) { BKE_report(reports, RPT_ERROR, "No valid cage object"); diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 61a450205be..4aad3c14a62 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -132,7 +132,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; /* now add all selected objects to the collection(s) */ - for (collection = bmain->collection.first; collection; collection = collection->id.next) { + for (collection = bmain->collections.first; collection; collection = collection->id.next) { if (single_collection && collection != single_collection) continue; if (!BKE_collection_has_object(collection, ob)) @@ -207,7 +207,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) /* linking to same collection requires its own loop so we can avoid * looking up the active objects collections each time */ - for (collection = bmain->collection.first; collection; collection = collection->id.next) { + for (collection = bmain->collections.first; collection; collection = collection->id.next) { if (single_collection && collection != single_collection) continue; @@ -299,7 +299,7 @@ static int collection_objects_remove_exec(bContext *C, wmOperator *op) if (ob == NULL) return OPERATOR_CANCELLED; - for (collection = bmain->collection.first; collection; collection = collection->id.next) { + for (collection = bmain->collections.first; collection; collection = collection->id.next) { if (single_collection && collection != single_collection) continue; if (!BKE_collection_has_object(collection, ob)) @@ -429,7 +429,7 @@ static int collection_link_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); Object *ob = ED_object_context(C); - Collection *collection = BLI_findlink(&bmain->collection, RNA_enum_get(op->ptr, "collection")); + Collection *collection = BLI_findlink(&bmain->collections, RNA_enum_get(op->ptr, "collection")); if (ELEM(NULL, ob, collection)) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 0e7e0d5b8ec..f095edc2d60 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -154,7 +154,7 @@ static void validate_pyconstraint_cb(Main *bmain, void *arg1, void *arg2) /* exception for no script */ if (index) { /* innovative use of a for...loop to search */ - for (text = bmain->text.first, i = 1; text && index != i; i++, text = text->id.next) ; + for (text = bmain->texts.first, i = 1; text && index != i; i++, text = text->id.next) ; } data->text = text; } @@ -177,7 +177,7 @@ static char *buildmenu_pyconstraints(Main *bmain, Text *con_text, int *pyconinde *pyconindex = 0; /* loop through markers, adding them */ - for (text = bmain->text.first, i = 1; text; i++, text = text->id.next) { + for (text = bmain->texts.first, i = 1; text; i++, text = text->id.next) { /* this is important to ensure that right script is shown as active */ if (text == con_text) *pyconindex = i; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index cd8eeba73d4..9048b786044 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -375,7 +375,7 @@ static bool mesh_needs_keyindex(Main *bmain, const Mesh *me) return false; /* will be added */ } - for (const Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (const Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if ((ob->parent) && (ob->parent->data == me) && ELEM(ob->partype, PARVERT1, PARVERT3)) { return true; } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 6ea6617191f..a55163b01d1 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -233,7 +233,7 @@ bool ED_object_iter_other( Object *ob; int totfound = include_orig ? 0 : 1; - for (ob = bmain->object.first; ob && totfound < users; + for (ob = bmain->objects.first; ob && totfound < users; ob = ob->id.next) { if (((ob != orig_ob) || include_orig) && diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 22b7e49093e..dbd90628136 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1299,7 +1299,7 @@ static void link_to_scene(Main *UNUSED(bmain), unsigned short UNUSED(nr)) static int make_links_scene_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - Scene *scene_to = BLI_findlink(&bmain->scene, RNA_enum_get(op->ptr, "scene")); + Scene *scene_to = BLI_findlink(&bmain->scenes, RNA_enum_get(op->ptr, "scene")); if (scene_to == NULL) { BKE_report(op->reports, RPT_ERROR, "Could not find scene"); @@ -1633,7 +1633,7 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in #if 0 if (copy_collections) { Collection *collection, *collectionn; - for (collection = bmain->collection.first; collection; collection = collection->id.next) { + for (collection = bmain->collections.first; collection; collection = collection->id.next) { bool all_duplicated = true; bool any_duplicated = false; @@ -1791,7 +1791,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer } FOREACH_OBJECT_FLAG_END; - me = bmain->mesh.first; + me = bmain->meshes.first; while (me) { ID_NEW_REMAP(me->texcomesh); me = me->id.next; @@ -1850,23 +1850,23 @@ static void single_mat_users_expand(Main *bmain) MetaBall *mb; bGPdata *gpd; - for (ob = bmain->object.first; ob; ob = ob->id.next) + for (ob = bmain->objects.first; ob; ob = ob->id.next) if (ob->id.tag & LIB_TAG_NEW) new_id_matar(bmain, ob->mat, ob->totcol); - for (me = bmain->mesh.first; me; me = me->id.next) + for (me = bmain->meshes.first; me; me = me->id.next) if (me->id.tag & LIB_TAG_NEW) new_id_matar(bmain, me->mat, me->totcol); - for (cu = bmain->curve.first; cu; cu = cu->id.next) + for (cu = bmain->curves.first; cu; cu = cu->id.next) if (cu->id.tag & LIB_TAG_NEW) new_id_matar(bmain, cu->mat, cu->totcol); - for (mb = bmain->mball.first; mb; mb = mb->id.next) + for (mb = bmain->metaballs.first; mb; mb = mb->id.next) if (mb->id.tag & LIB_TAG_NEW) new_id_matar(bmain, mb->mat, mb->totcol); - for (gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) + for (gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) if (gpd->id.tag & LIB_TAG_NEW) new_id_matar(bmain, gpd->mat, gpd->totcol); } @@ -1970,7 +1970,7 @@ static void tag_localizable_objects(bContext *C, const int mode) /* Also forbid making objects local if other library objects are using * them for modifiers or constraints. */ - for (Object *object = bmain->object.first; object; object = object->id.next) { + for (Object *object = bmain->objects.first; object; object = object->id.next) { if ((object->id.tag & LIB_TAG_DOIT) == 0) { BKE_library_foreach_ID_link(NULL, &object->id, tag_localizable_looper, NULL, IDWALK_READONLY); } @@ -1994,7 +1994,7 @@ static bool make_local_all__instance_indirect_unused(Main *bmain, ViewLayer *vie Object *ob; bool changed = false; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ID_IS_LINKED(ob) && (ob->id.us == 0)) { Base *base; @@ -2323,7 +2323,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op) /* Cleanup. */ BKE_main_id_clear_newpoins(bmain); - BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, false); } /* Else, poll func ensures us that ID_IS_LINKED(obact) is true. */ else if (obact->type == OB_ARMATURE) { @@ -2331,7 +2331,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op) obact->id.tag |= LIB_TAG_DOIT; - for (Object *ob = bmain->object.first; ob != NULL; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob != NULL; ob = ob->id.next) { make_override_static_tag_object(obact, ob); } @@ -2342,7 +2342,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op) /* Cleanup. */ BKE_main_id_clear_newpoins(bmain); - BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, false); } /* TODO: probably more cases where we want to do automated smart things in the future! */ else { diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 96dc18b41f0..dd68c8d0357 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -788,7 +788,7 @@ static bool select_grouped_collection(bContext *C, Object *ob) uiPopupMenu *pup; uiLayout *layout; - for (collection = CTX_data_main(C)->collection.first; collection && collection_count < COLLECTION_MENU_MAX; collection = collection->id.next) { + for (collection = CTX_data_main(C)->collections.first; collection && collection_count < COLLECTION_MENU_MAX; collection = collection->id.next) { if (BKE_collection_has_object(collection, ob)) { ob_collections[collection_count] = collection; collection_count++; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 534889ffa45..f7a49f3fcb7 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -408,7 +408,7 @@ static void ignore_parent_tx(const bContext *C, Main *bmain, Scene *scene, Objec Depsgraph *depsgraph = CTX_data_depsgraph(C); /* a change was made, adjust the children to compensate */ - for (ob_child = bmain->object.first; ob_child; ob_child = ob_child->id.next) { + for (ob_child = bmain->objects.first; ob_child; ob_child = ob_child->id.next) { if (ob_child->parent == ob) { BKE_object_apply_mat4(ob_child, ob_child->obmat, true, false); BKE_object_workob_calc_parent(depsgraph, scene, ob_child, &workob); @@ -901,7 +901,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) BLI_listbase_rotate_first(&ctx_data_list, (LinkData *)ctx_ob_act); } - for (tob = bmain->object.first; tob; tob = tob->id.next) { + for (tob = bmain->objects.first; tob; tob = tob->id.next) { if (tob->data) ((ID *)tob->data)->tag &= ~LIB_TAG_DOIT; if (tob->instance_collection) @@ -1221,7 +1221,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) } BLI_freelistN(&ctx_data_list); - for (tob = bmain->object.first; tob; tob = tob->id.next) { + for (tob = bmain->objects.first; tob; tob = tob->id.next) { if (tob->data && (((ID *)tob->data)->tag & LIB_TAG_DOIT)) { BKE_object_batch_cache_dirty_tag(tob); DEG_id_tag_update(&tob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 216d9713b6a..b5546bd7b90 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -261,7 +261,7 @@ static void screen_render_single_layer_set(wmOperator *op, Main *mainp, ViewLaye char scene_name[MAX_ID_NAME - 2]; RNA_string_get(op->ptr, "scene", scene_name); - scn = (Scene *)BLI_findstring(&mainp->scene, scene_name, offsetof(ID, name) + 2); + scn = (Scene *)BLI_findstring(&mainp->scenes, scene_name, offsetof(ID, name) + 2); if (scn) { /* camera switch wont have updated */ @@ -817,7 +817,7 @@ static void clean_viewport_memory(Main *bmain, Scene *scene) Base *base; /* Tag all the available objects. */ - BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, true); + BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, true); /* Go over all the visible objects. */ for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) { diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 5ea63901085..9599a7bdbee 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -249,7 +249,7 @@ static Scene *preview_get_scene(Main *pr_main) { if (pr_main == NULL) return NULL; - return pr_main->scene.first; + return pr_main->scenes.first; } static const char *preview_collection_name(const char pr_type) @@ -307,7 +307,7 @@ static World *preview_get_localized_world(ShaderPreview *sp, World *world) return sp->worldcopy; } sp->worldcopy = BKE_world_localize(world); - BLI_addtail(&sp->pr_main->world, sp->worldcopy); + BLI_addtail(&sp->pr_main->worlds, sp->worldcopy); return sp->worldcopy; } @@ -359,7 +359,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty /* this flag tells render to not execute depsgraph or ipos etc */ sce->r.scemode |= R_BUTS_PREVIEW; /* set world always back, is used now */ - sce->world = pr_main->world.first; + sce->world = pr_main->worlds.first; /* now: exposure copy */ if (scene->world) { sce->world->exp = scene->world->exp; @@ -407,7 +407,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty BLI_assert(sp->id_copy != NULL); mat = sp->matcopy = (Material *)sp->id_copy; sp->id_copy = NULL; - BLI_addtail(&pr_main->mat, mat); + BLI_addtail(&pr_main->materials, mat); /* use current scene world to light sphere */ if (mat->pr_type == MA_SPHERE_A && sp->pr_method == PR_BUTS_RENDER) { @@ -467,7 +467,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty BLI_assert(sp->id_copy != NULL); tex = sp->texcopy = (Tex *)sp->id_copy; sp->id_copy = NULL; - BLI_addtail(&pr_main->tex, tex); + BLI_addtail(&pr_main->textures, tex); } set_preview_collection(sce, view_layer, MA_TEXTURE); @@ -486,7 +486,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty BLI_assert(sp->id_copy != NULL); la = sp->lampcopy = (Light *)sp->id_copy; sp->id_copy = NULL; - BLI_addtail(&pr_main->light, la); + BLI_addtail(&pr_main->lights, la); } set_preview_collection(sce, view_layer, MA_LAMP); @@ -520,7 +520,7 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty BLI_assert(sp->id_copy != NULL); wrld = sp->worldcopy = (World *)sp->id_copy; sp->id_copy = NULL; - BLI_addtail(&pr_main->world, wrld); + BLI_addtail(&pr_main->worlds, wrld); } set_preview_collection(sce, view_layer, MA_SKY); @@ -900,19 +900,19 @@ static void shader_preview_free(void *customdata) if (sp->matcopy) { sp->id_copy = (ID *)sp->matcopy; - BLI_remlink(&pr_main->mat, sp->matcopy); + BLI_remlink(&pr_main->materials, sp->matcopy); } if (sp->texcopy) { sp->id_copy = (ID *)sp->texcopy; - BLI_remlink(&pr_main->tex, sp->texcopy); + BLI_remlink(&pr_main->textures, sp->texcopy); } if (sp->worldcopy) { sp->id_copy = (ID *)sp->worldcopy; - BLI_remlink(&pr_main->world, sp->worldcopy); + BLI_remlink(&pr_main->worlds, sp->worldcopy); } if (sp->lampcopy) { sp->id_copy = (ID *)sp->lampcopy; - BLI_remlink(&pr_main->light, sp->lampcopy); + BLI_remlink(&pr_main->lights, sp->lampcopy); } if (sp->id_copy) { /* node previews */ diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index 462fd997fc5..d99c9847ed6 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -176,7 +176,7 @@ void ED_render_engine_area_exit(Main *bmain, ScrArea *sa) void ED_render_engine_changed(Main *bmain) { /* on changing the render engine type, clear all running render engines */ - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { ED_render_engine_area_exit(bmain, sa); } @@ -185,7 +185,7 @@ void ED_render_engine_changed(Main *bmain) /* Inform all render engines and draw managers. */ DEGEditorUpdateContext update_ctx = {NULL}; update_ctx.bmain = bmain; - for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { update_ctx.scene = scene; LISTBASE_FOREACH(ViewLayer *, view_layer, &scene->view_layers) { /* TDODO(sergey): Iterate over depsgraphs instead? */ @@ -225,7 +225,7 @@ static void texture_changed(Main *bmain, Tex *tex) /* icons */ BKE_icon_changed(BKE_icon_id_ensure(&tex->id)); - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { /* paint overlays */ for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { BKE_paint_invalidate_overlay_tex(scene, view_layer, tex); @@ -254,7 +254,7 @@ static void image_changed(Main *bmain, Image *ima) BKE_icon_changed(BKE_icon_id_ensure(&ima->id)); /* textures */ - for (tex = bmain->tex.first; tex; tex = tex->id.next) + for (tex = bmain->textures.first; tex; tex = tex->id.next) if (tex->ima == ima) texture_changed(bmain, tex); } @@ -264,7 +264,7 @@ static void scene_changed(Main *bmain, Scene *scene) Object *ob; /* glsl */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->mode & OB_MODE_TEXTURE_PAINT) { BKE_texpaint_slots_refresh_object(scene, ob); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 8983438f0a3..3ad5ba5722a 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -147,7 +147,7 @@ static void view_layer_remove_unset_nodetrees(const Main *bmain, Scene *scene, V { int act_layer_index = BLI_findindex(&scene->view_layers, layer); - for (Scene *sce = bmain->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) { BKE_nodetree_remove_layer_n(sce->nodetree, scene, act_layer_index); } diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 8bf1ca1a6c8..7556a44da1a 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -470,7 +470,7 @@ void ED_screens_initialize(Main *bmain, wmWindowManager *wm) for (win = wm->windows.first; win; win = win->next) { if (BKE_workspace_active_get(win->workspace_hook) == NULL) { - BKE_workspace_active_set(win->workspace_hook, bmain->workspace.first); + BKE_workspace_active_set(win->workspace_hook, bmain->workspaces.first); } ED_screen_refresh(wm, win); @@ -480,7 +480,7 @@ void ED_screens_initialize(Main *bmain, wmWindowManager *wm) } if (U.uiflag & USER_HEADER_FROM_PREF) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { BKE_screen_header_alignment_reset(screen); } } @@ -862,7 +862,7 @@ void ED_screen_global_areas_refresh(wmWindow *win) static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmain, bScreen *screen) { - for (bScreen *screen_iter = bmain->screen.first; screen_iter; screen_iter = screen_iter->id.next) { + for (bScreen *screen_iter = bmain->screens.first; screen_iter; screen_iter = screen_iter->id.next) { ScrArea *sa = screen_iter->areabase.first; if (sa && sa->full == screen) { return screen_iter; @@ -879,7 +879,7 @@ static bScreen *screen_fullscreen_find_associated_normal_screen(const Main *bmai bScreen *screen_change_prepare(bScreen *screen_old, bScreen *screen_new, Main *bmain, bContext *C, wmWindow *win) { /* validate screen, it's called with notifier reference */ - if (BLI_findindex(&bmain->screen, screen_new) == -1) { + if (BLI_findindex(&bmain->screens, screen_new) == -1) { return NULL; } @@ -1405,7 +1405,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) bScreen *sc; scene->camera = camera; /* are there cameras in the views that are not in the scene? */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { BKE_screen_view3d_scene_sync(sc, scene); } DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE); @@ -1424,7 +1424,7 @@ void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph) /* update animated texture nodes */ { Tex *tex; - for (tex = bmain->tex.first; tex; tex = tex->id.next) { + for (tex = bmain->textures.first; tex; tex = tex->id.next) { if (tex->use_nodes && tex->nodetree) { ntreeTexTagAnimated(tex->nodetree); } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 83004da0ce9..15e8d5a3eb4 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3353,7 +3353,7 @@ static int spacedata_cleanup_exec(bContext *C, wmOperator *op) ScrArea *sa; int tot = 0; - for (screen = bmain->screen.first; screen; screen = screen->id.next) { + for (screen = bmain->screens.first; screen; screen = screen->id.next) { for (sa = screen->areabase.first; sa; sa = sa->next) { if (sa->spacedata.first != sa->spacedata.last) { SpaceLink *sl = sa->spacedata.first; @@ -4913,7 +4913,7 @@ static int space_workspace_cycle_invoke(bContext *C, wmOperator *op, const wmEve WorkSpace *workspace_dst = NULL; ListBase ordered; - BKE_id_ordered_list(&ordered, &bmain->workspace); + BKE_id_ordered_list(&ordered, &bmain->workspaces); for (LinkData *link = ordered.first; link; link = link->next) { if (link->data == workspace_src) { diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 9f63bdff7c1..b442f718aa1 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -223,7 +223,7 @@ bool ED_workspace_delete( { ID *workspace_id = (ID *)workspace; - if (BLI_listbase_is_single(&bmain->workspace)) { + if (BLI_listbase_is_single(&bmain->workspaces)) { return false; } @@ -355,11 +355,11 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "filepath", filepath); if (workspace_append(C, filepath, idname) != OPERATOR_CANCELLED) { - WorkSpace *appended_workspace = BLI_findstring(&bmain->workspace, idname, offsetof(ID, name) + 2); + WorkSpace *appended_workspace = BLI_findstring(&bmain->workspaces, idname, offsetof(ID, name) + 2); BLI_assert(appended_workspace != NULL); /* Reorder to last position. */ - BKE_id_reorder(&bmain->workspace, &appended_workspace->id, NULL, true); + BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); /* Changing workspace changes context. Do delayed! */ WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); @@ -454,7 +454,7 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) if (startup_config) { for (WorkSpace *workspace = startup_config->workspaces.first; workspace; workspace = workspace->id.next) { uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspace, workspace->id.name, offsetof(ID, name))) { + if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { uiLayoutSetActive(row, false); } @@ -479,7 +479,7 @@ static void workspace_add_menu(bContext *C, uiLayout *layout, void *template_v) } uiLayout *row = uiLayoutRow(layout, false); - if (BLI_findstring(&bmain->workspace, workspace->id.name, offsetof(ID, name))) { + if (BLI_findstring(&bmain->workspaces, workspace->id.name, offsetof(ID, name))) { uiLayoutSetActive(row, false); } @@ -542,7 +542,7 @@ static int workspace_reorder_to_back_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); - BKE_id_reorder(&bmain->workspace, &workspace->id, NULL, true); + BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, true); WM_event_add_notifier(C, NC_WINDOW, NULL); return OPERATOR_INTERFACE; @@ -565,7 +565,7 @@ static int workspace_reorder_to_front_exec(bContext *C, wmOperator *UNUSED(op)) Main *bmain = CTX_data_main(C); WorkSpace *workspace = workspace_context_get(C); - BKE_id_reorder(&bmain->workspace, &workspace->id, NULL, false); + BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, false); WM_event_add_notifier(C, NC_WINDOW, NULL); return OPERATOR_INTERFACE; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 510f9827736..4749d2a3308 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1112,7 +1112,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) } if (ima) { - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl; diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index e26d9b1ef9d..f8a2259d4a5 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5704,7 +5704,7 @@ void paint_proj_stroke_done(void *ps_handle_p) /* use project paint to re-apply an image */ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) { - Image *image = BLI_findlink(&CTX_data_main(C)->image, RNA_enum_get(op->ptr, "image")); + Image *image = BLI_findlink(&CTX_data_main(C)->images, RNA_enum_get(op->ptr, "image")); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); ProjPaintState ps = {NULL}; diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 03f69750aca..12e98bc5d33 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -348,7 +348,7 @@ static Brush *brush_tool_cycle(Main *bmain, Paint *paint, Brush *brush_orig, con { Brush *brush, *first_brush; - if (!brush_orig && !(brush_orig = bmain->brush.first)) { + if (!brush_orig && !(brush_orig = bmain->brushes.first)) { return NULL; } @@ -362,7 +362,7 @@ static Brush *brush_tool_cycle(Main *bmain, Paint *paint, Brush *brush_orig, con /* Try to tool-slot first. */ first_brush = BKE_paint_toolslots_brush_get(paint, tool); if (first_brush == NULL) { - first_brush = bmain->brush.first; + first_brush = bmain->brushes.first; } } else { @@ -370,7 +370,7 @@ static Brush *brush_tool_cycle(Main *bmain, Paint *paint, Brush *brush_orig, con * currently active brush do a cycling via all possible * brushes with requested tool. */ - first_brush = brush_orig->id.next ? brush_orig->id.next : bmain->brush.first; + first_brush = brush_orig->id.next ? brush_orig->id.next : bmain->brushes.first; } /* get the next brush with the active tool */ @@ -382,7 +382,7 @@ static Brush *brush_tool_cycle(Main *bmain, Paint *paint, Brush *brush_orig, con return brush; } - brush = brush->id.next ? brush->id.next : bmain->brush.first; + brush = brush->id.next ? brush->id.next : bmain->brushes.first; } while (brush != first_brush); return NULL; diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 1d3726c6f79..8c6970eba77 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -753,7 +753,7 @@ static int sound_unpack_exec(bContext *C, wmOperator *op) if (RNA_struct_property_is_set(op->ptr, "id")) { char sndname[MAX_ID_NAME - 2]; RNA_string_get(op->ptr, "id", sndname); - sound = BLI_findstring(&bmain->sound, sndname, offsetof(ID, name) + 2); + sound = BLI_findstring(&bmain->sounds, sndname, offsetof(ID, name) + 2); } if (!sound || !sound->packedfile) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index fa06465ecc7..064a4d2ce11 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2796,7 +2796,7 @@ static int image_unpack_exec(bContext *C, wmOperator *op) if (RNA_struct_property_is_set(op->ptr, "id")) { char imaname[MAX_ID_NAME - 2]; RNA_string_get(op->ptr, "id", imaname); - ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2); + ima = BLI_findstring(&CTX_data_main(C)->images, imaname, offsetof(ID, name) + 2); if (!ima) ima = CTX_data_edit_image(C); } diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 21139418c3d..538c41f730a 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -166,7 +166,7 @@ static int pack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev ImBuf *ibuf; // first check for dirty images - for (ima = bmain->image.first; ima; ima = ima->id.next) { + for (ima = bmain->images.first; ima; ima = ima->id.next) { if (BKE_image_has_loaded_ibuf(ima)) { /* XXX FIX */ ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 739a180d1d8..a92a2ec66ca 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -602,7 +602,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op) cfra = (float)CFRA; /* get action to use */ - act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); + act = BLI_findlink(&CTX_data_main(C)->actions, RNA_enum_get(op->ptr, "action")); if (act == NULL) { BKE_report(op->reports, RPT_ERROR, "No valid action to add"); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 66f0e17db0f..b1cada9752a 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -641,11 +641,11 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) Material *ma; World *wo; - for (ma = bmain->mat.first; ma; ma = ma->id.next) + for (ma = bmain->materials.first; ma; ma = ma->id.next) if (ma->nodetree && ma->use_nodes && ntreeHasTree(ma->nodetree, ntree)) GPU_material_free(&ma->gpumaterial); - for (wo = bmain->world.first; wo; wo = wo->id.next) + for (wo = bmain->worlds.first; wo; wo = wo->id.next) if (wo->nodetree && wo->use_nodes && ntreeHasTree(wo->nodetree, ntree)) GPU_material_free(&wo->gpumaterial); @@ -1266,7 +1266,7 @@ static int node_read_viewlayers_exec(bContext *C, wmOperator *UNUSED(op)) ED_preview_kill_jobs(CTX_wm_manager(C), bmain); /* first tag scenes unread */ - for (scene = bmain->scene.first; scene; scene = scene->id.next) + for (scene = bmain->scenes.first; scene; scene = scene->id.next) scene->id.tag |= LIB_TAG_DOIT; for (node = snode->edittree->nodes.first; node; node = node->next) { diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index 87e6a7b82a8..e0fce2a5367 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -129,7 +129,7 @@ static bool node_group_has_output(Main *bmain, bNode *node) if (ntree == NULL) { return false; } - BKE_main_id_tag_listbase(&bmain->nodetree, LIB_TAG_DOIT, false); + BKE_main_id_tag_listbase(&bmain->nodetrees, LIB_TAG_DOIT, false); return node_group_has_output_dfs(node); } diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 206b32582e5..aef36b49814 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -301,7 +301,7 @@ static void ui_node_link_items(NodeLinkArg *arg, int in_out, NodeLinkItem **r_it bNodeTree *ngroup; int i; - for (ngroup = arg->bmain->nodetree.first; ngroup; ngroup = ngroup->id.next) { + for (ngroup = arg->bmain->nodetrees.first; ngroup; ngroup = ngroup->id.next) { ListBase *lb = ((in_out == SOCK_IN) ? &ngroup->inputs : &ngroup->outputs); totitems += BLI_listbase_count(lb); } @@ -310,7 +310,7 @@ static void ui_node_link_items(NodeLinkArg *arg, int in_out, NodeLinkItem **r_it items = MEM_callocN(sizeof(NodeLinkItem) * totitems, "ui node link items"); i = 0; - for (ngroup = arg->bmain->nodetree.first; ngroup; ngroup = ngroup->id.next) { + for (ngroup = arg->bmain->nodetrees.first; ngroup; ngroup = ngroup->id.next) { ListBase *lb = (in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs); bNodeSocket *stemp; int index; diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 7403525c293..7377faa09ac 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -284,7 +284,7 @@ static int collection_delete_exec(bContext *C, wmOperator *op) Collection *collection = BLI_gsetIterator_getKey(&collections_to_edit_iter); /* Test in case collection got deleted as part of another one. */ - if (BLI_findindex(&bmain->collection, collection) != -1) { + if (BLI_findindex(&bmain->collections, collection) != -1) { BKE_collection_delete(bmain, collection, hierarchy); } } diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 4b67c835e7f..24ca497ed5d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -1531,7 +1531,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op) set_operation_types(soops, &soops->tree, &scenelevel, &objectlevel, &idlevel, &datalevel); /* get action to use */ - act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); + act = BLI_findlink(&CTX_data_main(C)->actions, RNA_enum_get(op->ptr, "action")); if (act == NULL) { BKE_report(op->reports, RPT_ERROR, "No valid action to add"); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index f98913c34ed..a0202b1810f 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1964,7 +1964,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa tselem->flag &= ~TSE_CLOSED; } - for (lib = mainvar->library.first; lib; lib = lib->id.next) { + for (lib = mainvar->libraries.first; lib; lib = lib->id.next) { ten = outliner_add_library_contents(mainvar, soops, &soops->tree, lib); if (ten) { lib->id.newid = (ID *)ten; @@ -1999,13 +1999,13 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa } } /* restore newid pointers */ - for (lib = mainvar->library.first; lib; lib = lib->id.next) + for (lib = mainvar->libraries.first; lib; lib = lib->id.next) lib->id.newid = NULL; } else if (soops->outlinevis == SO_SCENES) { Scene *sce; - for (sce = mainvar->scene.first; sce; sce = sce->id.next) { + for (sce = mainvar->scenes.first; sce; sce = sce->id.next) { te = outliner_add_element(soops, &soops->tree, sce, NULL, 0, 0); tselem = TREESTORE(te); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index ba4ff6e82d7..b408369dc04 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -301,7 +301,7 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op) start_frame = RNA_int_get(op->ptr, "frame_start"); channel = RNA_int_get(op->ptr, "channel"); - sce_seq = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); + sce_seq = BLI_findlink(&CTX_data_main(C)->scenes, RNA_enum_get(op->ptr, "scene")); if (sce_seq == NULL) { BKE_report(op->reports, RPT_ERROR, "Scene not found"); @@ -389,7 +389,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op) start_frame = RNA_int_get(op->ptr, "frame_start"); channel = RNA_int_get(op->ptr, "channel"); - clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip")); + clip = BLI_findlink(&CTX_data_main(C)->movieclips, RNA_enum_get(op->ptr, "clip")); if (clip == NULL) { BKE_report(op->reports, RPT_ERROR, "Movie clip not found"); @@ -474,7 +474,7 @@ static int sequencer_add_mask_strip_exec(bContext *C, wmOperator *op) start_frame = RNA_int_get(op->ptr, "frame_start"); channel = RNA_int_get(op->ptr, "channel"); - mask = BLI_findlink(&CTX_data_main(C)->mask, RNA_enum_get(op->ptr, "mask")); + mask = BLI_findlink(&CTX_data_main(C)->masks, RNA_enum_get(op->ptr, "mask")); if (mask == NULL) { BKE_report(op->reports, RPT_ERROR, "Mask not found"); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 563aacafc50..2bf1dff63c1 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -665,7 +665,7 @@ static int text_refresh_pyconstraints_exec(bContext *UNUSED(C), wmOperator *UNUS short update; /* check all pyconstraints */ - for (ob = CTX_data_main(C)->object.first; ob; ob = ob->id.next) { + for (ob = CTX_data_main(C)->objects.first; ob; ob = ob->id.next) { update = 0; if (ob->type == OB_ARMATURE && ob->pose) { bPoseChannel *pchan; @@ -3041,7 +3041,7 @@ static int text_find_and_replace(bContext *C, wmOperator *op, short mode) if (text->id.next) text = st->text = text->id.next; else - text = st->text = bmain->text.first; + text = st->text = bmain->texts.first; txt_move_toline(text, 0, 0); text_update_cursor_moved(C); WM_event_add_notifier(C, NC_TEXT | ND_CURSOR, text); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index d712a9582d5..e551f1ea130 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -75,7 +75,7 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - for (Collection *collection = bmain->collection.first; collection; collection = collection->id.next) { + for (Collection *collection = bmain->collections.first; collection; collection = collection->id.next) { for (CollectionObject *cob = collection->gobject.first; cob; cob = cob->next) { Object *object = cob->ob; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index d4b94963795..2108fc1ac07 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -391,7 +391,7 @@ static int snap_selected_to_location(bContext *C, const float snap_target_global CTX_data_selected_editable_objects(C, &ctx_data_list); /* reset flags */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { ob->flag &= ~OB_DONE; } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 292dd6bee1a..b6defa1ad62 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -573,7 +573,7 @@ void VIEW3D_OT_camera_to_view_selected(wmOperatorType *ot) static void sync_viewport_camera_smoothview(bContext *C, View3D *v3d, Object *ob, const int smooth_viewtx) { Main *bmain = CTX_data_main(C); - for (bScreen *screen = bmain->screen.first; screen != NULL; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen != NULL; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area != NULL; area = area->next) { for (SpaceLink *space_link = area->spacedata.first; space_link != NULL; space_link = space_link->next) { if (space_link->spacetype == SPACE_VIEW3D) { @@ -1121,7 +1121,7 @@ static uint free_localbit(Main *bmain) /* sometimes we loose a localview: when an area is closed */ /* check all areas: which localviews are in use? */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *sl = sa->spacedata.first; for (; sl; sl = sl->next) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fdc9993d105..e79f510d308 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -6696,7 +6696,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) // XXX: BAD! this get gpencil datablocks directly from main db... // but that's how this currently works :/ - for (gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) { + for (gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) { if (ID_REAL_USERS(gpd)) posttrans_gpd_clean(gpd); } @@ -6716,7 +6716,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t) // XXX: BAD! this get gpencil datablocks directly from main db... // but that's how this currently works :/ - for (mask = bmain->mask.first; mask; mask = mask->id.next) { + for (mask = bmain->masks.first; mask; mask = mask->id.next) { if (ID_REAL_USERS(mask)) posttrans_mask_clean(mask); } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 2dacf5b4c5a..305b17949c8 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -547,7 +547,7 @@ static void initSnappingMode(TransInfo *t) /* Edit mode */ if (t->tsnap.applySnap != NULL && // A snapping function actually exist - ((obedit_type != -1) && ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) ) // Temporary limited to edit mode meshes, armature, curves, mballs + ((obedit_type != -1) && ELEM(obedit_type, OB_MESH, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL)) ) // Temporary limited to edit mode meshes, armature, curves, metaballs { /* Exclude editmesh if using proportional edit */ if ((obedit_type == OB_MESH) && (t->flag & T_PROP_EDIT)) { diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 6f0c8594446..e2405591141 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -118,7 +118,7 @@ void ED_editors_init(bContext *C) * active object in this scene. */ Object *obact = CTX_data_active_object(C); if (obact != NULL) { - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { int mode = ob->mode; if (mode == OB_MODE_OBJECT) { continue; @@ -206,7 +206,7 @@ void ED_editors_exit(Main *bmain, bool do_undo_system) } } - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->type == OB_MESH) { Mesh *me = ob->data; if (me->edit_mesh) { @@ -238,7 +238,7 @@ bool ED_editors_flush_edits(Main *bmain, bool for_render) /* loop through all data to find edit mode or object mode, because during * exiting we might not have a context for edit object and multiple sculpt * objects can exist at the same time */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->mode & OB_MODE_SCULPT) { /* Don't allow flushing while in the middle of a stroke (frees data in use). * Auto-save prevents this from happening but scripts diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index df3197b6a02..1587bc3d9eb 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -208,7 +208,7 @@ BlenderStrokeRenderer::~BlenderStrokeRenderer() } // release materials - Link *lnk = (Link *)freestyle_bmain->mat.first; + Link *lnk = (Link *)freestyle_bmain->materials.first; while (lnk) { diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 5d6b09f476b..62dcbb94d1c 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -597,7 +597,7 @@ void GPU_paint_set_mipmap(Main *bmain, bool mipmap) GTS.texpaint = !mipmap; if (mipmap) { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { if (BKE_image_has_opengl_texture(ima)) { if (ima->gpuflag & IMA_GPU_MIPMAP_COMPLETE) { if (ima->gputexture[TEXTARGET_TEXTURE_2D]) { @@ -616,7 +616,7 @@ void GPU_paint_set_mipmap(Main *bmain, bool mipmap) } else { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { if (BKE_image_has_opengl_texture(ima)) { if (ima->gputexture[TEXTARGET_TEXTURE_2D]) { GPU_texture_bind(ima->gputexture[TEXTARGET_TEXTURE_2D], 0); @@ -1119,7 +1119,7 @@ void GPU_free_unused_buffers(Main *bmain) Image *ima = node->link; /* check in case it was freed in the meantime */ - if (bmain && BLI_findindex(&bmain->image, ima) != -1) + if (bmain && BLI_findindex(&bmain->images, ima) != -1) GPU_free_image(ima); } @@ -1155,7 +1155,7 @@ void GPU_free_image(Image *ima) void GPU_free_images(Main *bmain) { if (bmain) { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { GPU_free_image(ima); } } @@ -1165,7 +1165,7 @@ void GPU_free_images(Main *bmain) void GPU_free_images_anim(Main *bmain) { if (bmain) { - for (Image *ima = bmain->image.first; ima; ima = ima->id.next) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { if (BKE_image_is_animated(ima)) { GPU_free_image(ima); } @@ -1192,7 +1192,7 @@ void GPU_free_images_old(Main *bmain) lasttime = ctime; - Image *ima = bmain->image.first; + Image *ima = bmain->images.first; while (ima) { if ((ima->flag & IMA_NOCOLLECT) == 0 && ctime - ima->lastused > U.textimeout) { /* If it's in GL memory, deallocate and set time tag to current time diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index ac5cd93d77e..302b3b4ef1c 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -754,10 +754,10 @@ void GPU_materials_free(Main *bmain) World *wo; extern Material defmaterial; - for (ma = bmain->mat.first; ma; ma = ma->id.next) + for (ma = bmain->materials.first; ma; ma = ma->id.next) GPU_material_free(&ma->gpumaterial); - for (wo = bmain->world.first; wo; wo = wo->id.next) + for (wo = bmain->worlds.first; wo; wo = wo->id.next) GPU_material_free(&wo->gpumaterial); GPU_material_free(&defmaterial.gpumaterial); diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index cad01d057b7..597421d80c6 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1133,7 +1133,7 @@ void IMB_colormanagement_check_file_config(Main *bmain) return; } - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { ColorManagedColorspaceSettings *sequencer_colorspace_settings; /* check scene color management settings */ @@ -1159,11 +1159,11 @@ void IMB_colormanagement_check_file_config(Main *bmain) /* ** check input color space settings ** */ - for (image = bmain->image.first; image; image = image->id.next) { + for (image = bmain->images.first; image; image = image->id.next) { colormanage_check_colorspace_settings(&image->colorspace_settings, "image"); } - for (clip = bmain->movieclip.first; clip; clip = clip->id.next) { + for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { colormanage_check_colorspace_settings(&clip->colorspace_settings, "clip"); } } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 90f93030cb9..1c16abcd12f 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -141,7 +141,7 @@ static void rna_Armature_update_layers(Main *bmain, Scene *UNUSED(scene), Pointe /* proxy lib exception, store it here so we can restore layers on file * load, since it would otherwise get lost due to being linked data */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->data == arm && ob->pose) ob->pose->proxy_layer = arm->layer; } @@ -426,7 +426,7 @@ static void rna_Bone_bbone_handle_update(Main *bmain, Scene *scene, PointerRNA * Bone *bone = (Bone *)ptr->data; /* Update all users of this armature after changing B-Bone handles. */ - for (Object *obt = bmain->object.first; obt; obt = obt->id.next) { + for (Object *obt = bmain->objects.first; obt; obt = obt->id.next) { if (obt->data == arm && obt->pose) { bPoseChannel *pchan = BKE_pose_channel_find_name(obt->pose, bone->name); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index ed7d674e840..aba1f08ed6b 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -703,7 +703,7 @@ static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain, Scene *s Brush *brush_cur = paint->brush; /* disable default eraser in all brushes */ - for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { + for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if ((brush != brush_cur) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index beda3ebb7b8..61c2600a021 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -424,7 +424,7 @@ static void rna_ColorManagedDisplaySettings_display_device_update(Main *bmain, S WM_main_add_notifier(NC_SCENE | ND_SEQUENCER, NULL); /* Color management can be baked into shaders, need to refresh. */ - for (Material *ma = bmain->mat.first; ma; ma = ma->id.next) { + for (Material *ma = bmain->materials.first; ma; ma = ma->id.next) { DEG_id_tag_update(&ma->id, ID_RECALC_COPY_ON_WRITE); } } diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 80d6ca1ca15..8fe20a1b03f 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -655,7 +655,7 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p Key *key = ptr->id.data; Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (BKE_key_from_object(ob) == key) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_OBJECT | ND_MODIFIER, ob); diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index 304398953b6..410598082db 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -130,7 +130,7 @@ static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) neww = (lt->opntsw > 0) ? lt->opntsw : lt->pntsw; /* BKE_lattice_resize needs an object, any object will have the same result */ - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->data == lt) { BKE_lattice_resize(lt, newu, newv, neww, ob); if (lt->editlatt) diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 91b599a5ff1..7bc0db3a725 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -90,166 +90,166 @@ static void rna_Main_filepath_set(PointerRNA *ptr, const char *value) } #endif -static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_scenes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->scene, NULL); + rna_iterator_listbase_begin(iter, &bmain->scenes, NULL); } -static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->object, NULL); + rna_iterator_listbase_begin(iter, &bmain->objects, NULL); } -static void rna_Main_light_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_lights_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->light, NULL); + rna_iterator_listbase_begin(iter, &bmain->lights, NULL); } -static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_libraries_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->library, NULL); + rna_iterator_listbase_begin(iter, &bmain->libraries, NULL); } -static void rna_Main_mesh_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_meshes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->mesh, NULL); + rna_iterator_listbase_begin(iter, &bmain->meshes, NULL); } -static void rna_Main_curve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_curves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->curve, NULL); + rna_iterator_listbase_begin(iter, &bmain->curves, NULL); } -static void rna_Main_mball_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_metaballs_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->mball, NULL); + rna_iterator_listbase_begin(iter, &bmain->metaballs, NULL); } -static void rna_Main_mat_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_materials_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->mat, NULL); + rna_iterator_listbase_begin(iter, &bmain->materials, NULL); } -static void rna_Main_tex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_textures_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->tex, NULL); + rna_iterator_listbase_begin(iter, &bmain->textures, NULL); } -static void rna_Main_image_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_images_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->image, NULL); + rna_iterator_listbase_begin(iter, &bmain->images, NULL); } -static void rna_Main_lattice_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_lattices_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->lattice, NULL); + rna_iterator_listbase_begin(iter, &bmain->lattices, NULL); } -static void rna_Main_camera_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_cameras_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->camera, NULL); + rna_iterator_listbase_begin(iter, &bmain->cameras, NULL); } -static void rna_Main_key_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_shapekeys_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->key, NULL); + rna_iterator_listbase_begin(iter, &bmain->shapekeys, NULL); } -static void rna_Main_world_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_worlds_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->world, NULL); + rna_iterator_listbase_begin(iter, &bmain->worlds, NULL); } -static void rna_Main_screen_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_screens_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->screen, NULL); + rna_iterator_listbase_begin(iter, &bmain->screens, NULL); } -static void rna_Main_font_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_fonts_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->vfont, NULL); + rna_iterator_listbase_begin(iter, &bmain->fonts, NULL); } -static void rna_Main_text_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_texts_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->text, NULL); + rna_iterator_listbase_begin(iter, &bmain->texts, NULL); } -static void rna_Main_speaker_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_speakers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->speaker, NULL); + rna_iterator_listbase_begin(iter, &bmain->speakers, NULL); } -static void rna_Main_sound_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_sounds_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->sound, NULL); + rna_iterator_listbase_begin(iter, &bmain->sounds, NULL); } -static void rna_Main_collection_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_collections_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->collection, NULL); + rna_iterator_listbase_begin(iter, &bmain->collections, NULL); } -static void rna_Main_armature_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_armatures_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->armature, NULL); + rna_iterator_listbase_begin(iter, &bmain->armatures, NULL); } -static void rna_Main_action_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_actions_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->action, NULL); + rna_iterator_listbase_begin(iter, &bmain->actions, NULL); } -static void rna_Main_nodetree_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_nodetrees_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->nodetree, NULL); + rna_iterator_listbase_begin(iter, &bmain->nodetrees, NULL); } -static void rna_Main_brush_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_brushes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->brush, NULL); + rna_iterator_listbase_begin(iter, &bmain->brushes, NULL); } -static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_particles_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->particle, NULL); + rna_iterator_listbase_begin(iter, &bmain->particles, NULL); } -static void rna_Main_palette_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_palettes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->palette, NULL); + rna_iterator_listbase_begin(iter, &bmain->palettes, NULL); } -static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_gpencils_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL); + rna_iterator_listbase_begin(iter, &bmain->gpencils, NULL); } static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -261,43 +261,43 @@ static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) static void rna_Main_movieclips_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->movieclip, NULL); + rna_iterator_listbase_begin(iter, &bmain->movieclips, NULL); } static void rna_Main_masks_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->mask, NULL); + rna_iterator_listbase_begin(iter, &bmain->masks, NULL); } -static void rna_Main_linestyle_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_linestyles_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->linestyle, NULL); + rna_iterator_listbase_begin(iter, &bmain->linestyles, NULL); } -static void rna_Main_cachefile_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_cachefiles_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->cachefile, NULL); + rna_iterator_listbase_begin(iter, &bmain->cachefiles, NULL); } -static void rna_Main_paintcurve_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_paintcurves_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->paintcurve, NULL); + rna_iterator_listbase_begin(iter, &bmain->paintcurves, NULL); } -static void rna_Main_workspace_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_workspaces_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->workspace, NULL); + rna_iterator_listbase_begin(iter, &bmain->workspaces, NULL); } -static void rna_Main_lightprobe_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +static void rna_Main_lightprobes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain = (Main *)ptr->data; - rna_iterator_listbase_begin(iter, &bmain->lightprobe, NULL); + rna_iterator_listbase_begin(iter, &bmain->lightprobes, NULL); } static void rna_Main_version_get(PointerRNA *ptr, int *value) @@ -342,41 +342,41 @@ void RNA_def_main(BlenderRNA *brna) /* plural must match idtypes in readblenentry.c */ MainCollectionDef lists[] = { - {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera data-blocks", RNA_def_main_cameras}, - {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene data-blocks", RNA_def_main_scenes}, - {"objects", "Object", "rna_Main_object_begin", "Objects", "Object data-blocks", RNA_def_main_objects}, - {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material data-blocks", RNA_def_main_materials}, - {"node_groups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups}, - {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes}, - {"lights", "Light", "rna_Main_light_begin", "Lights", "Light data-blocks", RNA_def_main_lights}, - {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries}, - {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen data-blocks", RNA_def_main_screens}, + {"cameras", "Camera", "rna_Main_cameras_begin", "Cameras", "Camera data-blocks", RNA_def_main_cameras}, + {"scenes", "Scene", "rna_Main_scenes_begin", "Scenes", "Scene data-blocks", RNA_def_main_scenes}, + {"objects", "Object", "rna_Main_objects_begin", "Objects", "Object data-blocks", RNA_def_main_objects}, + {"materials", "Material", "rna_Main_materials_begin", "Materials", "Material data-blocks", RNA_def_main_materials}, + {"node_groups", "NodeTree", "rna_Main_nodetrees_begin", "Node Groups", "Node group data-blocks", RNA_def_main_node_groups}, + {"meshes", "Mesh", "rna_Main_meshes_begin", "Meshes", "Mesh data-blocks", RNA_def_main_meshes}, + {"lights", "Light", "rna_Main_lights_begin", "Lights", "Light data-blocks", RNA_def_main_lights}, + {"libraries", "Library", "rna_Main_libraries_begin", "Libraries", "Library data-blocks", RNA_def_main_libraries}, + {"screens", "Screen", "rna_Main_screens_begin", "Screens", "Screen data-blocks", RNA_def_main_screens}, {"window_managers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager data-blocks", RNA_def_main_window_managers}, - {"images", "Image", "rna_Main_image_begin", "Images", "Image data-blocks", RNA_def_main_images}, - {"lattices", "Lattice", "rna_Main_lattice_begin", "Lattices", "Lattice data-blocks", RNA_def_main_lattices}, - {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve data-blocks", RNA_def_main_curves}, - {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball data-blocks", RNA_def_main_metaballs}, - {"fonts", "VectorFont", "rna_Main_font_begin", "Vector Fonts", "Vector font data-blocks", RNA_def_main_fonts}, - {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture data-blocks", RNA_def_main_textures}, - {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush data-blocks", RNA_def_main_brushes}, - {"worlds", "World", "rna_Main_world_begin", "Worlds", "World data-blocks", RNA_def_main_worlds}, - {"collections", "Collection", "rna_Main_collection_begin", "Collections", "Collection data-blocks", RNA_def_main_collections}, - {"shape_keys", "Key", "rna_Main_key_begin", "Shape Keys", "Shape Key data-blocks", NULL}, - {"texts", "Text", "rna_Main_text_begin", "Texts", "Text data-blocks", RNA_def_main_texts}, - {"speakers", "Speaker", "rna_Main_speaker_begin", "Speakers", "Speaker data-blocks", RNA_def_main_speakers}, - {"sounds", "Sound", "rna_Main_sound_begin", "Sounds", "Sound data-blocks", RNA_def_main_sounds}, - {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature data-blocks", RNA_def_main_armatures}, - {"actions", "Action", "rna_Main_action_begin", "Actions", "Action data-blocks", RNA_def_main_actions}, - {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle data-blocks", RNA_def_main_particles}, - {"palettes", "Palette", "rna_Main_palette_begin", "Palettes", "Palette data-blocks", RNA_def_main_palettes}, - {"grease_pencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil data-blocks", RNA_def_main_gpencil}, + {"images", "Image", "rna_Main_images_begin", "Images", "Image data-blocks", RNA_def_main_images}, + {"lattices", "Lattice", "rna_Main_lattices_begin", "Lattices", "Lattice data-blocks", RNA_def_main_lattices}, + {"curves", "Curve", "rna_Main_curves_begin", "Curves", "Curve data-blocks", RNA_def_main_curves}, + {"metaballs", "MetaBall", "rna_Main_metaballs_begin", "Metaballs", "Metaball data-blocks", RNA_def_main_metaballs}, + {"fonts", "VectorFont", "rna_Main_fonts_begin", "Vector Fonts", "Vector font data-blocks", RNA_def_main_fonts}, + {"textures", "Texture", "rna_Main_textures_begin", "Textures", "Texture data-blocks", RNA_def_main_textures}, + {"brushes", "Brush", "rna_Main_brushes_begin", "Brushes", "Brush data-blocks", RNA_def_main_brushes}, + {"worlds", "World", "rna_Main_worlds_begin", "Worlds", "World data-blocks", RNA_def_main_worlds}, + {"collections", "Collection", "rna_Main_collections_begin", "Collections", "Collection data-blocks", RNA_def_main_collections}, + {"shape_keys", "Key", "rna_Main_shapekeys_begin", "Shape Keys", "Shape Key data-blocks", NULL}, + {"texts", "Text", "rna_Main_texts_begin", "Texts", "Text data-blocks", RNA_def_main_texts}, + {"speakers", "Speaker", "rna_Main_speakers_begin", "Speakers", "Speaker data-blocks", RNA_def_main_speakers}, + {"sounds", "Sound", "rna_Main_sounds_begin", "Sounds", "Sound data-blocks", RNA_def_main_sounds}, + {"armatures", "Armature", "rna_Main_armatures_begin", "Armatures", "Armature data-blocks", RNA_def_main_armatures}, + {"actions", "Action", "rna_Main_actions_begin", "Actions", "Action data-blocks", RNA_def_main_actions}, + {"particles", "ParticleSettings", "rna_Main_particles_begin", "Particles", "Particle data-blocks", RNA_def_main_particles}, + {"palettes", "Palette", "rna_Main_palettes_begin", "Palettes", "Palette data-blocks", RNA_def_main_palettes}, + {"grease_pencil", "GreasePencil", "rna_Main_gpencils_begin", "Grease Pencil", "Grease Pencil data-blocks", RNA_def_main_gpencil}, {"movieclips", "MovieClip", "rna_Main_movieclips_begin", "Movie Clips", "Movie Clip data-blocks", RNA_def_main_movieclips}, {"masks", "Mask", "rna_Main_masks_begin", "Masks", "Masks data-blocks", RNA_def_main_masks}, - {"linestyles", "FreestyleLineStyle", "rna_Main_linestyle_begin", "Line Styles", "Line Style data-blocks", RNA_def_main_linestyles}, - {"cache_files", "CacheFile", "rna_Main_cachefile_begin", "Cache Files", "Cache Files data-blocks", RNA_def_main_cachefiles}, - {"paint_curves", "PaintCurve", "rna_Main_paintcurve_begin", "Paint Curves", "Paint Curves data-blocks", RNA_def_main_paintcurves}, - {"workspaces", "WorkSpace", "rna_Main_workspace_begin", "Workspaces", "Workspace data-blocks", RNA_def_main_workspaces}, - {"lightprobes", "LightProbe", "rna_Main_lightprobe_begin", "LightProbes", "LightProbe data-blocks", RNA_def_main_lightprobes}, + {"linestyles", "FreestyleLineStyle", "rna_Main_linestyles_begin", "Line Styles", "Line Style data-blocks", RNA_def_main_linestyles}, + {"cache_files", "CacheFile", "rna_Main_cachefiles_begin", "Cache Files", "Cache Files data-blocks", RNA_def_main_cachefiles}, + {"paint_curves", "PaintCurve", "rna_Main_paintcurves_begin", "Paint Curves", "Paint Curves data-blocks", RNA_def_main_paintcurves}, + {"workspaces", "WorkSpace", "rna_Main_workspaces_begin", "Workspaces", "Workspace data-blocks", RNA_def_main_workspaces}, + {"lightprobes", "LightProbe", "rna_Main_lightprobes_begin", "LightProbes", "LightProbe data-blocks", RNA_def_main_lightprobes}, {NULL, NULL, NULL, NULL, NULL, NULL}, }; diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 5675e00586c..34e759325d1 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -611,41 +611,41 @@ static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name) BKE_main_id_tag_listbase(&bmain->_listbase_name, LIB_TAG_DOIT, value); \ } \ -RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, camera, ID_CA) -RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scene, ID_SCE) -RNA_MAIN_ID_TAG_FUNCS_DEF(objects, object, ID_OB) -RNA_MAIN_ID_TAG_FUNCS_DEF(materials, mat, ID_MA) -RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetree, ID_NT) -RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, mesh, ID_ME) -RNA_MAIN_ID_TAG_FUNCS_DEF(lights, light, ID_LA) -RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, library, ID_LI) -RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screen, ID_SCR) +RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA) +RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE) +RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB) +RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA) +RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT) +RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME) +RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA) +RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI) +RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR) RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM) -RNA_MAIN_ID_TAG_FUNCS_DEF(images, image, ID_IM) -RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattice, ID_LT) -RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curve, ID_CU) -RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, mball, ID_MB) -RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, vfont, ID_VF) -RNA_MAIN_ID_TAG_FUNCS_DEF(textures, tex, ID_TE) -RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brush, ID_BR) -RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, world, ID_WO) -RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collection, ID_GR) +RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM) +RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT) +RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU) +RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB) +RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF) +RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE) +RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR) +RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO) +RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR) //RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE) -RNA_MAIN_ID_TAG_FUNCS_DEF(texts, text, ID_TXT) -RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speaker, ID_SPK) -RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sound, ID_SO) -RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armature, ID_AR) -RNA_MAIN_ID_TAG_FUNCS_DEF(actions, action, ID_AC) -RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particle, ID_PA) -RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palette, ID_PAL) -RNA_MAIN_ID_TAG_FUNCS_DEF(gpencil, gpencil, ID_GD) -RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclip, ID_MC) -RNA_MAIN_ID_TAG_FUNCS_DEF(masks, mask, ID_MSK) -RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyle, ID_LS) -RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefile, ID_CF) -RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurve, ID_PC) -RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspace, ID_WS) -RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobe, ID_LP) +RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT) +RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK) +RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO) +RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR) +RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC) +RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA) +RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL) +RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD) +RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC) +RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK) +RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS) +RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF) +RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC) +RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS) +RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP) #undef RNA_MAIN_ID_TAG_FUNCS_DEF @@ -1661,7 +1661,7 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils"); - func = RNA_def_function(srna, "tag", "rna_Main_gpencil_tag"); + func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag"); parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 1b21e554223..4c400b4fb2e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -157,7 +157,7 @@ static void rna_Material_active_paint_texture_index_update(Main *bmain, Scene *U if (ma->texpaintslot) { Image *image = ma->texpaintslot[ma->paint_active_slot].ima; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { wmWindow *win = ED_screen_window_find(sc, bmain->wm.first); if (win == NULL) { continue; diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 246a9c4beb5..0f4cd4759bc 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -95,7 +95,7 @@ static void rna_MetaBall_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) /* cheating way for importers to avoid slow updates */ if (mb->id.us > 0) { - for (ob = bmain->object.first; ob; ob = ob->id.next) + for (ob = bmain->objects.first; ob; ob = ob->id.next) if (ob->data == mb) BKE_mball_properties_copy(scene, ob); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 6af131fd857..4e1a539fe69 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -625,7 +625,7 @@ static void rna_Particle_change_type(Main *bmain, Scene *UNUSED(scene), PointerR ParticleSettings *part = ptr->id.data; /* Iterating over all object is slow, but no better solution exists at the moment. */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { for (ParticleSystem *psys = ob->particlesystem.first; psys; psys = psys->next) { if (psys->part == part) { psys_changed_type(ob, psys); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8a444002e29..6aec918f7f9 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1546,7 +1546,7 @@ static void rna_Scene_use_simplify_update(Main *bmain, Scene *UNUSED(scene), Poi Scene *sce_iter; Base *base; - BKE_main_id_tag_listbase(&bmain->object, LIB_TAG_DOIT, true); + BKE_main_id_tag_listbase(&bmain->objects, LIB_TAG_DOIT, true); FOREACH_SCENE_OBJECT_BEGIN(sce, ob) { object_simplify_update(ob); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 00d42fc408b..f372180dd3b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -481,7 +481,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) bScreen *sc; Image *ima = scene->toolsettings->imapaint.canvas; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { SpaceLink *slink; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fd9c45034c3..0592a524b76 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -505,7 +505,7 @@ static void rna_Space_view2d_sync_update(Main *UNUSED(bmain), Scene *UNUSED(scen static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { /* need set all caches as dirty to recalculate onion skinning */ - for (Object *ob = bmain->object.first; ob; ob = ob->id.next) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->type == OB_GPENCIL) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } @@ -650,7 +650,7 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *UNUSED(scene), Poi return; } - for (Material *ma = bmain->mat.first; ma; ma = ma->id.next) { + for (Material *ma = bmain->materials.first; ma; ma = ma->id.next) { /* XXX Dependency graph does not support CD mask tracking, * so we trigger materials shading for until it's properly supported. * This is to ensure material batches are all recreated when switching diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 72f46ee10c7..dda36d89eb1 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -167,7 +167,7 @@ static void rna_userdef_update_ui(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi static void rna_userdef_update_ui_header_default(Main *bmain, Scene *scene, PointerRNA *ptr) { if (U.uiflag & USER_HEADER_FROM_PREF) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { BKE_screen_header_alignment_reset(screen); } rna_userdef_update_ui(bmain, scene, ptr); @@ -336,7 +336,7 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN { Object *ob; - for (ob = bmain->object.first; ob; ob = ob->id.next) { + for (ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->mode & OB_MODE_WEIGHT_PAINT) DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } @@ -478,7 +478,7 @@ static void rna_userdef_opensubdiv_update(Main *bmain, Scene *UNUSED(scene), Poi { Object *object; - for (object = bmain->object.first; + for (object = bmain->objects.first; object; object = object->id.next) { diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 3f0e7cfb32a..2a084cbd526 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -257,7 +257,7 @@ static wmGizmo *rna_GizmoProperties_find_operator(PointerRNA *ptr) #endif /* We could try workaruond this lookup, but not trivial. */ - for (bScreen *screen = G_MAIN->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = G_MAIN->screens.first; screen; screen = screen->id.next) { IDProperty *properties = ptr->data; for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index e2cfb4cd24c..ffa3cf363c9 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -276,7 +276,7 @@ void ntreeCompositTagRender(Scene *curscene) /* XXX Think using G_MAIN here is valid, since you want to update current file's scene nodes, * not the ones in temp main generated for rendering? * This is still rather weak though, ideally render struct would store own main AND original G_MAIN... */ - for (sce = G_MAIN->scene.first; sce; sce = sce->id.next) { + for (sce = G_MAIN->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree) { bNode *node; diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 8c0a277668f..37652daa312 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -216,7 +216,7 @@ static void cmp_node_rlayer_create_outputs_cb(void *UNUSED(userdata), Scene *sce * unless we want to register that for every other temp Main we could generate??? */ ntreeCompositRegisterPass(scene->nodetree, scene, view_layer, name, type); - for (Scene *sce = G_MAIN->scene.first; sce; sce = sce->id.next) { + for (Scene *sce = G_MAIN->scenes.first; sce; sce = sce->id.next) { if (sce->nodetree && sce != scene) { ntreeCompositRegisterPass(sce->nodetree, scene, view_layer, name, type); } @@ -409,7 +409,7 @@ static bool node_composit_poll_rlayers(bNodeType *UNUSED(ntype), bNodeTree *ntre * Render layers node can only be used in local scene->nodetree, * since it directly links to the scene. */ - for (scene = G.main->scene.first; scene; scene = scene->id.next) + for (scene = G.main->scenes.first; scene; scene = scene->id.next) if (scene->nodetree == ntree) break; diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index d4adcad8318..96b5645f0e7 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -186,7 +186,7 @@ PyObject *bpy_text_import_name(const char *name, int *found) memcpy(txtname, name, namelen); memcpy(&txtname[namelen], ".py", 4); - text = BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, txtname, offsetof(ID, name) + 2); if (text) { *found = 1; @@ -196,7 +196,7 @@ PyObject *bpy_text_import_name(const char *name, int *found) /* If we still haven't found the module try additional modules form bpy_import_main_list */ maggie = bpy_import_main_list.first; while (maggie && !text) { - text = BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, txtname, offsetof(ID, name) + 2); maggie = maggie->next; } @@ -245,7 +245,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found) } /* look up the text object */ - text = BLI_findstring(&maggie->text, BLI_path_basename(filepath), offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, BLI_path_basename(filepath), offsetof(ID, name) + 2); /* uh-oh.... didn't find it */ if (!text) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 2a33c316f55..189fb97f3d2 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -518,7 +518,7 @@ static bool python_script_exec( if (do_jump) { /* ensure text is valid before use, the script may have freed its self */ Main *bmain_new = CTX_data_main(C); - if ((bmain_old == bmain_new) && (BLI_findindex(&bmain_new->text, text) != -1)) { + if ((bmain_old == bmain_new) && (BLI_findindex(&bmain_new->texts, text) != -1)) { python_script_error_jump_text(text); } } @@ -761,7 +761,7 @@ void BPY_modules_load_user(bContext *C) bpy_context_set(C, &gilstate); - for (text = bmain->text.first; text; text = text->id.next) { + for (text = bmain->texts.first; text; text = text->id.next) { if (text->flags & TXT_ISSCRIPT && BLI_path_extension_check(text->id.name + 2, ".py")) { if (!(G.f & G_FLAG_SCRIPT_AUTOEXEC)) { if (!(G.f & G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index cba6d2203fa..cb1555f8cc4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2343,7 +2343,7 @@ static int pyrna_prop_collection_subscript_str_lib_pair_ptr( else if (PyUnicode_Check(keylib)) { Main *bmain = self->ptr.data; const char *keylib_str = _PyUnicode_AsString(keylib); - lib = BLI_findstring(&bmain->library, keylib_str, offsetof(Library, name)); + lib = BLI_findstring(&bmain->libraries, keylib_str, offsetof(Library, name)); if (lib == NULL) { if (err_not_found) { PyErr_Format(PyExc_KeyError, diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index 7744e733afd..e1eb735f074 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -792,7 +792,7 @@ void WM_gizmomaptype_group_init_runtime( } /* now create a gizmo for all existing areas */ - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; @@ -837,7 +837,7 @@ void WM_gizmomaptype_group_unlink( const wmGizmoGroupType *gzgt) { /* Free instances. */ - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index a4207704ab0..194bd2b5449 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -1266,7 +1266,7 @@ void WM_gizmoconfig_update(struct Main *bmain) void WM_reinit_gizmomap_all(Main *bmain) { - for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c index 2f675e1840c..b164d4c549f 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.c @@ -136,7 +136,7 @@ static void gizmotype_unlink( bContext *C, Main *bmain, wmGizmoType *gzt) { /* Free instances. */ - for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) { + for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 08d7ec19eb3..603e563d232 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -274,7 +274,7 @@ void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id) Main *bmain = G_MAIN; bScreen *sc; - for (sc = bmain->screen.first; sc; sc = sc->id.next) { + for (sc = bmain->screens.first; sc; sc = sc->id.next) { ScrArea *sa; for (sa = sc->areabase.first; sa; sa = sa->next) { diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 3fc1444fe41..acc680014f4 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -447,7 +447,7 @@ void wm_file_read_report(bContext *C, Main *bmain) ReportList *reports = NULL; Scene *sce; - for (sce = bmain->scene.first; sce; sce = sce->id.next) { + for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->r.engine[0] && BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL) { @@ -1266,7 +1266,7 @@ static bool wm_file_write(bContext *C, const char *filepath, int fileflags, Repo * its handy for scripts to save to a predefined name without blender editing it */ /* send the OnSave event */ - for (li = bmain->library.first; li; li = li->id.next) { + for (li = bmain->libraries.first; li; li = li->id.next) { if (BLI_path_cmp(li->filepath, filepath) == 0) { BKE_reportf(reports, RPT_ERROR, "Cannot overwrite used library '%.240s'", filepath); return ok; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d047057759e..a6e0c86b5fd 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2984,7 +2984,7 @@ static int previews_id_ensure_callback(void *userdata, ID *UNUSED(self_id), ID * static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op)) { Main *bmain = CTX_data_main(C); - ListBase *lb[] = {&bmain->mat, &bmain->tex, &bmain->image, &bmain->world, &bmain->light, NULL}; + ListBase *lb[] = {&bmain->materials, &bmain->textures, &bmain->images, &bmain->worlds, &bmain->lights, NULL}; PreviewsIDEnsureData preview_id_data; Scene *scene; ID *id; @@ -2997,7 +2997,7 @@ static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op)) } preview_id_data.C = C; - for (scene = bmain->scene.first; scene; scene = scene->id.next) { + for (scene = bmain->scenes.first; scene; scene = scene->id.next) { preview_id_data.scene = scene; id = (ID *)scene; @@ -3049,8 +3049,8 @@ static const EnumPropertyItem preview_id_type_items[] = { static int previews_clear_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); - ListBase *lb[] = {&bmain->object, &bmain->collection, - &bmain->mat, &bmain->world, &bmain->light, &bmain->tex, &bmain->image, NULL}; + ListBase *lb[] = {&bmain->objects, &bmain->collections, + &bmain->materials, &bmain->worlds, &bmain->lights, &bmain->textures, &bmain->images, NULL}; int i; const int id_filters = RNA_enum_get(op->ptr, "id_type"); @@ -3390,7 +3390,7 @@ static const EnumPropertyItem *rna_id_itemf( /* can add more as needed */ const EnumPropertyItem *RNA_action_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->action.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->actions.first : NULL, false, NULL, NULL); } #if 0 /* UNUSED */ const EnumPropertyItem *RNA_action_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) @@ -3401,51 +3401,51 @@ const EnumPropertyItem *RNA_action_local_itemf(bContext *C, PointerRNA *ptr, Pro const EnumPropertyItem *RNA_collection_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collection.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collections.first : NULL, false, NULL, NULL); } const EnumPropertyItem *RNA_collection_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collection.first : NULL, true, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->collections.first : NULL, true, NULL, NULL); } const EnumPropertyItem *RNA_image_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->image.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->images.first : NULL, false, NULL, NULL); } const EnumPropertyItem *RNA_image_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->image.first : NULL, true, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->images.first : NULL, true, NULL, NULL); } const EnumPropertyItem *RNA_scene_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, false, NULL, NULL); } const EnumPropertyItem *RNA_scene_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, true, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, true, NULL, NULL); } const EnumPropertyItem *RNA_scene_without_active_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { Scene *scene_active = C ? CTX_data_scene(C) : NULL; return rna_id_itemf( - C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scene.first : NULL, true, + C, ptr, r_free, C ? (ID *)CTX_data_main(C)->scenes.first : NULL, true, rna_id_enum_filter_single, scene_active); } const EnumPropertyItem *RNA_movieclip_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclips.first : NULL, false, NULL, NULL); } const EnumPropertyItem *RNA_movieclip_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclip.first : NULL, true, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->movieclips.first : NULL, true, NULL, NULL); } const EnumPropertyItem *RNA_mask_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->mask.first : NULL, false, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->masks.first : NULL, false, NULL, NULL); } const EnumPropertyItem *RNA_mask_local_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) { - return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->mask.first : NULL, true, NULL, NULL); + return rna_id_itemf(C, ptr, r_free, C ? (ID *)CTX_data_main(C)->masks.first : NULL, true, NULL, NULL); } diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 26a60d7b34e..1c8bea19952 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -546,7 +546,7 @@ void WM_toolsystem_init(bContext *C) BLI_assert(CTX_wm_window(C) == NULL); - LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspace) { + LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) { LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) { MEM_SAFE_FREE(tref->runtime); } diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 8465b3bbba4..4fe5371152d 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -401,7 +401,7 @@ static void arg_py_context_restore( } if ((c_py->scene == NULL) || - BLI_findindex(&G_MAIN->scene, c_py->scene) != -1) + BLI_findindex(&G_MAIN->scenes, c_py->scene) != -1) { CTX_data_scene_set(C, c_py->scene); } |