diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-29 18:35:31 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-29 19:47:43 +0300 |
commit | 8e004062612e50789f081c795e7f39bf51ca3ae7 (patch) | |
tree | df25e892b1435c6bca20034d43adcacbeae029dd /source/blender/blenloader/intern | |
parent | ceb03a4d323ebe40e9d3bd3107ea1e7ffb22c02b (diff) |
Fix a bunch of missing expand calls in object/particle physics area, was breaking linking of those.
Initial report/patch by Alexander Gavrilov (@angavrilov), found more on the road.
Nice demo of why we should use libquery ID looper in read code too - but that's for another day
(also because read code needs to take care of some deprecated pointers sometimes)...
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d007eed0673..22e1507cd99 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8850,6 +8850,37 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting expand_doit(fd, mainvar, part->mtex[a]->object); } } + + if (part->effector_weights) { + expand_doit(fd, mainvar, part->effector_weights->group); + } + + if (part->pd) { + expand_doit(fd, mainvar, part->pd->tex); + expand_doit(fd, mainvar, part->pd->f_source); + } + if (part->pd2) { + expand_doit(fd, mainvar, part->pd2->tex); + expand_doit(fd, mainvar, part->pd2->f_source); + } + + if (part->boids) { + BoidState *state; + BoidRule *rule; + + for (state = part->boids->states.first; state; state = state->next) { + for (rule = state->rules.first; rule; rule = rule->next) { + if (rule->type == eBoidRuleType_Avoid) { + BoidRuleGoalAvoid *gabr = (BoidRuleGoalAvoid *)rule; + expand_doit(fd, mainvar, gabr->ob); + } + else if (rule->type == eBoidRuleType_FollowLeader) { + BoidRuleFollowLeader *flbr = (BoidRuleFollowLeader *)rule; + expand_doit(fd, mainvar, flbr->ob); + } + } + } + } } static void expand_group(FileData *fd, Main *mainvar, Group *group) @@ -9213,7 +9244,7 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) for (psys = ob->particlesystem.first; psys; psys = psys->next) expand_doit(fd, mainvar, psys->part); - + for (sens = ob->sensors.first; sens; sens = sens->next) { if (sens->type == SENS_MESSAGE) { bMessageSensor *ms = sens->data; @@ -9292,8 +9323,16 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) } } - if (ob->pd && ob->pd->tex) + if (ob->pd) { expand_doit(fd, mainvar, ob->pd->tex); + expand_doit(fd, mainvar, ob->pd->f_source); + } + + if (ob->soft) { + if (ob->soft->effector_weights) { + expand_doit(fd, mainvar, ob->soft->effector_weights->group); + } + } if (ob->rigidbody_constraint) { expand_doit(fd, mainvar, ob->rigidbody_constraint->ob1); |