diff options
author | Jacques Lucke <jacques@blender.org> | 2020-08-28 17:10:17 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-08-28 17:10:17 +0300 |
commit | 7b2fe4c9ec683bb7da270a54c44d301016e1470d (patch) | |
tree | 962c85e56ae3c2be6a6a8ce1ba22d14765860d80 /source/blender/blenloader | |
parent | 8815996418f0259b9abb9446da9bc137145de7d6 (diff) |
Refactor: move Lattice .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 43 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 27 |
2 files changed, 3 insertions, 67 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dd7ea003cc5..aec5a254750 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4112,32 +4112,6 @@ static void direct_link_particlesystems(BlendDataReader *reader, ListBase *parti /** \} */ /* -------------------------------------------------------------------- */ -/** \name Read ID: Lattice - * \{ */ - -static void lib_link_latt(BlendLibReader *reader, Lattice *lt) -{ - BLO_read_id_address(reader, lt->id.lib, <->ipo); // XXX deprecated - old animation system - BLO_read_id_address(reader, lt->id.lib, <->key); -} - -static void direct_link_latt(BlendDataReader *reader, Lattice *lt) -{ - BLO_read_data_address(reader, <->def); - - BLO_read_data_address(reader, <->dvert); - BKE_defvert_blend_read(reader, lt->pntsu * lt->pntsv * lt->pntsw, lt->dvert); - - lt->editlatt = NULL; - lt->batch_cache = NULL; - - BLO_read_data_address(reader, <->adt); - BKE_animdata_blend_read_data(reader, lt->adt); -} - -/** \} */ - -/* -------------------------------------------------------------------- */ /** \name Read ID: Object * \{ */ @@ -8079,9 +8053,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_LT: - direct_link_latt(&reader, (Lattice *)id); - break; case ID_WO: direct_link_world(&reader, (World *)id); break; @@ -8155,6 +8126,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID * direct_link_simulation(&reader, (Simulation *)id); break; case ID_ME: + case ID_LT: /* Do nothing. Handled by IDTypeInfo callback. */ break; } @@ -8820,9 +8792,6 @@ static void lib_link_all(FileData *fd, Main *bmain) case ID_LA: lib_link_light(&reader, (Light *)id); break; - case ID_LT: - lib_link_latt(&reader, (Lattice *)id); - break; case ID_MB: lib_link_mball(&reader, (MetaBall *)id); break; @@ -8883,6 +8852,7 @@ static void lib_link_all(FileData *fd, Main *bmain) lib_link_library(&reader, (Library *)id); /* Only init users. */ break; case ID_ME: + case ID_LT: /* Do nothing. Handled by IDTypeInfo callback. */ break; } @@ -9699,12 +9669,6 @@ static void expand_light(BlendExpander *expander, Light *la) BLO_expand(expander, la->ipo); // XXX deprecated - old animation system } -static void expand_lattice(BlendExpander *expander, Lattice *lt) -{ - BLO_expand(expander, lt->ipo); // XXX deprecated - old animation system - BLO_expand(expander, lt->key); -} - static void expand_world(BlendExpander *expander, World *wrld) { BLO_expand(expander, wrld->ipo); // XXX deprecated - old animation system @@ -10185,9 +10149,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar) case ID_WO: expand_world(&expander, (World *)id); break; - case ID_LT: - expand_lattice(&expander, (Lattice *)id); - break; case ID_LA: expand_light(&expander, (Light *)id); break; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 0c703f97f4d..a9c92719a33 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1758,29 +1758,6 @@ static void write_curve(BlendWriter *writer, Curve *cu, const void *id_address) } } -static void write_lattice(BlendWriter *writer, Lattice *lt, const void *id_address) -{ - if (lt->id.us > 0 || BLO_write_is_undo(writer)) { - /* Clean up, important in undo case to reduce false detection of changed datablocks. */ - lt->editlatt = NULL; - lt->batch_cache = NULL; - - /* write LibData */ - BLO_write_id_struct(writer, Lattice, id_address, <->id); - BKE_id_blend_write(writer, <->id); - - /* write animdata */ - if (lt->adt) { - BKE_animdata_blend_write(writer, lt->adt); - } - - /* direct data */ - BLO_write_struct_array(writer, BPoint, lt->pntsu * lt->pntsv * lt->pntsw, lt->def); - - BKE_defvert_blend_write(writer, lt->pntsu * lt->pntsv * lt->pntsw, lt->dvert); - } -} - static void write_image(BlendWriter *writer, Image *ima, const void *id_address) { if (ima->id.us > 0 || BLO_write_is_undo(writer)) { @@ -3684,9 +3661,6 @@ static bool write_file_handle(Main *mainvar, case ID_LA: write_light(&writer, (Light *)id_buffer, id); break; - case ID_LT: - write_lattice(&writer, (Lattice *)id_buffer, id); - break; case ID_VF: write_vfont(&writer, (VFont *)id_buffer, id); break; @@ -3763,6 +3737,7 @@ static bool write_file_handle(Main *mainvar, write_simulation(&writer, (Simulation *)id_buffer, id); break; case ID_ME: + case ID_LT: /* Do nothing, handled in IDTypeInfo callback. */ break; case ID_LI: |