diff options
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index f19f9a65bb5..8ce5c6387a5 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -146,6 +146,10 @@ void BKE_visible_objects_Iterator_begin(Iterator *iter, void *data_in); void BKE_visible_objects_Iterator_next(Iterator *iter); void BKE_visible_objects_Iterator_end(Iterator *iter); +void BKE_selected_bases_Iterator_begin(Iterator *iter, void *data_in); +void BKE_selected_bases_Iterator_next(Iterator *iter); +void BKE_selected_bases_Iterator_end(Iterator *iter); + void BKE_visible_bases_Iterator_begin(Iterator *iter, void *data_in); void BKE_visible_bases_Iterator_next(Iterator *iter); void BKE_visible_bases_Iterator_end(Iterator *iter); @@ -168,6 +172,14 @@ void BKE_visible_bases_Iterator_end(Iterator *iter); #define FOREACH_VISIBLE_OBJECT_END \ ITER_END +#define FOREACH_SELECTED_BASE(sl, _instance) \ + ITER_BEGIN(BKE_selected_bases_Iterator_begin, \ + BKE_selected_bases_Iterator_next, \ + BKE_selected_bases_Iterator_end, \ + sl, Base *, _instance) + +#define FOREACH_SELECTED_BASE_END \ + ITER_END #define FOREACH_VISIBLE_BASE(sl, _instance) \ ITER_BEGIN(BKE_visible_bases_Iterator_begin, \ diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 4b9b77e7b82..c25b6b686cd 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1343,6 +1343,21 @@ void BKE_visible_objects_Iterator_end(Iterator *UNUSED(iter)) /* do nothing */ } +void BKE_selected_bases_Iterator_begin(Iterator *iter, void *data_in) +{ + object_bases_Iterator_begin(iter, data_in, BASE_SELECTED); +} + +void BKE_selected_bases_Iterator_next(Iterator *iter) +{ + object_bases_Iterator_next(iter, BASE_SELECTED); +} + +void BKE_selected_bases_Iterator_end(Iterator *UNUSED(iter)) +{ + /* do nothing */ +} + void BKE_visible_bases_Iterator_begin(Iterator *iter, void *data_in) { object_bases_Iterator_begin(iter, data_in, BASE_VISIBLED); |