diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-06-01 16:26:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-06-02 11:45:45 +0300 |
commit | 824bf261f773465fd3463d39725143ba827a5808 (patch) | |
tree | d56204f12bda0951e8c313d3f26cd98193c152e7 /source/blender/makesrna/intern/rna_depsgraph.c | |
parent | f8ea2c92db4a49b2de8bd3059190d2342380c03c (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_depsgraph.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_depsgraph.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); } |