diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-12 19:24:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-13 12:47:29 +0300 |
commit | 199715eabccce8d91cd4f9705762305e8f236b8c (patch) | |
tree | dd3acc4f8609215617c5df0783c79275f4321eb7 /source/blender/blenkernel/intern/pointcache.c | |
parent | d8bdd7b261d2ac6936e16fd04845d0e491931a87 (diff) |
Point cache: stop using general object dupli system.
We now only look into dupli groups to find point caches to edit. This
feature is a leftover from the old proxy system, and evaluating the
full dupli list and all transforms was overkill. With static overrides
we may want to get rid of using duplis entirely, and just let users
select the objects directly.
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 27588afea93..afaf68dde24 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -38,6 +38,7 @@ #include "DNA_ID.h" #include "DNA_dynamicpaint_types.h" +#include "DNA_group_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "DNA_object_force_types.h" @@ -1733,22 +1734,19 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup BLI_addtail(lb, pid); } - if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) { - ListBase *lb_dupli_ob; - /* don't update the dupli groups, we only want their pid's */ - if ((lb_dupli_ob = object_duplilist_ex(G.main->eval_ctx, scene, ob, false))) { - DupliObject *dob; - for (dob= lb_dupli_ob->first; dob; dob= dob->next) { - if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */ - ListBase lb_dupli_pid; - BKE_ptcache_ids_from_object(&lb_dupli_pid, dob->ob, scene, duplis); - BLI_movelisttolist(lb, &lb_dupli_pid); - if (lb_dupli_pid.first) - printf("Adding Dupli\n"); - } - } + /* Consider all object in dupli groups to be part of the same object, + * for baking with linking dupligroups. Once we have better overrides + * this can be revisited so users select the local objects directly. */ + if (scene && (duplis-- > 0) && (ob->dup_group)) { + Group *group = ob->dup_group; + Base *base = group->view_layer->object_bases.first; - free_object_duplilist(lb_dupli_ob); /* does restore */ + for (; base; base = base->next) { + if (base->object != ob) { + ListBase lb_dupli_pid; + BKE_ptcache_ids_from_object(&lb_dupli_pid, base->object, scene, duplis); + BLI_movelisttolist(lb, &lb_dupli_pid); + } } } } |