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
path: root/source
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2011-01-07 20:27:27 +0300
committerJanne Karhu <jhkarh@gmail.com>2011-01-07 20:27:27 +0300
commita601fd889331c319803daa7505c2c8016f15a47f (patch)
tree3b6bf756a2558c578943fc135bbf254794557456 /source
parentb9fe5399e83c71ffce44f766b4c8bce92e40bc46 (diff)
Bug fix: unbaked particle cache was cleared from current frame onwards on file load.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c5
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h1
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c5
3 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 7aca496d9ab..38476b0bcc2 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3927,9 +3927,10 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb)
} else if (md->type==eModifierType_ParticleSystem) {
ParticleSystemModifierData *psmd = (ParticleSystemModifierData*) md;
- psmd->dm=0;
- psmd->psys=newdataadr(fd, psmd->psys);
+ psmd->dm= NULL;
+ psmd->psys= newdataadr(fd, psmd->psys);
psmd->flag &= ~eParticleSystemFlag_psys_updated;
+ psmd->flag |= eParticleSystemFlag_file_loaded;
} else if (md->type==eModifierType_Explode) {
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 3f6124c7fa1..1c8610461be 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -550,6 +550,7 @@ typedef struct MeshDeformModifierData {
typedef enum {
eParticleSystemFlag_Pars = (1<<0),
eParticleSystemFlag_psys_updated = (1<<1),
+ eParticleSystemFlag_file_loaded = (1<<2),
} ParticleSystemModifierFlag;
typedef struct ParticleSystemModifierData {
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index f2b580aca9a..d7e61b7210e 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -154,6 +154,10 @@ static void deformVerts(ModifierData *md, Object *ob,
psmd->dm->needsFree = 1;
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 {
/* no dm before, so recalc particles fully */
psys->recalc |= PSYS_RECALC_RESET;
@@ -176,7 +180,6 @@ static void deformVerts(ModifierData *md, Object *ob,
if(psmd->dm->getNumVerts(psmd->dm)!=psmd->totdmvert ||
psmd->dm->getNumEdges(psmd->dm)!=psmd->totdmedge ||
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;