Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-10-16 18:55:36 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-10-16 18:55:36 +0400
commit66295d709cf271ec8d761763f2c3e757d86f02da (patch)
tree714b88cf3f2064b78d65bbf8d5d78062b301ffdf /source/blender/modifiers
parenteb771c78cd1199cd35af7ded4d4a13f8a62430c6 (diff)
Fix/workaround #32846, dupli group + particle instances gets messed up in Cycles viewport rendering.
Caused by modifier updates during dupli-list generation. The dupli-list generation temporarily changes the ob->obmat matrix, which in turn leads to wrong particle states if used for reset. Skip the particle update if no timestep is performed or initialization required. Proper solution for this problem would be to avoid changing the object data (= particles) state altogether in modifiers, which are usually only writing to DM data and not touching the object or base mesh. This would require a well designed physics framework and integrating it into current particles is close to impossible.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 254c02b7672..c4db9375a4a 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -44,6 +44,7 @@
#include "BKE_material.h"
#include "BKE_modifier.h"
#include "BKE_particle.h"
+#include "BKE_scene.h"
#include "MOD_util.h"
@@ -130,6 +131,7 @@ static void deformVerts(ModifierData *md, Object *ob,
ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
ParticleSystem *psys = NULL;
int needsFree = 0;
+ float cfra = BKE_scene_frame_get(md->scene);
if (ob->particlesystem.first)
psys = psmd->psys;
@@ -188,9 +190,16 @@ static void deformVerts(ModifierData *md, Object *ob,
psmd->totdmface = psmd->dm->getNumTessFaces(psmd->dm);
}
- psmd->flag &= ~eParticleSystemFlag_psys_updated;
- particle_system_update(md->scene, ob, psys);
- psmd->flag |= eParticleSystemFlag_psys_updated;
+ /* skip the particle update if no timestep is performed or initialization required.
+ * XXX this is a workaround for bug #32846, which is caused by modifier updates
+ * during dupli-list generation (in cycles). The dupli-list generation can temporarily change
+ * the ob->obmat matrix, which in turn leads to wrong particle states if used for reset ...
+ */
+ if (psys->cfra != cfra || psys->recalc) {
+ psmd->flag &= ~eParticleSystemFlag_psys_updated;
+ particle_system_update(md->scene, ob, psys);
+ psmd->flag |= eParticleSystemFlag_psys_updated;
+ }
}
/* disabled particles in editmode for now, until support for proper derivedmesh