From c010290e75125a26166ae524d40e383fd3651f7e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 9 Mar 2020 17:35:32 +0100 Subject: Cleanup: Ipo: Move to IDTypeInfo and remove unused BKE API. --- source/blender/blenkernel/intern/ipo.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/ipo.c') 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) */ -- cgit v1.2.3