diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-15 12:51:16 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-15 13:59:04 +0300 |
commit | 90b79176870e56b55f5c72a8943a502bfe78c7b0 (patch) | |
tree | c8863c9a6c1ed87cfe8d9e7ea414a6e3f25a3475 /source/blender/makesrna | |
parent | 3a47fb764cdc4731aa3c386cffb08f5146018c4b (diff) |
Depsgraph: Make DEG_OBJECT_ITER more granular
It is not nice to assume we always want visible or directly linked objects.
So we make it as granular as we can.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index 7d520ec6abd..eb32a85afa7 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -152,7 +152,9 @@ static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, Pointe DEGOIterObjectData *data = MEM_callocN(sizeof(DEGOIterObjectData), __func__); data->graph = (Depsgraph *)ptr->data; - data->flag = DEG_ITER_OBJECT_FLAG_SET; + data->flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | + DEG_ITER_OBJECT_FLAG_VISIBLE | + DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET; ((BLI_Iterator *)iter->internal.custom)->valid = true; DEG_iterator_objects_begin(iter->internal.custom, data); @@ -189,7 +191,10 @@ static void rna_Depsgraph_duplis_begin(CollectionPropertyIterator *iter, Pointer DEGOIterObjectData *data = MEM_callocN(sizeof(DEGOIterObjectData), __func__); data->graph = (Depsgraph *)ptr->data; - data->flag = DEG_ITER_OBJECT_FLAG_ALL; + data->flag = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | + DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | + DEG_ITER_OBJECT_FLAG_VISIBLE | + DEG_ITER_OBJECT_FLAG_DUPLI; ((BLI_Iterator *)iter->internal.custom)->valid = true; DEG_iterator_objects_begin(iter->internal.custom, data); diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 11e35bed9ee..00b08957fdd 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -70,7 +70,6 @@ const EnumPropertyItem rna_enum_collection_type_items[] = { #include "BKE_idprop.h" #include "BKE_layer.h" #include "BKE_node.h" -#include "BKE_object.h" #include "BKE_scene.h" #include "BKE_mesh.h" @@ -871,7 +870,12 @@ static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, Po static void rna_ViewLayer_update_tagged(ViewLayer *UNUSED(view_layer), bContext *C) { Depsgraph *graph = CTX_data_depsgraph(C); - DEG_OBJECT_ITER(graph, ob, DEG_ITER_OBJECT_FLAG_ALL) + DEG_OBJECT_ITER(graph, ob, + DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | + DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | + DEG_ITER_OBJECT_FLAG_LINKED_INDIRECTLY | + DEG_ITER_OBJECT_FLAG_VISIBLE | + DEG_ITER_OBJECT_FLAG_DUPLI) { /* Don't do anything, we just need to run the iterator to flush * the base info to the objects. */ |