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:
@@ -2249,8 +2249,16 @@ DerivedMesh *mesh_create_derived_view(Scene *scene, Object *ob, CustomDataMask d
|
||||
{
|
||||
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);
|
||||
|
||||
ob->transflag &= ~OB_NO_PSYS_UPDATE;
|
||||
|
||||
return final;
|
||||
}
|
||||
|
||||
|
@@ -378,6 +378,7 @@ typedef struct DupliObject {
|
||||
#define OB_DUPLIPARTS 2048
|
||||
#define OB_RENDER_DUPLI 4096
|
||||
#define OB_NO_CONSTRAINTS 8192 /* runtime constraints disable */
|
||||
#define OB_NO_PSYS_UPDATE 16384 /* hack to work around particle issue */
|
||||
|
||||
/* (short) ipoflag */
|
||||
/* XXX: many old flags for features removed due to incompatibility
|
||||
|
@@ -190,12 +190,7 @@ static void deformVerts(ModifierData *md, Object *ob,
|
||||
psmd->totdmface = psmd->dm->getNumTessFaces(psmd->dm);
|
||||
}
|
||||
|
||||
/* 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) {
|
||||
if (!(ob->transflag & OB_NO_PSYS_UPDATE)) {
|
||||
psmd->flag &= ~eParticleSystemFlag_psys_updated;
|
||||
particle_system_update(md->scene, ob, psys);
|
||||
psmd->flag |= eParticleSystemFlag_psys_updated;
|
||||
|
Reference in New Issue
Block a user