Fix T61088: Cycles particle viewport render stuck in loop.

Object to be instanced should not be modified.
This commit is contained in:
Brecht Van Lommel 2019-02-01 13:56:13 +01:00
parent 7f0e773dcd
commit 7b05b2564d
Notes: blender-bot 2023-02-14 03:52:46 +01:00
Referenced by issue #61103, Mirrored objects render black when using the Bevel Node
Referenced by issue #61109, particle object sticks at emitter
Referenced by issue #61088, Particles make cycles viewport preview loop on 1 sample only
1 changed files with 6 additions and 7 deletions

View File

@ -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) {