[Bf-blender-cvs] [c010290e751] master: Cleanup: Ipo: Move to IDTypeInfo and remove unused BKE API.

Bastien Montagne noreply at git.blender.org
Mon Mar 9 18:09:28 CET 2020


Commit: c010290e75125a26166ae524d40e383fd3651f7e
Author: Bastien Montagne
Date:   Mon Mar 9 17:35:32 2020 +0100
Branches: master
https://developer.blender.org/rBc010290e75125a26166ae524d40e383fd3651f7e

Cleanup: Ipo: Move to IDTypeInfo and remove unused BKE API.

===================================================================

M	source/blender/blenkernel/BKE_idtype.h
M	source/blender/blenkernel/BKE_ipo.h
M	source/blender/blenkernel/intern/idtype.c
M	source/blender/blenkernel/intern/ipo.c
M	source/blender/blenkernel/intern/lib_id_delete.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index 4e715fe23ea..2bd111bea0e 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -136,7 +136,7 @@ extern IDTypeInfo IDType_ID_IM;
 extern IDTypeInfo IDType_ID_LT;
 extern IDTypeInfo IDType_ID_LA;
 extern IDTypeInfo IDType_ID_CA;
-// extern IDTypeInfo IDType_ID_IP;
+extern IDTypeInfo IDType_ID_IP;
 extern IDTypeInfo IDType_ID_KE;
 extern IDTypeInfo IDType_ID_WO;
 extern IDTypeInfo IDType_ID_SCR;
diff --git a/source/blender/blenkernel/BKE_ipo.h b/source/blender/blenkernel/BKE_ipo.h
index 2825c4845ae..ab5d2f66441 100644
--- a/source/blender/blenkernel/BKE_ipo.h
+++ b/source/blender/blenkernel/BKE_ipo.h
@@ -34,8 +34,6 @@ void do_versions_ipos_to_animato(struct Main *main);
 
 /* --------------------- xxx stuff ------------------------ */
 
-void BKE_ipo_free(struct Ipo *ipo);
-
 #ifdef __cplusplus
 };
 #endif
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);



More information about the Bf-blender-cvs mailing list