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:
authorJacques Lucke <jacques@blender.org>2020-09-10 18:06:35 +0300
committerJacques Lucke <jacques@blender.org>2020-09-10 18:06:49 +0300
commit60e102c0a09561b6362aed5b3c55b11cc660c9c2 (patch)
tree617525ba15a8253da1de46a4d7c8fde588270ac8 /source/blender/blenloader
parent095a53bd884b5157b8ac25eb660e6520151d0899 (diff)
Refactor: move World .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c37
-rw-r--r--source/blender/blenloader/intern/writefile.c28
2 files changed, 3 insertions, 62 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a5d72084b76..d205a4f7ebf 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2912,27 +2912,6 @@ static void direct_link_key(BlendDataReader *reader, Key *key)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Read ID: World
- * \{ */
-
-static void lib_link_world(BlendLibReader *reader, World *wrld)
-{
- BLO_read_id_address(reader, wrld->id.lib, &wrld->ipo); // XXX deprecated - old animation system
-}
-
-static void direct_link_world(BlendDataReader *reader, World *wrld)
-{
- BLO_read_data_address(reader, &wrld->adt);
- BKE_animdata_blend_read_data(reader, wrld->adt);
-
- BLO_read_data_address(reader, &wrld->preview);
- BKE_previewimg_blend_read(reader, wrld->preview);
- BLI_listbase_clear(&wrld->gpumaterial);
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Read ID: Texture
* \{ */
@@ -6889,9 +6868,6 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_KE:
direct_link_key(&reader, (Key *)id);
break;
- case ID_WO:
- direct_link_world(&reader, (World *)id);
- break;
case ID_LI:
direct_link_library(fd, (Library *)id, main);
break;
@@ -6954,6 +6930,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_MB:
case ID_CU:
case ID_CA:
+ case ID_WO:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -7580,9 +7557,6 @@ static void lib_link_all(FileData *fd, Main *bmain)
* 3D viewport may contains pointers to other ID data (like bgpic)! See T41411. */
lib_link_screen(&reader, (bScreen *)id);
break;
- case ID_WO:
- lib_link_world(&reader, (World *)id);
- break;
case ID_LP:
lib_link_lightprobe(&reader, (LightProbe *)id);
break;
@@ -7649,6 +7623,7 @@ static void lib_link_all(FileData *fd, Main *bmain)
case ID_MB:
case ID_CU:
case ID_CA:
+ case ID_WO:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -8345,11 +8320,6 @@ static void expand_texture(BlendExpander *expander, Tex *tex)
BLO_expand(expander, tex->ipo); // XXX deprecated - old animation system
}
-static void expand_world(BlendExpander *expander, World *wrld)
-{
- BLO_expand(expander, wrld->ipo); // XXX deprecated - old animation system
-}
-
/* callback function used to expand constraint ID-links */
static void expand_constraint_cb(bConstraint *UNUSED(con),
ID **idpoin,
@@ -8745,9 +8715,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
case ID_TE:
expand_texture(&expander, (Tex *)id);
break;
- case ID_WO:
- expand_world(&expander, (World *)id);
- break;
case ID_KE:
expand_key(&expander, (Key *)id);
break;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 7861af88785..df32cd7ec2f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1440,30 +1440,6 @@ static void write_texture(BlendWriter *writer, Tex *tex, const void *id_address)
}
}
-static void write_world(BlendWriter *writer, World *wrld, const void *id_address)
-{
- if (wrld->id.us > 0 || BLO_write_is_undo(writer)) {
- /* Clean up, important in undo case to reduce false detection of changed datablocks. */
- BLI_listbase_clear(&wrld->gpumaterial);
-
- /* write LibData */
- BLO_write_id_struct(writer, World, id_address, &wrld->id);
- BKE_id_blend_write(writer, &wrld->id);
-
- if (wrld->adt) {
- BKE_animdata_blend_write(writer, wrld->adt);
- }
-
- /* nodetree is integral part of world, no libdata */
- if (wrld->nodetree) {
- BLO_write_struct(writer, bNodeTree, wrld->nodetree);
- ntreeBlendWrite(writer, wrld->nodetree);
- }
-
- BKE_previewimg_blend_write(writer, wrld->preview);
- }
-}
-
static void write_collection_nolib(BlendWriter *writer, Collection *collection)
{
/* Shared function for collection data-blocks and scene master collection. */
@@ -2740,9 +2716,6 @@ static bool write_file_handle(Main *mainvar,
case ID_KE:
write_key(&writer, (Key *)id_buffer, id);
break;
- case ID_WO:
- write_world(&writer, (World *)id_buffer, id);
- break;
case ID_SPK:
write_speaker(&writer, (Speaker *)id_buffer, id);
break;
@@ -2802,6 +2775,7 @@ static bool write_file_handle(Main *mainvar,
case ID_MB:
case ID_CU:
case ID_CA:
+ case ID_WO:
/* Do nothing, handled in IDTypeInfo callback. */
break;
case ID_LI: