diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-04-20 19:59:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-04-21 10:56:26 +0300 |
commit | 01a627dac950062cf79214426ab086bd11edbaaf (patch) | |
tree | 9fb8b7db7f0215d193c0412f75bab4fd10436533 /source/blender/blenkernel | |
parent | 3a75e84376e291cc415f3405ebd32eaec671e0ee (diff) |
Include the set in the depsgraph objects iterator
Pending: Include the set in the rna depsgraph.objects
In fact it would be nice to unify them both. However this will likely
change once Depsgraph incorporate this iterator, so I'm not sure we
should bother with that.
Related to T51203
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index e1aaf39e2a3..b91ff82dc9f 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -216,20 +216,30 @@ void BKE_visible_bases_Iterator_end(Iterator *iter); } /* temporary hacky solution waiting for CoW depsgraph implementation */ -#define DEG_OBJECT_ITER(sl_, instance_) \ +#define DEG_OBJECT_ITER(graph_, instance_) \ { \ + Scene *sce_, *scene_ = DAG_get_scene(graph_); \ + SceneLayer *sl_ = DAG_get_scene_layer(graph_); \ + int flag_ = ~(BASE_FROM_SET); \ + \ /* flush all the depsgraph data to objects */ \ Object *instance_; \ Base *base_; \ - for (base_ = (sl_)->object_bases.first; base_; base_ = base_->next) { \ - if ((base_->flag & BASE_VISIBLED) != 0) { \ - instance_ = base_->object; \ - instance_->base_flag = base_->flag; \ - instance_->base_collection_properties = base_->collection_properties; + for(sce_ = scene_; sce_; sce_ = sce_->set) { \ + for (base_ = (sl_)->object_bases.first; base_; base_ = base_->next) { \ + if ((base_->flag & BASE_VISIBLED) != 0) { \ + instance_ = base_->object; \ + instance_->base_flag = (base_->flag | BASE_FROM_SET) & flag_; \ + instance_->base_collection_properties = base_->collection_properties; #define DEG_OBJECT_ITER_END \ - } \ - } \ + } \ + } \ + if (sce_->set) { \ + sl_ = BKE_scene_layer_render_active(sce_->set); \ + flag_ = ~(BASE_SELECTED | BASE_SELECTABLED); \ + } \ + } \ } #ifdef __cplusplus |