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 17:57:47 +0300
committerJacques Lucke <jacques@blender.org>2020-09-10 17:58:23 +0300
commit0649e6371629507c201310f7ece628a926d846d5 (patch)
treeae47a711bce7084f753031c5fb494b476106e826 /source/blender/blenloader
parentae200cb2e4d399f7561c4bee86eae70599d0396f (diff)
Refactor: move Camera .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c57
-rw-r--r--source/blender/blenloader/intern/writefile.c21
2 files changed, 3 insertions, 75 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index b3816588daa..a5d72084b76 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2845,38 +2845,6 @@ static void direct_link_armature(BlendDataReader *reader, bArmature *arm)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Read ID: Camera
- * \{ */
-
-static void lib_link_camera(BlendLibReader *reader, Camera *ca)
-{
- BLO_read_id_address(reader, ca->id.lib, &ca->ipo); /* deprecated, for versioning */
-
- BLO_read_id_address(reader, ca->id.lib, &ca->dof_ob); /* deprecated, for versioning */
- BLO_read_id_address(reader, ca->id.lib, &ca->dof.focus_object);
-
- LISTBASE_FOREACH (CameraBGImage *, bgpic, &ca->bg_images) {
- BLO_read_id_address(reader, ca->id.lib, &bgpic->ima);
- BLO_read_id_address(reader, ca->id.lib, &bgpic->clip);
- }
-}
-
-static void direct_link_camera(BlendDataReader *reader, Camera *ca)
-{
- BLO_read_data_address(reader, &ca->adt);
- BKE_animdata_blend_read_data(reader, ca->adt);
-
- BLO_read_list(reader, &ca->bg_images);
-
- LISTBASE_FOREACH (CameraBGImage *, bgpic, &ca->bg_images) {
- bgpic->iuser.ok = 1;
- bgpic->iuser.scene = NULL;
- }
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Read ID: Shape Keys
* \{ */
@@ -6927,9 +6895,6 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_LI:
direct_link_library(fd, (Library *)id, main);
break;
- case ID_CA:
- direct_link_camera(&reader, (Camera *)id);
- break;
case ID_SPK:
direct_link_speaker(&reader, (Speaker *)id);
break;
@@ -6988,6 +6953,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_MA:
case ID_MB:
case ID_CU:
+ case ID_CA:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -7632,9 +7598,6 @@ static void lib_link_all(FileData *fd, Main *bmain)
case ID_SO:
lib_link_sound(&reader, (bSound *)id);
break;
- case ID_CA:
- lib_link_camera(&reader, (Camera *)id);
- break;
case ID_CF:
lib_link_cachefiles(&reader, (CacheFile *)id);
break;
@@ -7685,6 +7648,7 @@ static void lib_link_all(FileData *fd, Main *bmain)
case ID_MA:
case ID_MB:
case ID_CU:
+ case ID_CA:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -8644,20 +8608,6 @@ static void expand_scene(BlendExpander *expander, Scene *sce)
}
}
-static void expand_camera(BlendExpander *expander, Camera *ca)
-{
- BLO_expand(expander, ca->ipo); // XXX deprecated - old animation system
-
- LISTBASE_FOREACH (CameraBGImage *, bgpic, &ca->bg_images) {
- if (bgpic->source == CAM_BGIMG_SOURCE_IMAGE) {
- BLO_expand(expander, bgpic->ima);
- }
- else if (bgpic->source == CAM_BGIMG_SOURCE_MOVIE) {
- BLO_expand(expander, bgpic->ima);
- }
- }
-}
-
static void expand_cachefile(BlendExpander *UNUSED(expander), CacheFile *UNUSED(cache_file))
{
}
@@ -8801,9 +8751,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
case ID_KE:
expand_key(&expander, (Key *)id);
break;
- case ID_CA:
- expand_camera(&expander, (Camera *)id);
- break;
case ID_SPK:
expand_speaker(&expander, (Speaker *)id);
break;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index dd307da40fd..7861af88785 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1414,23 +1414,6 @@ static void write_key(BlendWriter *writer, Key *key, const void *id_address)
}
}
-static void write_camera(BlendWriter *writer, Camera *cam, const void *id_address)
-{
- if (cam->id.us > 0 || BLO_write_is_undo(writer)) {
- /* write LibData */
- BLO_write_id_struct(writer, Camera, id_address, &cam->id);
- BKE_id_blend_write(writer, &cam->id);
-
- if (cam->adt) {
- BKE_animdata_blend_write(writer, cam->adt);
- }
-
- LISTBASE_FOREACH (CameraBGImage *, bgpic, &cam->bg_images) {
- BLO_write_struct(writer, CameraBGImage, bgpic);
- }
- }
-}
-
static void write_texture(BlendWriter *writer, Tex *tex, const void *id_address)
{
if (tex->id.us > 0 || BLO_write_is_undo(writer)) {
@@ -2754,9 +2737,6 @@ static bool write_file_handle(Main *mainvar,
case ID_SCE:
write_scene(&writer, (Scene *)id_buffer, id);
break;
- case ID_CA:
- write_camera(&writer, (Camera *)id_buffer, id);
- break;
case ID_KE:
write_key(&writer, (Key *)id_buffer, id);
break;
@@ -2821,6 +2801,7 @@ static bool write_file_handle(Main *mainvar,
case ID_MA:
case ID_MB:
case ID_CU:
+ case ID_CA:
/* Do nothing, handled in IDTypeInfo callback. */
break;
case ID_LI: