forked from bartvdbraak/blender
Bug fix: unbaked particle cache was cleared from current frame onwards on file load.
This commit is contained in:
parent
b9fe5399e8
commit
a601fd8893
@ -3927,9 +3927,10 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
|
|||||||
} else if (md->type==eModifierType_ParticleSystem) {
|
} else if (md->type==eModifierType_ParticleSystem) {
|
||||||
ParticleSystemModifierData *psmd = (ParticleSystemModifierData*) md;
|
ParticleSystemModifierData *psmd = (ParticleSystemModifierData*) md;
|
||||||
|
|
||||||
psmd->dm=0;
|
psmd->dm= NULL;
|
||||||
psmd->psys=newdataadr(fd, psmd->psys);
|
psmd->psys= newdataadr(fd, psmd->psys);
|
||||||
psmd->flag &= ~eParticleSystemFlag_psys_updated;
|
psmd->flag &= ~eParticleSystemFlag_psys_updated;
|
||||||
|
psmd->flag |= eParticleSystemFlag_file_loaded;
|
||||||
} else if (md->type==eModifierType_Explode) {
|
} else if (md->type==eModifierType_Explode) {
|
||||||
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
|
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
|
||||||
|
|
||||||
|
@ -550,6 +550,7 @@ typedef struct MeshDeformModifierData {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
eParticleSystemFlag_Pars = (1<<0),
|
eParticleSystemFlag_Pars = (1<<0),
|
||||||
eParticleSystemFlag_psys_updated = (1<<1),
|
eParticleSystemFlag_psys_updated = (1<<1),
|
||||||
|
eParticleSystemFlag_file_loaded = (1<<2),
|
||||||
} ParticleSystemModifierFlag;
|
} ParticleSystemModifierFlag;
|
||||||
|
|
||||||
typedef struct ParticleSystemModifierData {
|
typedef struct ParticleSystemModifierData {
|
||||||
|
@ -154,6 +154,10 @@ static void deformVerts(ModifierData *md, Object *ob,
|
|||||||
psmd->dm->needsFree = 1;
|
psmd->dm->needsFree = 1;
|
||||||
psmd->dm->release(psmd->dm);
|
psmd->dm->release(psmd->dm);
|
||||||
}
|
}
|
||||||
|
else if(psmd->flag & eParticleSystemFlag_file_loaded) {
|
||||||
|
/* in file read dm just wasn't saved in file so no need to reset everything */
|
||||||
|
psmd->flag &= ~eParticleSystemFlag_file_loaded;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* no dm before, so recalc particles fully */
|
/* no dm before, so recalc particles fully */
|
||||||
psys->recalc |= PSYS_RECALC_RESET;
|
psys->recalc |= PSYS_RECALC_RESET;
|
||||||
@ -176,7 +180,6 @@ static void deformVerts(ModifierData *md, Object *ob,
|
|||||||
if(psmd->dm->getNumVerts(psmd->dm)!=psmd->totdmvert ||
|
if(psmd->dm->getNumVerts(psmd->dm)!=psmd->totdmvert ||
|
||||||
psmd->dm->getNumEdges(psmd->dm)!=psmd->totdmedge ||
|
psmd->dm->getNumEdges(psmd->dm)!=psmd->totdmedge ||
|
||||||
psmd->dm->getNumFaces(psmd->dm)!=psmd->totdmface){
|
psmd->dm->getNumFaces(psmd->dm)!=psmd->totdmface){
|
||||||
/* in file read dm hasn't really changed but just wasn't saved in file */
|
|
||||||
|
|
||||||
psys->recalc |= PSYS_RECALC_RESET;
|
psys->recalc |= PSYS_RECALC_RESET;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user