diff options
author | Janne Karhu <jhkarh@gmail.com> | 2008-09-16 22:40:54 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2008-09-16 22:40:54 +0400 |
commit | 0922ecee93e09e0d608710a0e82258ecaba949d1 (patch) | |
tree | 37db8b660e6ad314a7bb5a150316595837d30590 /source/blender/blenloader/intern | |
parent | 80458f69b29685559c045b068a4383a7684df50c (diff) |
"Fix" for #17636 Crashing bug - won't open a file
- The cause was indeed corrupted particle settings which should have caused a deletion of the whole particle system. However the particle modifier was still left and that led to the crash.
- A "fix" because there's really no way of knowing what caused the corruption of the particle settings. If anyone else gets this and can recreate I'd love to get a .blend. Now that there shouldn't be a crash anymore the symptom will be a missing particle system after file load in an object that had a particle system before.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8865e3bb173..6add88284c2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2596,7 +2596,7 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) part->pd2= newdataadr(fd, part->pd2); } -static void lib_link_particlesystems(FileData *fd, ID *id, ListBase *particles) +static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase *particles) { ParticleSystem *psys, *psysnext; int a; @@ -2616,6 +2616,11 @@ static void lib_link_particlesystems(FileData *fd, ID *id, ListBase *particles) } } else { + /* particle modifier must be removed before particle system */ + ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys); + BLI_remlink(&ob->modifiers, psmd); + modifier_free((ModifierData *)psmd); + BLI_remlink(particles, psys); MEM_freeN(psys); } @@ -3069,7 +3074,7 @@ static void lib_link_object(FileData *fd, Main *main) ob->pd->tex=newlibadr_us(fd, ob->id.lib, ob->pd->tex); lib_link_scriptlink(fd, &ob->id, &ob->scriptlink); - lib_link_particlesystems(fd, &ob->id, &ob->particlesystem); + lib_link_particlesystems(fd, ob, &ob->id, &ob->particlesystem); lib_link_modifiers(fd, ob); } ob= ob->id.next; |