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 /source/blender/editors | |
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.
Diffstat (limited to 'source/blender/editors')
53 files changed, 135 insertions, 135 deletions
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 |