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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c426
1 files changed, 163 insertions, 263 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index da2ef97570d..37fcf10e553 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -121,7 +121,7 @@
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_library.h"
-#include "BKE_library_idmap.h"
+#include "BKE_main_idmap.h"
#include "BKE_library_override.h"
#include "BKE_library_query.h"
#include "BKE_main.h" // for Main
@@ -2613,7 +2613,29 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
/** \name Read ID
* \{ */
-static void lib_link_id(FileData *fd, Main *UNUSED(bmain), ID *id)
+static void lib_link_id(FileData *fd, Main *bmain, ID *id);
+static void lib_link_nodetree(FileData *fd, Main *bmain, bNodeTree *ntree);
+static void lib_link_collection(FileData *fd, Main *bmain, Collection *collection);
+
+static void lib_link_id_private_id(FileData *fd, Main *bmain, ID *id)
+{
+ /* Handle 'private IDs'. */
+ bNodeTree *nodetree = ntreeFromID(id);
+ if (nodetree != NULL) {
+ lib_link_id(fd, bmain, &nodetree->id);
+ lib_link_nodetree(fd, bmain, nodetree);
+ }
+
+ if (GS(id->name) == ID_SCE) {
+ Scene *scene = (Scene *)id;
+ if (scene->master_collection != NULL) {
+ lib_link_id(fd, bmain, &scene->master_collection->id);
+ lib_link_collection(fd, bmain, scene->master_collection);
+ }
+ }
+}
+
+static void lib_link_id(FileData *fd, Main *bmain, ID *id)
{
/* Note: WM IDProperties are never written to file, hence they should always be NULL here. */
BLI_assert((GS(id->name) != ID_WM) || id->properties == NULL);
@@ -2628,6 +2650,8 @@ static void lib_link_id(FileData *fd, Main *UNUSED(bmain), ID *id)
id->override_library->reference = newlibadr_us(fd, id->lib, id->override_library->reference);
id->override_library->storage = newlibadr_us(fd, id->lib, id->override_library->storage);
}
+
+ lib_link_id_private_id(fd, bmain, id);
}
static void direct_link_id_override_property_operation_cb(FileData *fd, void *data)
@@ -2646,6 +2670,30 @@ static void direct_link_id_override_property_cb(FileData *fd, void *data)
link_list_ex(fd, &op->operations, direct_link_id_override_property_operation_cb);
}
+static void direct_link_id(FileData *fd, ID *id);
+static void direct_link_nodetree(FileData *fd, bNodeTree *ntree);
+static void direct_link_collection(FileData *fd, Collection *collection);
+
+static void direct_link_id_private_id(FileData *fd, ID *id)
+{
+ /* Handle 'private IDs'. */
+ bNodeTree **nodetree = BKE_ntree_ptr_from_id(id);
+ if (nodetree != NULL && *nodetree != NULL) {
+ *nodetree = newdataadr(fd, *nodetree);
+ direct_link_id(fd, (ID *)*nodetree);
+ direct_link_nodetree(fd, *nodetree);
+ }
+
+ if (GS(id->name) == ID_SCE) {
+ Scene *scene = (Scene *)id;
+ if (scene->master_collection != NULL) {
+ scene->master_collection = newdataadr(fd, scene->master_collection);
+ direct_link_id(fd, &scene->master_collection->id);
+ direct_link_collection(fd, scene->master_collection);
+ }
+ }
+}
+
static void direct_link_id(FileData *fd, ID *id)
{
/*link direct data of ID properties*/
@@ -2685,6 +2733,9 @@ static void direct_link_id(FileData *fd, ID *id)
if (drawdata) {
BLI_listbase_clear((ListBase *)drawdata);
}
+
+ /* Handle 'private IDs'. */
+ direct_link_id_private_id(fd, id);
}
/** \} */
@@ -3874,14 +3925,9 @@ static void direct_link_camera(FileData *fd, Camera *ca)
/** \name Read ID: Light
* \{ */
-static void lib_link_light(FileData *fd, Main *bmain, Light *la)
+static void lib_link_light(FileData *fd, Main *UNUSED(bmain), Light *la)
{
la->ipo = newlibadr_us(fd, la->id.lib, la->ipo); // XXX deprecated - old animation system
-
- if (la->nodetree) {
- lib_link_id(fd, bmain, &la->nodetree->id);
- lib_link_ntree(fd, la->id.lib, la->nodetree);
- }
}
static void direct_link_light(FileData *fd, Light *la)
@@ -3894,12 +3940,6 @@ static void direct_link_light(FileData *fd, Light *la)
direct_link_curvemapping(fd, la->curfalloff);
}
- la->nodetree = newdataadr(fd, la->nodetree);
- if (la->nodetree) {
- direct_link_id(fd, &la->nodetree->id);
- direct_link_nodetree(fd, la->nodetree);
- }
-
la->preview = direct_link_preview_image(fd, la->preview);
}
@@ -4016,14 +4056,9 @@ static void direct_link_mball(FileData *fd, MetaBall *mb)
/** \name Read ID: World
* \{ */
-static void lib_link_world(FileData *fd, Main *bmain, World *wrld)
+static void lib_link_world(FileData *fd, Main *UNUSED(bmain), World *wrld)
{
wrld->ipo = newlibadr_us(fd, wrld->id.lib, wrld->ipo); // XXX deprecated - old animation system
-
- if (wrld->nodetree) {
- lib_link_id(fd, bmain, &wrld->nodetree->id);
- lib_link_ntree(fd, wrld->id.lib, wrld->nodetree);
- }
}
static void direct_link_world(FileData *fd, World *wrld)
@@ -4031,12 +4066,6 @@ static void direct_link_world(FileData *fd, World *wrld)
wrld->adt = newdataadr(fd, wrld->adt);
direct_link_animdata(fd, wrld->adt);
- wrld->nodetree = newdataadr(fd, wrld->nodetree);
- if (wrld->nodetree) {
- direct_link_id(fd, &wrld->nodetree->id);
- direct_link_nodetree(fd, wrld->nodetree);
- }
-
wrld->preview = direct_link_preview_image(fd, wrld->preview);
BLI_listbase_clear(&wrld->gpumaterial);
}
@@ -4278,15 +4307,10 @@ static void direct_link_curve(FileData *fd, Curve *cu)
/** \name Read ID: Texture
* \{ */
-static void lib_link_texture(FileData *fd, Main *bmain, Tex *tex)
+static void lib_link_texture(FileData *fd, Main *UNUSED(bmain), Tex *tex)
{
tex->ima = newlibadr_us(fd, tex->id.lib, tex->ima);
tex->ipo = newlibadr_us(fd, tex->id.lib, tex->ipo); // XXX deprecated - old animation system
-
- if (tex->nodetree) {
- lib_link_id(fd, bmain, &tex->nodetree->id);
- lib_link_ntree(fd, tex->id.lib, tex->nodetree);
- }
}
static void direct_link_texture(FileData *fd, Tex *tex)
@@ -4296,12 +4320,6 @@ static void direct_link_texture(FileData *fd, Tex *tex)
tex->coba = newdataadr(fd, tex->coba);
- tex->nodetree = newdataadr(fd, tex->nodetree);
- if (tex->nodetree) {
- direct_link_id(fd, &tex->nodetree->id);
- direct_link_nodetree(fd, tex->nodetree);
- }
-
tex->preview = direct_link_preview_image(fd, tex->preview);
tex->iuser.ok = 1;
@@ -4314,15 +4332,10 @@ static void direct_link_texture(FileData *fd, Tex *tex)
/** \name Read ID: Material
* \{ */
-static void lib_link_material(FileData *fd, Main *bmain, Material *ma)
+static void lib_link_material(FileData *fd, Main *UNUSED(bmain), Material *ma)
{
ma->ipo = newlibadr_us(fd, ma->id.lib, ma->ipo); // XXX deprecated - old animation system
- if (ma->nodetree) {
- lib_link_id(fd, bmain, &ma->nodetree->id);
- lib_link_ntree(fd, ma->id.lib, ma->nodetree);
- }
-
/* relink grease pencil settings */
if (ma->gp_style != NULL) {
MaterialGPencilStyle *gp_style = ma->gp_style;
@@ -4342,12 +4355,6 @@ static void direct_link_material(FileData *fd, Material *ma)
ma->texpaintslot = NULL;
- ma->nodetree = newdataadr(fd, ma->nodetree);
- if (ma->nodetree) {
- direct_link_id(fd, &ma->nodetree->id);
- direct_link_nodetree(fd, ma->nodetree);
- }
-
ma->preview = direct_link_preview_image(fd, ma->preview);
BLI_listbase_clear(&ma->gpumaterial);
@@ -6329,7 +6336,7 @@ static bool scene_validate_setscene__liblink(Scene *sce, const int totscene)
}
#endif
-static void lib_link_scene(FileData *fd, Main *bmain, Scene *sce)
+static void lib_link_scene(FileData *fd, Main *UNUSED(bmain), Scene *sce)
{
lib_link_keyingsets(fd, &sce->id, &sce->keyingsets);
@@ -6472,8 +6479,6 @@ static void lib_link_scene(FileData *fd, Main *bmain, Scene *sce)
}
if (sce->nodetree) {
- lib_link_id(fd, bmain, &sce->nodetree->id);
- lib_link_ntree(fd, sce->id.lib, sce->nodetree);
composite_patch(sce->nodetree, sce);
}
@@ -6496,11 +6501,6 @@ static void lib_link_scene(FileData *fd, Main *bmain, Scene *sce)
}
#endif
- if (sce->master_collection) {
- lib_link_id(fd, bmain, &sce->master_collection->id);
- lib_link_collection_data(fd, sce->id.lib, sce->master_collection);
- }
-
for (ViewLayer *view_layer = sce->view_layers.first; view_layer; view_layer = view_layer->next) {
lib_link_view_layer(fd, sce->id.lib, view_layer);
}
@@ -6833,12 +6833,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
link_list(fd, &(srl->freestyleConfig.linesets));
}
- sce->nodetree = newdataadr(fd, sce->nodetree);
- if (sce->nodetree) {
- direct_link_id(fd, &sce->nodetree->id);
- direct_link_nodetree(fd, sce->nodetree);
- }
-
direct_link_view_settings(fd, &sce->view_settings);
sce->rigidbody_world = newdataadr(fd, sce->rigidbody_world);
@@ -6894,13 +6888,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
}
#endif
- if (sce->master_collection) {
- sce->master_collection = newdataadr(fd, sce->master_collection);
- /* Needed because this is an ID outside of Main. */
- direct_link_id(fd, &sce->master_collection->id);
- direct_link_collection(fd, sce->master_collection);
- }
-
/* insert into global old-new map for reading without UI (link_global accesses it again) */
link_glob_list(fd, &sce->view_layers);
for (view_layer = sce->view_layers.first; view_layer; view_layer = view_layer->next) {
@@ -6941,7 +6928,7 @@ static void lib_link_gpencil(FileData *fd, Main *UNUSED(bmain), bGPdata *gpd)
{
/* Relink all data-lock linked by GP data-lock */
/* Layers */
- LISTBASE_FOREACH(bGPDlayer*, gpl, &gpd->layers) {
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
/* Layer -> Parent References */
gpl->parent = newlibadr(fd, gpd->id.lib, gpl->parent);
}
@@ -8587,7 +8574,7 @@ static void lib_link_mask(FileData *fd, Main *UNUSED(bmain), Mask *mask)
/** \name Read ID: Line Style
* \{ */
-static void lib_link_linestyle(FileData *fd, Main *bmain, FreestyleLineStyle *linestyle)
+static void lib_link_linestyle(FileData *fd, Main *UNUSED(bmain), FreestyleLineStyle *linestyle)
{
LineStyleModifier *m;
@@ -8628,10 +8615,6 @@ static void lib_link_linestyle(FileData *fd, Main *bmain, FreestyleLineStyle *li
mtex->object = newlibadr(fd, linestyle->id.lib, mtex->object);
}
}
- if (linestyle->nodetree) {
- lib_link_id(fd, bmain, &linestyle->nodetree->id);
- lib_link_ntree(fd, linestyle->id.lib, linestyle->nodetree);
- }
}
static void direct_link_linestyle_color_modifier(FileData *fd, LineStyleModifier *modifier)
@@ -8822,11 +8805,6 @@ static void direct_link_linestyle(FileData *fd, FreestyleLineStyle *linestyle)
for (a = 0; a < MAX_MTEX; a++) {
linestyle->mtex[a] = newdataadr(fd, linestyle->mtex[a]);
}
- linestyle->nodetree = newdataadr(fd, linestyle->nodetree);
- if (linestyle->nodetree) {
- direct_link_id(fd, &linestyle->nodetree->id);
- direct_link_nodetree(fd, linestyle->nodetree);
- }
}
/** \} */
@@ -10110,39 +10088,6 @@ static void expand_constraint_channels(FileData *fd, Main *mainvar, ListBase *ch
}
}
-static void expand_id(FileData *fd, Main *mainvar, ID *id)
-{
- if (id->override_library) {
- expand_doit(fd, mainvar, id->override_library->reference);
- expand_doit(fd, mainvar, id->override_library->storage);
- }
-}
-
-static void expand_idprops(FileData *fd, Main *mainvar, IDProperty *prop)
-{
- if (!prop) {
- return;
- }
-
- switch (prop->type) {
- case IDP_ID:
- expand_doit(fd, mainvar, IDP_Id(prop));
- break;
- case IDP_IDPARRAY: {
- IDProperty *idp_array = IDP_IDPArray(prop);
- for (int i = 0; i < prop->len; i++) {
- expand_idprops(fd, mainvar, &idp_array[i]);
- }
- break;
- }
- case IDP_GROUP:
- for (IDProperty *loop = prop->data.group.first; loop; loop = loop->next) {
- expand_idprops(fd, mainvar, loop);
- }
- break;
- }
-}
-
static void expand_fmodifiers(FileData *fd, Main *mainvar, ListBase *list)
{
FModifier *fcm;
@@ -10185,40 +10130,6 @@ static void expand_fcurves(FileData *fd, Main *mainvar, ListBase *list)
}
}
-static void expand_action(FileData *fd, Main *mainvar, bAction *act)
-{
- bActionChannel *chan;
-
- // XXX deprecated - old animation system --------------
- for (chan = act->chanbase.first; chan; chan = chan->next) {
- expand_doit(fd, mainvar, chan->ipo);
- expand_constraint_channels(fd, mainvar, &chan->constraintChannels);
- }
- // ---------------------------------------------------
-
- /* F-Curves in Action */
- expand_fcurves(fd, mainvar, &act->curves);
-
- for (TimeMarker *marker = act->markers.first; marker; marker = marker->next) {
- if (marker->camera) {
- expand_doit(fd, mainvar, marker->camera);
- }
- }
-}
-
-static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list)
-{
- KeyingSet *ks;
- KS_Path *ksp;
-
- /* expand the ID-pointers in KeyingSets's paths */
- for (ks = list->first; ks; ks = ks->next) {
- for (ksp = ks->paths.first; ksp; ksp = ksp->next) {
- expand_doit(fd, mainvar, ksp->id);
- }
- }
-}
-
static void expand_animdata_nlastrips(FileData *fd, Main *mainvar, ListBase *list)
{
NlaStrip *strip;
@@ -10255,6 +10166,104 @@ static void expand_animdata(FileData *fd, Main *mainvar, AnimData *adt)
}
}
+static void expand_idprops(FileData *fd, Main *mainvar, IDProperty *prop)
+{
+ if (!prop) {
+ return;
+ }
+
+ switch (prop->type) {
+ case IDP_ID:
+ expand_doit(fd, mainvar, IDP_Id(prop));
+ break;
+ case IDP_IDPARRAY: {
+ IDProperty *idp_array = IDP_IDPArray(prop);
+ for (int i = 0; i < prop->len; i++) {
+ expand_idprops(fd, mainvar, &idp_array[i]);
+ }
+ break;
+ }
+ case IDP_GROUP:
+ for (IDProperty *loop = prop->data.group.first; loop; loop = loop->next) {
+ expand_idprops(fd, mainvar, loop);
+ }
+ break;
+ }
+}
+
+static void expand_id(FileData *fd, Main *mainvar, ID *id);
+static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree);
+static void expand_collection(FileData *fd, Main *mainvar, Collection *collection);
+
+static void expand_id_private_id(FileData *fd, Main *mainvar, ID *id)
+{
+ /* Handle 'private IDs'. */
+ bNodeTree *nodetree = ntreeFromID(id);
+ if (nodetree != NULL) {
+ expand_id(fd, mainvar, &nodetree->id);
+ expand_nodetree(fd, mainvar, nodetree);
+ }
+
+ if (GS(id->name) == ID_SCE) {
+ Scene *scene = (Scene *)id;
+ if (scene->master_collection != NULL) {
+ expand_id(fd, mainvar, &scene->master_collection->id);
+ expand_collection(fd, mainvar, scene->master_collection);
+ }
+ }
+}
+
+static void expand_id(FileData *fd, Main *mainvar, ID *id)
+{
+ expand_idprops(fd, mainvar, id->properties);
+
+ if (id->override_library) {
+ expand_doit(fd, mainvar, id->override_library->reference);
+ expand_doit(fd, mainvar, id->override_library->storage);
+ }
+
+ AnimData *adt = BKE_animdata_from_id(id);
+ if (adt != NULL) {
+ expand_animdata(fd, mainvar, adt);
+ }
+
+ expand_id_private_id(fd, mainvar, id);
+}
+
+static void expand_action(FileData *fd, Main *mainvar, bAction *act)
+{
+ bActionChannel *chan;
+
+ // XXX deprecated - old animation system --------------
+ for (chan = act->chanbase.first; chan; chan = chan->next) {
+ expand_doit(fd, mainvar, chan->ipo);
+ expand_constraint_channels(fd, mainvar, &chan->constraintChannels);
+ }
+ // ---------------------------------------------------
+
+ /* F-Curves in Action */
+ expand_fcurves(fd, mainvar, &act->curves);
+
+ for (TimeMarker *marker = act->markers.first; marker; marker = marker->next) {
+ if (marker->camera) {
+ expand_doit(fd, mainvar, marker->camera);
+ }
+ }
+}
+
+static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list)
+{
+ KeyingSet *ks;
+ KS_Path *ksp;
+
+ /* expand the ID-pointers in KeyingSets's paths */
+ for (ks = list->first; ks; ks = ks->next) {
+ for (ksp = ks->paths.first; ksp; ksp = ksp->next) {
+ expand_doit(fd, mainvar, ksp->id);
+ }
+ }
+}
+
static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSettings *part)
{
int a;
@@ -10265,10 +10274,6 @@ static void expand_particlesettings(FileData *fd, Main *mainvar, ParticleSetting
expand_doit(fd, mainvar, part->bb_ob);
expand_doit(fd, mainvar, part->collision_group);
- if (part->adt) {
- expand_animdata(fd, mainvar, part->adt);
- }
-
for (a = 0; a < MAX_MTEX; a++) {
if (part->mtex[a]) {
expand_doit(fd, mainvar, part->mtex[a]->tex);
@@ -10332,10 +10337,6 @@ static void expand_collection(FileData *fd, Main *mainvar, Collection *collectio
static void expand_key(FileData *fd, Main *mainvar, Key *key)
{
expand_doit(fd, mainvar, key->ipo); // XXX deprecated - old animation system
-
- if (key->adt) {
- expand_animdata(fd, mainvar, key->adt);
- }
}
static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
@@ -10343,10 +10344,6 @@ static void expand_nodetree(FileData *fd, Main *mainvar, bNodeTree *ntree)
bNode *node;
bNodeSocket *sock;
- if (ntree->adt) {
- expand_animdata(fd, mainvar, ntree->adt);
- }
-
if (ntree->gpd) {
expand_doit(fd, mainvar, ntree->gpd);
}
@@ -10378,14 +10375,6 @@ static void expand_texture(FileData *fd, Main *mainvar, Tex *tex)
{
expand_doit(fd, mainvar, tex->ima);
expand_doit(fd, mainvar, tex->ipo); // XXX deprecated - old animation system
-
- if (tex->adt) {
- expand_animdata(fd, mainvar, tex->adt);
- }
-
- if (tex->nodetree) {
- expand_nodetree(fd, mainvar, tex->nodetree);
- }
}
static void expand_brush(FileData *fd, Main *mainvar, Brush *brush)
@@ -10403,14 +10392,6 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
{
expand_doit(fd, mainvar, ma->ipo); // XXX deprecated - old animation system
- if (ma->adt) {
- expand_animdata(fd, mainvar, ma->adt);
- }
-
- if (ma->nodetree) {
- expand_nodetree(fd, mainvar, ma->nodetree);
- }
-
if (ma->gp_style) {
MaterialGPencilStyle *gp_style = ma->gp_style;
expand_doit(fd, mainvar, gp_style->sima);
@@ -10421,37 +10402,17 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
static void expand_light(FileData *fd, Main *mainvar, Light *la)
{
expand_doit(fd, mainvar, la->ipo); // XXX deprecated - old animation system
-
- if (la->adt) {
- expand_animdata(fd, mainvar, la->adt);
- }
-
- if (la->nodetree) {
- expand_nodetree(fd, mainvar, la->nodetree);
- }
}
static void expand_lattice(FileData *fd, Main *mainvar, Lattice *lt)
{
expand_doit(fd, mainvar, lt->ipo); // XXX deprecated - old animation system
expand_doit(fd, mainvar, lt->key);
-
- if (lt->adt) {
- expand_animdata(fd, mainvar, lt->adt);
- }
}
static void expand_world(FileData *fd, Main *mainvar, World *wrld)
{
expand_doit(fd, mainvar, wrld->ipo); // XXX deprecated - old animation system
-
- if (wrld->adt) {
- expand_animdata(fd, mainvar, wrld->adt);
- }
-
- if (wrld->nodetree) {
- expand_nodetree(fd, mainvar, wrld->nodetree);
- }
}
static void expand_mball(FileData *fd, Main *mainvar, MetaBall *mb)
@@ -10461,10 +10422,6 @@ static void expand_mball(FileData *fd, Main *mainvar, MetaBall *mb)
for (a = 0; a < mb->totcol; a++) {
expand_doit(fd, mainvar, mb->mat[a]);
}
-
- if (mb->adt) {
- expand_animdata(fd, mainvar, mb->adt);
- }
}
static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
@@ -10484,20 +10441,12 @@ static void expand_curve(FileData *fd, Main *mainvar, Curve *cu)
expand_doit(fd, mainvar, cu->bevobj);
expand_doit(fd, mainvar, cu->taperobj);
expand_doit(fd, mainvar, cu->textoncurve);
-
- if (cu->adt) {
- expand_animdata(fd, mainvar, cu->adt);
- }
}
static void expand_mesh(FileData *fd, Main *mainvar, Mesh *me)
{
int a;
- if (me->adt) {
- expand_animdata(fd, mainvar, me->adt);
- }
-
for (a = 0; a < me->totcol; a++) {
expand_doit(fd, mainvar, me->mat[a]);
}
@@ -10566,10 +10515,6 @@ static void expand_bones(FileData *fd, Main *mainvar, Bone *bone)
static void expand_armature(FileData *fd, Main *mainvar, bArmature *arm)
{
- if (arm->adt) {
- expand_animdata(fd, mainvar, arm->adt);
- }
-
for (Bone *curBone = arm->bonebase.first; curBone; curBone = curBone->next) {
expand_bones(fd, mainvar, curBone);
}
@@ -10655,10 +10600,6 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob)
}
// XXX deprecated - old animation system (for version patching only)
- if (ob->adt) {
- expand_animdata(fd, mainvar, ob->adt);
- }
-
for (a = 0; a < ob->totcol; a++) {
expand_doit(fd, mainvar, ob->mat[a]);
}
@@ -10734,19 +10675,12 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
expand_doit(fd, mainvar, sce->camera);
expand_doit(fd, mainvar, sce->world);
- if (sce->adt) {
- expand_animdata(fd, mainvar, sce->adt);
- }
expand_keyingsets(fd, mainvar, &sce->keyingsets);
if (sce->set) {
expand_doit(fd, mainvar, sce->set);
}
- if (sce->nodetree) {
- expand_nodetree(fd, mainvar, sce->nodetree);
- }
-
for (srl = sce->r.layers.first; srl; srl = srl->next) {
expand_doit(fd, mainvar, srl->mat_override);
for (module = srl->freestyleConfig.modules.first; module; module = module->next) {
@@ -10832,10 +10766,6 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce)
}
#endif
- if (sce->master_collection) {
- expand_collection(fd, mainvar, sce->master_collection);
- }
-
if (sce->r.bake.cage_object) {
expand_doit(fd, mainvar, sce->r.bake.cage_object);
}
@@ -10853,26 +10783,17 @@ static void expand_camera(FileData *fd, Main *mainvar, Camera *ca)
expand_doit(fd, mainvar, bgpic->ima);
}
}
-
- if (ca->adt) {
- expand_animdata(fd, mainvar, ca->adt);
- }
}
-static void expand_cachefile(FileData *fd, Main *mainvar, CacheFile *cache_file)
+static void expand_cachefile(FileData *UNUSED(fd),
+ Main *UNUSED(mainvar),
+ CacheFile *UNUSED(cache_file))
{
- if (cache_file->adt) {
- expand_animdata(fd, mainvar, cache_file->adt);
- }
}
static void expand_speaker(FileData *fd, Main *mainvar, Speaker *spk)
{
expand_doit(fd, mainvar, spk->sound);
-
- if (spk->adt) {
- expand_animdata(fd, mainvar, spk->adt);
- }
}
static void expand_sound(FileData *fd, Main *mainvar, bSound *snd)
@@ -10880,18 +10801,12 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd)
expand_doit(fd, mainvar, snd->ipo); // XXX deprecated - old animation system
}
-static void expand_lightprobe(FileData *fd, Main *mainvar, LightProbe *prb)
+static void expand_lightprobe(FileData *UNUSED(fd), Main *UNUSED(mainvar), LightProbe *UNUSED(prb))
{
- if (prb->adt) {
- expand_animdata(fd, mainvar, prb->adt);
- }
}
-static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip)
+static void expand_movieclip(FileData *UNUSED(fd), Main *UNUSED(mainvar), MovieClip *UNUSED(clip))
{
- if (clip->adt) {
- expand_animdata(fd, mainvar, clip->adt);
- }
}
static void expand_mask_parent(FileData *fd, Main *mainvar, MaskParent *parent)
@@ -10905,10 +10820,6 @@ static void expand_mask(FileData *fd, Main *mainvar, Mask *mask)
{
MaskLayer *mask_layer;
- if (mask->adt) {
- expand_animdata(fd, mainvar, mask->adt);
- }
-
for (mask_layer = mask->masklayers.first; mask_layer; mask_layer = mask_layer->next) {
MaskSpline *spline;
@@ -10937,13 +10848,7 @@ static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *li
expand_doit(fd, mainvar, linestyle->mtex[a]->object);
}
}
- if (linestyle->nodetree) {
- expand_nodetree(fd, mainvar, linestyle->nodetree);
- }
- if (linestyle->adt) {
- expand_animdata(fd, mainvar, linestyle->adt);
- }
for (m = linestyle->color_modifiers.first; m; m = m->next) {
if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) {
expand_doit(fd, mainvar, ((LineStyleColorModifier_DistanceFromObject *)m)->target);
@@ -10963,10 +10868,6 @@ static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *li
static void expand_gpencil(FileData *fd, Main *mainvar, bGPdata *gpd)
{
- if (gpd->adt) {
- expand_animdata(fd, mainvar, gpd->adt);
- }
-
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
expand_doit(fd, mainvar, gpl->parent);
}
@@ -11019,7 +10920,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
while (id) {
if (id->tag & LIB_TAG_NEED_EXPAND) {
expand_id(fd, mainvar, id);
- expand_idprops(fd, mainvar, id->properties);
switch (GS(id->name)) {
case ID_OB: