From 8f817de0cbef41dac81e6c7665ada509c3fe2988 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Mar 2019 09:29:17 +1100 Subject: 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. --- source/blender/blenkernel/intern/action.c | 2 +- source/blender/blenkernel/intern/anim_sys.c | 132 +++++++++---------- .../blender/blenkernel/intern/blender_copybuffer.c | 4 +- source/blender/blenkernel/intern/blendfile.c | 22 ++-- source/blender/blenkernel/intern/brush.c | 4 +- source/blender/blenkernel/intern/cachefile.c | 4 +- source/blender/blenkernel/intern/collection.c | 16 +-- source/blender/blenkernel/intern/font.c | 4 +- source/blender/blenkernel/intern/image.c | 30 ++--- source/blender/blenkernel/intern/ipo.c | 20 +-- source/blender/blenkernel/intern/layer.c | 6 +- source/blender/blenkernel/intern/library.c | 8 +- source/blender/blenkernel/intern/library_remap.c | 6 +- source/blender/blenkernel/intern/main.c | 146 ++++++++++----------- source/blender/blenkernel/intern/mask.c | 2 +- source/blender/blenkernel/intern/material.c | 4 +- source/blender/blenkernel/intern/mesh_convert.c | 2 +- source/blender/blenkernel/intern/movieclip.c | 4 +- source/blender/blenkernel/intern/node.c | 14 +- source/blender/blenkernel/intern/object.c | 4 +- source/blender/blenkernel/intern/object_dupli.c | 6 +- source/blender/blenkernel/intern/packedFile.c | 24 ++-- source/blender/blenkernel/intern/paint_toolslots.c | 4 +- source/blender/blenkernel/intern/rigidbody.c | 2 +- source/blender/blenkernel/intern/scene.c | 12 +- source/blender/blenkernel/intern/sequencer.c | 4 +- source/blender/blenkernel/intern/sound.c | 12 +- source/blender/blenkernel/intern/workspace.c | 10 +- 28 files changed, 254 insertions(+), 254 deletions(-) (limited to 'source/blender/blenkernel/intern') 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, "", 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; -- cgit v1.2.3