diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-07 12:46:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-07 12:46:27 +0300 |
commit | f02af0407fbcb4924a1a1f938629c814259ce086 (patch) | |
tree | d4b05207886977e9cd5b47fdeecac0cbeb6bd818 | |
parent | b9ae517794765d6a16604de2803145e859bafb9d (diff) |
Cleanup: use _BEGIN suffix for group iterators
-rw-r--r-- | source/blender/blenkernel/BKE_group.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 | ||||
-rw-r--r-- | source/blender/collada/SceneExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tools.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ops.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 6 | ||||
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 2 |
17 files changed, 40 insertions, 40 deletions
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index 74255cfc941..6f7ced403a2 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -62,7 +62,7 @@ void BKE_group_eval_view_layers(const struct EvaluationContext *eval_ctx, /* Helper macros. */ -#define FOREACH_GROUP_BASE(_group, _base) \ +#define FOREACH_GROUP_BASE_BEGIN(_group, _base) \ for (Base *_base = (Base *)(_group)->view_layer->object_bases.first; \ _base; \ _base = _base->next) \ @@ -71,7 +71,7 @@ void BKE_group_eval_view_layers(const struct EvaluationContext *eval_ctx, #define FOREACH_GROUP_BASE_END \ } -#define FOREACH_GROUP_OBJECT(_group, _object) \ +#define FOREACH_GROUP_OBJECT_BEGIN(_group, _object) \ for (Base *_base = (Base *)(_group)->view_layer->object_bases.first; \ _base; \ _base = _base->next) \ diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 21945f07a10..55ded96fe01 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -506,7 +506,7 @@ static void add_collision_object(Object ***objs, unsigned int *numobj, unsigned Group *group= ob->dup_group; /* add objects */ - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { add_collision_object(objs, numobj, maxobj, object, self, level+1, modifier_type); } @@ -527,7 +527,7 @@ Object **get_collisionobjects_ext(Scene *scene, Object *self, Group *group, unsi /* gather all collision objects */ if (group) { /* use specified group */ - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { add_collision_object(&objs, &numobj, &maxobj, object, self, level, modifier_type); } @@ -584,7 +584,7 @@ static void add_collider_cache_object(ListBase **objs, Object *ob, Object *self, Group *group= ob->dup_group; /* add objects */ - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { add_collider_cache_object(objs, object, self, level+1); } @@ -598,7 +598,7 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group) /* add object in same layer in scene */ if (group) { - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { add_collider_cache_object(&objs, object, self, 0); } diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 8fa8da8b0ca..c5cea750b53 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -213,7 +213,7 @@ static bool group_object_cyclic_check_internal(Object *object, Group *group) if (dup_group == group) return true; else { - FOREACH_GROUP_OBJECT(dup_group, group_object) + FOREACH_GROUP_OBJECT_BEGIN(dup_group, group_object) { if (group_object_cyclic_check_internal(group_object, dup_group)) { return true; @@ -278,7 +278,7 @@ Group *BKE_group_object_find(Group *group, Object *ob) bool BKE_group_is_animated(Group *group, Object *UNUSED(parent)) { - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { if (object->proxy) { return true; @@ -369,7 +369,7 @@ void BKE_group_handle_recalc_and_update(const struct EvaluationContext *eval_ctx #endif { /* only do existing tags, as set by regular depsgraph */ - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { if (object->id.recalc & ID_RECALC_ALL) { BKE_object_handle_update(eval_ctx, scene, object); diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index e49c691448b..2a5c8f955ab 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -765,7 +765,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call case ID_GR: { Group *group = (Group *) id; - FOREACH_GROUP_BASE(group, base) + FOREACH_GROUP_BASE_BEGIN(group, base) { CALLBACK_INVOKE(base->object, IDWALK_CB_USER_ONE); } diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 2d655913b3e..391be751ae0 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -246,7 +246,7 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild if (ctx->group) { int groupid = 0; - FOREACH_GROUP_BASE(ctx->group, base) + FOREACH_GROUP_BASE_BEGIN(ctx->group, base) { Object *ob = base->object; if ((base->flag & BASE_VISIBLED) && ob != ctx->obedit && is_child(ob, parent)) { @@ -932,7 +932,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem totgroup += dw->count; } else { - FOREACH_GROUP_OBJECT(part->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(part->dup_group, object) { (void) object; totgroup++; @@ -957,7 +957,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } else { a = 0; - FOREACH_GROUP_OBJECT(part->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(part->dup_group, object) { oblist[a] = object; obcopylist[a] = *object; @@ -1057,7 +1057,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem if (part->ren_as == PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) { b = 0; - FOREACH_GROUP_OBJECT(part->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(part->dup_group, object) { copy_m4_m4(tmat, oblist[b]->obmat); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index c9507ac1a36..e90fa299f44 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -351,7 +351,7 @@ void psys_check_group_weights(ParticleSettings *part) } /* then add objects in the group to new list */ - FOREACH_GROUP_OBJECT(part->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(part->dup_group, object) { dw = part->dupliweights.first; while (dw && dw->ob != object) { diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 011971b6677..d61cb0c9369 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -92,7 +92,7 @@ void BKE_rigidbody_free_world(RigidBodyWorld *rbw) if (rbw->physics_world) { /* free physics references, we assume that all physics objects in will have been added to the world */ if (rbw->constraints) { - FOREACH_GROUP_OBJECT(rbw->constraints, object) + FOREACH_GROUP_OBJECT_BEGIN(rbw->constraints, object) { if (object->rigidbody_constraint) { RigidBodyCon *rbc = object->rigidbody_constraint; @@ -105,7 +105,7 @@ void BKE_rigidbody_free_world(RigidBodyWorld *rbw) } if (rbw->group) { - FOREACH_GROUP_OBJECT(rbw->group, object) + FOREACH_GROUP_OBJECT_BEGIN(rbw->group, object) { if (object->rigidbody_object) { RigidBodyOb *rbo = object->rigidbody_object; @@ -1148,7 +1148,7 @@ void BKE_rigidbody_remove_object(Scene *scene, Object *ob) /* remove object from rigid body constraints */ if (rbw->constraints) { - FOREACH_GROUP_OBJECT(rbw->constraints, obt) + FOREACH_GROUP_OBJECT_BEGIN(rbw->constraints, obt) { if (obt && obt->rigidbody_constraint) { rbc = obt->rigidbody_constraint; @@ -1201,7 +1201,7 @@ static void rigidbody_update_ob_array(RigidBodyWorld *rbw) } i = 0; - FOREACH_GROUP_OBJECT(rbw->group, object) + FOREACH_GROUP_OBJECT_BEGIN(rbw->group, object) { rbw->objects[i] = object; i++; @@ -1332,7 +1332,7 @@ static void rigidbody_update_simulation(const struct EvaluationContext *eval_ctx * Memory management needs redesign here, this is just a dirty workaround. */ if (rebuild && rbw->constraints) { - FOREACH_GROUP_OBJECT(rbw->constraints, ob) + FOREACH_GROUP_OBJECT_BEGIN(rbw->constraints, ob) { RigidBodyCon *rbc = ob->rigidbody_constraint; if (rbc && rbc->physics_constraint) { @@ -1345,7 +1345,7 @@ static void rigidbody_update_simulation(const struct EvaluationContext *eval_ctx } /* update objects */ - FOREACH_GROUP_OBJECT(rbw->group, ob) + FOREACH_GROUP_OBJECT_BEGIN(rbw->group, ob) { if (ob->type == OB_MESH) { /* validate that we've got valid object set up here... */ @@ -1394,7 +1394,7 @@ static void rigidbody_update_simulation(const struct EvaluationContext *eval_ctx if (rbw->constraints == NULL) /* no constraints, move on */ return; - FOREACH_GROUP_OBJECT(rbw->constraints, ob) + FOREACH_GROUP_OBJECT_BEGIN(rbw->constraints, ob) { /* validate that we've got valid object set up here... */ RigidBodyCon *rbc = ob->rigidbody_constraint; @@ -1427,7 +1427,7 @@ static void rigidbody_update_simulation(const struct EvaluationContext *eval_ctx static void rigidbody_update_simulation_post_step(RigidBodyWorld *rbw) { - FOREACH_GROUP_BASE(rbw->group, base) + FOREACH_GROUP_BASE_BEGIN(rbw->group, base) { Object *ob = base->object; RigidBodyOb *rbo = ob->rigidbody_object; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 512ce79e21c..9a570ad0e46 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -961,7 +961,7 @@ void BKE_scene_set_background(Main *bmain, Scene *scene) /* group flags again */ for (group = bmain->group.first; group; group = group->id.next) { - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { object->flag |= OB_FROMGROUP; } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c09b6d627ff..50fd2a075f0 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1346,7 +1346,7 @@ static void write_particlesettings(WriteData *wd, ParticleSettings *part) if (dw->ob != NULL) { dw->index = 0; if (part->dup_group) { /* can be NULL if lining fails or set to None */ - FOREACH_GROUP_OBJECT(part->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(part->dup_group, object) { if (object != dw->ob) { dw->index++; diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index 3a6386a8721..d1d0152e69a 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -175,7 +175,7 @@ void SceneExporter::writeNodes(const EvaluationContext *eval_ctx, Object *ob, Sc if ((ob->transflag & OB_DUPLIGROUP) == OB_DUPLIGROUP && ob->dup_group) { Group *group = ob->dup_group; /* printf("group detected '%s'\n", group->id.name + 2); */ - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { printf("\t%s\n", object->id.name); } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 32753c91a04..3575601973d 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -400,7 +400,7 @@ static const EnumPropertyItem *proxy_group_object_itemf(bContext *C, PointerRNA return DummyRNA_DEFAULT_items; /* find the object to affect */ - FOREACH_GROUP_OBJECT(ob->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(ob->dup_group, object) { item_tmp.identifier = item_tmp.name = object->id.name + 2; item_tmp.value = i++; @@ -1710,7 +1710,7 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in if (copy_groups && group->view_layer->object_bases.first) { bool all_duplicated = true; - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { if (object->id.newid == NULL) { all_duplicated = false; @@ -1722,7 +1722,7 @@ static void single_object_users(Main *bmain, Scene *scene, View3D *v3d, const in if (all_duplicated) { groupn = ID_NEW_SET(group, BKE_group_copy(bmain, group)); - FOREACH_GROUP_BASE(groupn, base) + FOREACH_GROUP_BASE_BEGIN(groupn, base) { base->object = (Object *)base->object->id.newid; } @@ -2425,7 +2425,7 @@ static int make_override_static_exec(bContext *C, wmOperator *op) /* Then, we tag our 'main' object and its detected dependencies to be also overridden. */ obact->id.tag |= LIB_TAG_DOIT; - FOREACH_GROUP_OBJECT(obgroup->dup_group, ob) + FOREACH_GROUP_OBJECT_BEGIN(obgroup->dup_group, ob) { make_override_static_tag_object(obact, ob); } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 16f3aeaf110..29f5445a7a0 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -924,7 +924,7 @@ static void do_outliner_item_activate_tree_element( if (extend) { int sel = BA_SELECT; - FOREACH_GROUP_BASE(gr, base) + FOREACH_GROUP_BASE_BEGIN(gr, base) { if (base->flag & BASE_SELECTED) { sel = BA_DESELECT; @@ -933,7 +933,7 @@ static void do_outliner_item_activate_tree_element( } FOREACH_GROUP_BASE_END - FOREACH_GROUP_OBJECT(gr, object) + FOREACH_GROUP_OBJECT_BEGIN(gr, object) { ED_object_base_select(BKE_view_layer_base_find(view_layer, object), sel); } @@ -942,7 +942,7 @@ static void do_outliner_item_activate_tree_element( else { BKE_view_layer_base_deselect_all(view_layer); - FOREACH_GROUP_OBJECT(gr, object) + FOREACH_GROUP_OBJECT_BEGIN(gr, object) { Base *base = BKE_view_layer_base_find(view_layer, object); /* Object may not be in this scene */ diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index b97046d1470..4dbc7ac47ef 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -541,7 +541,7 @@ static void group_linkobs2scene_cb( Group *group = (Group *)tselem->id; Base *base; - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { base = BKE_view_layer_base_find(view_layer, object); if (!base) { diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 79fa9e14dc1..5ab0ac9464d 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -82,7 +82,7 @@ static int view3d_copybuffer_exec(bContext *C, wmOperator *op) CTX_DATA_END; for (Group *group = bmain->group.first; group; group = group->id.next) { - FOREACH_GROUP_OBJECT(group, object) + FOREACH_GROUP_OBJECT_BEGIN(group, object) { if (object && (object->id.tag & LIB_TAG_DOIT)) { BKE_copybuffer_tag_ID(&group->id); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 6727844d0a8..5edf2a2277c 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3988,7 +3988,7 @@ static void add_lightgroup(Render *re, Group *group, int exclusive) #if 0 /* it's a bit too many loops in loops... but will survive */ /* note that 'exclusive' will remove it from the global list */ - FOREACH_GROUP_BASE(group, base) + FOREACH_GROUP_BASE_BEGIN(group, base) { Object *object = base->object; @@ -4946,7 +4946,7 @@ static void dupli_render_particle_set(const EvaluationContext *eval_ctx, Render if (ob->dup_group == NULL) return; - FOREACH_GROUP_OBJECT(ob->dup_group, object) + FOREACH_GROUP_OBJECT_BEGIN(ob->dup_group, object) { dupli_render_particle_set(eval_ctx, re, object, timeoffset, level+1, enable); } @@ -4966,7 +4966,7 @@ static void add_group_render_dupli_obs(const EvaluationContext *eval_ctx, Render /* Recursively go into dupligroups to find objects with OB_RENDER_DUPLI * that were not created yet. */ - FOREACH_GROUP_OBJECT(group, ob) + FOREACH_GROUP_OBJECT_BEGIN(group, ob) { if (ob->flag & OB_DONE) { if (ob->transflag & OB_RENDER_DUPLI) { diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index dda1864f07c..ffaad615df2 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2059,7 +2059,7 @@ void BL_ConvertBlenderObjects(struct Main* maggie, for (git=tempglist.begin(); git!=tempglist.end(); git++) { Group* group = *git; - FOREACH_GROUP_OBJECT(group, blenderobject) + FOREACH_GROUP_OBJECT_BEGIN(group, blenderobject) { if (converter->FindGameObject(blenderobject) == NULL) { diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 48b50d24975..a521bc0c942 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -738,7 +738,7 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) m_groupGameObjects.clear(); group = blgroupobj->dup_group; - FOREACH_GROUP_BASE(group, base) + FOREACH_GROUP_BASE_BEGIN(group, base) { Object *blenderobj = base->object; if (blgroupobj == blenderobj) |