diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 58 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_smoke.c | 13 |
2 files changed, 28 insertions, 43 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a304084c7b2..e8fa56c4b01 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12301,50 +12301,19 @@ static void expand_armature(FileData *fd, Main *mainvar, bArmature *arm) } } -static void expand_modifier(FileData *fd, Main *mainvar, ModifierData *md) +static void expand_object_expandModifiers(void *userData, Object *UNUSED(ob), + ID **idpoin) { - if (md->type==eModifierType_Lattice) { - LatticeModifierData *lmd = (LatticeModifierData*) md; - - expand_doit(fd, mainvar, lmd->object); - } - else if (md->type==eModifierType_Curve) { - CurveModifierData *cmd = (CurveModifierData*) md; - - expand_doit(fd, mainvar, cmd->object); - } - else if (md->type==eModifierType_Array) { - ArrayModifierData *amd = (ArrayModifierData*) md; - - expand_doit(fd, mainvar, amd->curve_ob); - expand_doit(fd, mainvar, amd->offset_ob); - } - else if (md->type==eModifierType_Mirror) { - MirrorModifierData *mmd = (MirrorModifierData*) md; - - expand_doit(fd, mainvar, mmd->mirror_ob); - } - else if (md->type==eModifierType_Displace) { - DisplaceModifierData *dmd = (DisplaceModifierData*) md; - - expand_doit(fd, mainvar, dmd->map_object); - expand_doit(fd, mainvar, dmd->texture); - } - else if (md->type==eModifierType_Smoke) { - SmokeModifierData *smd = (SmokeModifierData*) md; - - if(smd->type==MOD_SMOKE_TYPE_DOMAIN && smd->domain) - { - expand_doit(fd, mainvar, smd->domain->coll_group); - expand_doit(fd, mainvar, smd->domain->fluid_group); - expand_doit(fd, mainvar, smd->domain->eff_group); - } - } + struct { FileData *fd; Main *mainvar; } *data= userData; + + FileData *fd= data->fd; + Main *mainvar= data->mainvar; + + expand_doit(fd, mainvar, *idpoin); } static void expand_object(FileData *fd, Main *mainvar, Object *ob) { - ModifierData *md; ParticleSystem *psys; bSensor *sens; bController *cont; @@ -12354,9 +12323,14 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) int a; expand_doit(fd, mainvar, ob->data); - - for (md=ob->modifiers.first; md; md=md->next) { - expand_modifier(fd, mainvar, md); + + /* expand_object_expandModifier() */ + if(ob->modifiers.first) { + struct { FileData *fd; Main *mainvar; } data; + data.fd= fd; + data.mainvar= mainvar; + + modifiers_foreachIDLink(ob, expand_object_expandModifiers, (void *)&data); } expand_pose(fd, mainvar, ob->pose); diff --git a/source/blender/modifiers/intern/MOD_smoke.c b/source/blender/modifiers/intern/MOD_smoke.c index b13d86a609e..d8e94e92bfa 100644 --- a/source/blender/modifiers/intern/MOD_smoke.c +++ b/source/blender/modifiers/intern/MOD_smoke.c @@ -147,6 +147,17 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, } } +static void foreachIDLink(ModifierData *md, Object *ob, + IDWalkFunc walk, void *userData) +{ + SmokeModifierData *smd = (SmokeModifierData*) md; + + if(smd->type==MOD_SMOKE_TYPE_DOMAIN && smd->domain) { + walk(userData, ob, (ID **)&smd->domain->coll_group); + walk(userData, ob, (ID **)&smd->domain->fluid_group); + walk(userData, ob, (ID **)&smd->domain->eff_group); + } +} ModifierTypeInfo modifierType_Smoke = { /* name */ "Smoke", @@ -172,5 +183,5 @@ ModifierTypeInfo modifierType_Smoke = { /* dependsOnTime */ dependsOnTime, /* dependsOnNormals */ NULL, /* foreachObjectLink */ NULL, - /* foreachIDLink */ NULL, + /* foreachIDLink */ foreachIDLink, }; |