From b29790a953ff0f31c431daaaa2864e48bd38e94c Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 18 Mar 2019 17:53:03 +0100 Subject: Fix T62587: Particle instances Use Count not saved correctly Reviewers: brecht Differential Revision: https://developer.blender.org/D4544 --- source/blender/blenloader/intern/writefile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/writefile.c') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c2cd6f282e8..ebc46d7573b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1422,9 +1422,10 @@ static void write_particlesettings(WriteData *wd, ParticleSettings *part) if (part->instance_collection) { /* can be NULL if lining fails or set to None */ FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(part->instance_collection, object) { - if (object != dw->ob) { - dw->index++; + if (object == dw->ob) { + break; } + dw->index++; } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } -- cgit v1.2.3