diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-26 09:22:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-26 09:22:24 +0400 |
commit | f30ab48dacdd26b797579c533af79658ac7bd8dc (patch) | |
tree | 55a29cf86f6586887d93387d96b09a8b089d6266 /source/blender/blenloader | |
parent | 1794ab47c5fcffad690c4e79af7cf3b3c8ab4284 (diff) |
fix [#26712] Particle group instance 'Use Count' value gets reset on file-load.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0ae69bd2a56..6152a8fa914 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3398,32 +3398,31 @@ static void lib_link_particlesettings(FileData *fd, Main *main) if (part->dupliweights.first && part->dup_group) { int index_ok = 0; /* check for old files without indices (all indexes 0) */ - dw = part->dupliweights.first; if (part->dupliweights.first == part->dupliweights.last) { /* special case for only one object in the group */ index_ok = 1; } else { - for (; dw; dw=dw->next) { + for (dw = part->dupliweights.first; dw; dw = dw->next) { if (dw->index > 0) { index_ok = 1; break; } } } - + if (index_ok) { /* if we have indexes, let's use them */ - dw = part->dupliweights.first; - for (; dw; dw=dw->next) { + for (dw = part->dupliweights.first; dw; dw = dw->next) { GroupObject *go = (GroupObject *)BLI_findlink(&part->dup_group->gobject, dw->index); dw->ob = go ? go->ob : NULL; } } else { /* otherwise try to get objects from own library (won't work on library linked groups) */ - for (; dw; dw=dw->next) + for (dw = part->dupliweights.first; dw; dw = dw->next) { dw->ob = newlibadr(fd, part->id.lib, dw->ob); + } } } else { |