diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-05-30 20:09:16 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-05-30 20:09:16 +0400 |
commit | 0882438832bb9a3d9a3b4b8341a6095b2357d5bc (patch) | |
tree | a89e5b096eb520660b27ff2099b9e38945682183 /source/blender/blenkernel/intern | |
parent | a836aad094599f19fdd14ea28ff6e180c50967e9 (diff) |
Disable using own emitter object (self) as dupliobject/group for particles, fixes bugs:
[#21994] hair particle system with dupli object set to particle system object itself results in 100% cpu usage
[#22023] [Rev 28117]Can't bake particles?
[#22065] in a particle system, setting the emitter as the dupli object crashes blender after pressing alt+a to animate
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 82168fddd8f..20afc715c77 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1188,11 +1188,21 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p BLI_srandom(31415926 + psys->seed); lay= scene->lay; - if((psys->renderdata || part->draw_as==PART_DRAW_REND) && - ((part->ren_as == PART_DRAW_OB && part->dup_ob) || - (part->ren_as == PART_DRAW_GR && part->dup_group && part->dup_group->gobject.first))) { + if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { - psys_check_group_weights(part); + /* first check for loops (particle system object used as dupli object) */ + if(part->ren_as == PART_DRAW_OB) { + if(ELEM(part->dup_ob, NULL, par)) + return; + } + else { /*PART_DRAW_GR */ + if(part->dup_group == NULL || part->dup_group->gobject.first == NULL) + return; + + for(go=part->dup_group->gobject.first; go; go=go->next) + if(go->ob == par) + return; + } /* if we have a hair particle system, use the path cache */ if(part->type == PART_HAIR) { @@ -1206,6 +1216,8 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p totpart = psys->totcached; } + psys_check_group_weights(part); + psys->lattice = psys_get_lattice(&sim); /* gather list of objects or single object */ |