From 824bf261f773465fd3463d39725143ba827a5808 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 1 Jun 2017 15:26:47 +0200 Subject: Initial implememtation for dupli objects Now dupli groups, objects, particles, ... are all working. This introduces a flag for the iterator to determine whether we go over Set and dupli objects or not. Important to remember to keep the iteration of DEG_ as readonly. Cycles is not working well for dupli groups, and it's memleaking for dupli particles. So for now we iterate over main objects and set only, not dupli. To change that go in rna_scene.c and: -DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_SET) +DEG_OBJECT_ITER(graph, ob, DEG_OBJECT_ITER_FLAG_ALL) Review and suggestions by Sergey Sharybin --- source/blender/makesrna/intern/rna_depsgraph.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_depsgraph.c') diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c index d90f754bf23..d992e88431c 100644 --- a/source/blender/makesrna/intern/rna_depsgraph.c +++ b/source/blender/makesrna/intern/rna_depsgraph.c @@ -86,9 +86,13 @@ static void rna_Depsgraph_debug_stats(Depsgraph *graph, ReportList *reports) static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { - Depsgraph *graph = (Depsgraph *)ptr->data; iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__); - DEG_objects_iterator_begin(iter->internal.custom, graph); + DEGObjectsIteratorData *data = MEM_callocN(sizeof(DEGObjectsIteratorData), __func__); + + data->graph = (Depsgraph *)ptr->data; + data->flag = DEG_OBJECT_ITER_FLAG_ALL; + + DEG_objects_iterator_begin(iter->internal.custom, data); iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid; } @@ -101,6 +105,7 @@ static void rna_Depsgraph_objects_next(CollectionPropertyIterator *iter) static void rna_Depsgraph_objects_end(CollectionPropertyIterator *iter) { DEG_objects_iterator_end(iter->internal.custom); + MEM_freeN(((BLI_Iterator *)iter->internal.custom)->data); MEM_freeN(iter->internal.custom); } -- cgit v1.2.3