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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-18 16:08:11 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-18 16:08:11 +0300
commit955f7c92881c6b1d87b2aa71098dc8a989d6155b (patch)
tree08699ee89b9cfb5215b28d7f0dfe40bde131b0f0 /source
parent4f3af9980f61e8203016714a2314ca51e1902362 (diff)
Fix #20423: particle system deflection settings were not read correctly,
causing crashes on free and duplication.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 232af442a85..f2621a1b449 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3070,6 +3070,12 @@ static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointC
}
}
+void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
+{
+ if(pd && pd->tex)
+ pd->tex=newlibadr_us(fd, id->lib, pd->tex);
+}
+
static void lib_link_particlesettings(FileData *fd, Main *main)
{
ParticleSettings *part;
@@ -3086,6 +3092,9 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
part->eff_group = newlibadr(fd, part->id.lib, part->eff_group);
part->bb_ob = newlibadr(fd, part->id.lib, part->bb_ob);
+ lib_link_partdeflect(fd, &part->id, part->pd);
+ lib_link_partdeflect(fd, &part->id, part->pd2);
+
if(part->effector_weights)
part->effector_weights->group = newlibadr(fd, part->id.lib, part->effector_weights->group);
@@ -3122,12 +3131,20 @@ static void lib_link_particlesettings(FileData *fd, Main *main)
}
}
+static void direct_link_partdeflect(PartDeflect *pd)
+{
+ if(pd) pd->rng=NULL;
+}
+
static void direct_link_particlesettings(FileData *fd, ParticleSettings *part)
{
part->adt= newdataadr(fd, part->adt);
part->pd= newdataadr(fd, part->pd);
part->pd2= newdataadr(fd, part->pd2);
+ direct_link_partdeflect(part->pd);
+ direct_link_partdeflect(part->pd2);
+
part->effector_weights = newdataadr(fd, part->effector_weights);
if(!part->effector_weights)
part->effector_weights = BKE_add_effector_weights(part->eff_group);
@@ -3714,8 +3731,7 @@ static void lib_link_object(FileData *fd, Main *main)
/* texture field */
if(ob->pd)
- if(ob->pd->tex)
- ob->pd->tex=newlibadr_us(fd, ob->id.lib, ob->pd->tex);
+ lib_link_partdeflect(fd, &ob->id, ob->pd);
if(ob->soft)
ob->soft->effector_weights->group = newlibadr(fd, ob->id.lib, ob->soft->effector_weights->group);
@@ -4030,8 +4046,7 @@ static void direct_link_object(FileData *fd, Object *ob)
}
ob->pd= newdataadr(fd, ob->pd);
- if(ob->pd)
- ob->pd->rng=NULL;
+ direct_link_partdeflect(ob->pd);
ob->soft= newdataadr(fd, ob->soft);
if(ob->soft) {
SoftBody *sb= ob->soft;