diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-09 19:35:32 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-09 20:09:23 +0300 |
commit | c010290e75125a26166ae524d40e383fd3651f7e (patch) | |
tree | e913904683c25cce5327408fb2764f6d45b62d1d /source/blender/blenkernel/intern | |
parent | 214cc3c245194a312b1f5e23d6b779b40ebe3569 (diff) |
Cleanup: Ipo: Move to IDTypeInfo and remove unused BKE API.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/idtype.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/ipo.c | 29 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_id_delete.c | 2 |
3 files changed, 25 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index 6074ba85147..6fbce96c870 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -63,7 +63,7 @@ static void id_type_init(void) INIT_TYPE(ID_LT); INIT_TYPE(ID_LA); INIT_TYPE(ID_CA); - // INIT_TYPE(ID_IP); + INIT_TYPE(ID_IP); INIT_TYPE(ID_KE); INIT_TYPE(ID_WO); INIT_TYPE(ID_SCR); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index f84d0681dad..57bd2539003 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -62,6 +62,7 @@ #include "BKE_action.h" #include "BKE_fcurve.h" #include "BKE_global.h" +#include "BKE_idtype.h" #include "BKE_key.h" #include "BKE_lib_id.h" #include "BKE_main.h" @@ -78,13 +79,10 @@ static CLG_LogRef LOG = {"bke.ipo"}; -/* *************************************************** */ -/* Old-Data Freeing Tools */ - -/* Free data from old IPO-Blocks (those which haven't been converted), but not IPO block itself */ -// XXX this shouldn't be necessary anymore, but may occur while not all data is converted yet -void BKE_ipo_free(Ipo *ipo) +static void ipo_free_data(ID *id) { + Ipo *ipo = (Ipo *)id; + IpoCurve *icu, *icn; int n = 0; @@ -110,6 +108,25 @@ void BKE_ipo_free(Ipo *ipo) } } +IDTypeInfo IDType_ID_IP = { + .id_code = ID_IP, + .id_filter = 0, + .main_listbase_index = INDEX_ID_IP, + .struct_size = sizeof(Ipo), + .name = "Ipo", + .name_plural = "ipos", + .translation_context = "", + .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL, + + .init_data = NULL, + .copy_data = NULL, + .free_data = ipo_free_data, + .make_local = NULL, +}; + +/* *************************************************** */ +/* Old-Data Freeing Tools */ + /* *************************************************** */ /* ADRCODE to RNA-Path Conversion Code - Special (Bitflags) */ diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index 241b7dab0b9..fb89aab75fb 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -172,7 +172,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag)) BLI_assert(0); break; case ID_IP: /* Deprecated. */ - BKE_ipo_free((Ipo *)id); + BLI_assert(0); break; case ID_KE: BLI_assert(0); |