Better fix for #32846. Instead of using time change or object recalc condition, set an explicit object flag to disable particle system modifier update during dupli list creation. This is more transparent and should prevent issues with hair path generation being skipped.

This commit is contained in:
Lukas Toenne
2012-10-18 15:54:24 +00:00
parent 497ea5f306
commit d3eb9dddd6
3 changed files with 10 additions and 6 deletions

View File

@@ -2249,8 +2249,16 @@ DerivedMesh *mesh_create_derived_view(Scene *scene, Object *ob, CustomDataMask d
{ {
DerivedMesh *final; DerivedMesh *final;
/* XXX hack
* psys modifier updates particle state when called during dupli-list generation,
* which can lead to wrong transforms. This disables particle system modifier execution.
*/
ob->transflag |= OB_NO_PSYS_UPDATE;
mesh_calc_modifiers(scene, ob, NULL, NULL, &final, 0, 1, 0, dataMask, -1, 0, 0); mesh_calc_modifiers(scene, ob, NULL, NULL, &final, 0, 1, 0, dataMask, -1, 0, 0);
ob->transflag &= ~OB_NO_PSYS_UPDATE;
return final; return final;
} }

View File

@@ -378,6 +378,7 @@ typedef struct DupliObject {
#define OB_DUPLIPARTS 2048 #define OB_DUPLIPARTS 2048
#define OB_RENDER_DUPLI 4096 #define OB_RENDER_DUPLI 4096
#define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */ #define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */
#define OB_NO_PSYS_UPDATE 16384 /* hack to work around particle issue */
/* (short) ipoflag */ /* (short) ipoflag */
/* XXX: many old flags for features removed due to incompatibility /* XXX: many old flags for features removed due to incompatibility

View File

@@ -190,12 +190,7 @@ static void deformVerts(ModifierData *md, Object *ob,
psmd->totdmface = psmd->dm->getNumTessFaces(psmd->dm); psmd->totdmface = psmd->dm->getNumTessFaces(psmd->dm);
} }
/* skip the particle update if no timestep is performed or initialization required. if (!(ob->transflag & OB_NO_PSYS_UPDATE)) {
* 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; psmd->flag &= ~eParticleSystemFlag_psys_updated;
particle_system_update(md->scene, ob, psys); particle_system_update(md->scene, ob, psys);
psmd->flag |= eParticleSystemFlag_psys_updated; psmd->flag |= eParticleSystemFlag_psys_updated;