From 7b05b2564d8f7ebe915ba212c0dbaf40be568cfc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 1 Feb 2019 13:56:13 +0100 Subject: Fix T61088: Cycles particle viewport render stuck in loop. Object to be instanced should not be modified. --- source/blender/blenkernel/intern/object_dupli.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index 98eda021d46..f727cbfcdae 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -732,8 +732,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem ParticleKey state; ParticleCacheKey *cache; float ctime, scale = 1.0f; - float tmat[4][4], mat[4][4], pamat[4][4], vec[3], size = 0.0; - float (*obmat)[4]; + float tmat[4][4], mat[4][4], pamat[4][4], size = 0.0; int a, b, hair = 0; int totpart, totchild; @@ -901,10 +900,6 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem b = a % totcollection; ob = oblist[b]; - obmat = oblist[b]->obmat; - } - else { - obmat = ob->obmat; } if (hair) { @@ -967,8 +962,12 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END; } else { + float obmat[4][4]; + copy_m4_m4(obmat, ob->obmat); + + float vec[3]; copy_v3_v3(vec, obmat[3]); - obmat[3][0] = obmat[3][1] = obmat[3][2] = 0.0f; + zero_v3(obmat[3]); /* particle rotation uses x-axis as the aligned axis, so pre-rotate the object accordingly */ if ((part->draw & PART_DRAW_ROTATE_OB) == 0) { -- cgit v1.2.3