From 94c533ac35d4ad5d944c214d4809011b61be4a94 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 10 Sep 2020 16:13:18 +0200 Subject: Refactor: move Light .blend I/O to IDTypeInfo callbacks --- source/blender/blenloader/intern/readfile.c | 41 ++--------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) (limited to 'source/blender/blenloader/intern/readfile.c') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ff29ebd9e95..85b7c1e5623 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2876,31 +2876,6 @@ static void direct_link_camera(BlendDataReader *reader, Camera *ca) /** \} */ -/* -------------------------------------------------------------------- */ -/** \name Read ID: Light - * \{ */ - -static void lib_link_light(BlendLibReader *reader, Light *la) -{ - BLO_read_id_address(reader, la->id.lib, &la->ipo); // XXX deprecated - old animation system -} - -static void direct_link_light(BlendDataReader *reader, Light *la) -{ - BLO_read_data_address(reader, &la->adt); - BKE_animdata_blend_read_data(reader, la->adt); - - BLO_read_data_address(reader, &la->curfalloff); - if (la->curfalloff) { - BKE_curvemapping_blend_read(reader, la->curfalloff); - } - - BLO_read_data_address(reader, &la->preview); - BKE_previewimg_blend_read(reader, la->preview); -} - -/** \} */ - /* -------------------------------------------------------------------- */ /** \name Read ID: Shape Keys * \{ */ @@ -7110,9 +7085,6 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID * case ID_TE: direct_link_texture(&reader, (Tex *)id); break; - case ID_LA: - direct_link_light(&reader, (Light *)id); - break; case ID_IP: direct_link_ipo(&reader, (Ipo *)id); break; @@ -7182,6 +7154,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID * case ID_PC: case ID_BR: case ID_IM: + case ID_LA: /* Do nothing. Handled by IDTypeInfo callback. */ break; } @@ -7829,9 +7802,6 @@ static void lib_link_all(FileData *fd, Main *bmain) case ID_CA: lib_link_camera(&reader, (Camera *)id); break; - case ID_LA: - lib_link_light(&reader, (Light *)id); - break; case ID_MB: lib_link_mball(&reader, (MetaBall *)id); break; @@ -7887,6 +7857,7 @@ static void lib_link_all(FileData *fd, Main *bmain) case ID_PC: case ID_BR: case ID_IM: + case ID_LA: /* Do nothing. Handled by IDTypeInfo callback. */ break; } @@ -8594,11 +8565,6 @@ static void expand_material(BlendExpander *expander, Material *ma) } } -static void expand_light(BlendExpander *expander, Light *la) -{ - BLO_expand(expander, la->ipo); // XXX deprecated - old animation system -} - static void expand_world(BlendExpander *expander, World *wrld) { BLO_expand(expander, wrld->ipo); // XXX deprecated - old animation system @@ -9049,9 +9015,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar) case ID_WO: expand_world(&expander, (World *)id); break; - case ID_LA: - expand_light(&expander, (Light *)id); - break; case ID_KE: expand_key(&expander, (Key *)id); break; -- cgit v1.2.3