Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-08 01:29:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-08 01:50:00 +0300
commit8f817de0cbef41dac81e6c7665ada509c3fe2988 (patch)
tree0802c3287116ce0bf600adc4bed8cba31cfc97b1 /source/blender/editors/object
parente68ac2827dd4f8ad346011a8a408b342e2718707 (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/object')
-rw-r--r--source/blender/editors/object/object_add.c14
-rw-r--r--source/blender/editors/object/object_bake_api.c4
-rw-r--r--source/blender/editors/object/object_collection.c8
-rw-r--r--source/blender/editors/object/object_constraint.c4
-rw-r--r--source/blender/editors/object/object_edit.c2
-rw-r--r--source/blender/editors/object/object_modifier.c2
-rw-r--r--source/blender/editors/object/object_relations.c26
-rw-r--r--source/blender/editors/object/object_select.c2
-rw-r--r--source/blender/editors/object/object_transform.c6
9 files changed, 34 insertions, 34 deletions
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);