Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-10-07 13:35:58 +0300
committerJacques Lucke <jacques@blender.org>2020-10-07 13:35:58 +0300
commit65a6caafce9f1cde7e128786daa90342c192900c (patch)
tree3b5f46753773a0499a6bb2df4f9f24220a1bb44c
parente2526e338f12832c1ab945907f5be075124fcf24 (diff)
IDTypeInfo: add flag to indicate that ID has no animation data
This is part of T75724. Reviewers: mont29 Differential Revision: https://developer.blender.org/D9134
-rw-r--r--source/blender/blenkernel/BKE_idtype.h2
-rw-r--r--source/blender/blenkernel/intern/action.c2
-rw-r--r--source/blender/blenkernel/intern/anim_data.c40
-rw-r--r--source/blender/blenkernel/intern/brush.c2
-rw-r--r--source/blender/blenkernel/intern/collection.c2
-rw-r--r--source/blender/blenkernel/intern/font.c2
-rw-r--r--source/blender/blenkernel/intern/image.c2
-rw-r--r--source/blender/blenkernel/intern/ipo.c3
-rw-r--r--source/blender/blenkernel/intern/library.c3
-rw-r--r--source/blender/blenkernel/intern/paint.c4
-rw-r--r--source/blender/blenkernel/intern/screen.c2
-rw-r--r--source/blender/blenkernel/intern/sound.c2
-rw-r--r--source/blender/blenkernel/intern/text.c2
-rw-r--r--source/blender/blenkernel/intern/workspace.c2
-rw-r--r--source/blender/windowmanager/intern/wm.c3
15 files changed, 24 insertions, 49 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index f82c0fb2436..22af8ffd191 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -47,6 +47,8 @@ enum {
IDTYPE_FLAGS_NO_LIBLINKING = 1 << 1,
/** Indicates that the given IDType does not support making a library-linked ID local. */
IDTYPE_FLAGS_NO_MAKELOCAL = 1 << 2,
+ /** Indicates that the given IDType does not have animation data. */
+ IDTYPE_FLAGS_NO_ANIMDATA = 1 << 3,
};
typedef struct IDCacheKey {
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 1ce0d07a135..3b02087e2d2 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -282,7 +282,7 @@ IDTypeInfo IDType_ID_AC = {
.name = "Action",
.name_plural = "actions",
.translation_context = BLT_I18NCONTEXT_ID_ACTION,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = action_copy_data,
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index c26fc6578f1..7e00b1a6407 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -31,6 +31,7 @@
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
#include "BKE_global.h"
+#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
@@ -70,42 +71,11 @@ static CLG_LogRef LOG = {"bke.anim_sys"};
/* Check if ID can have AnimData */
bool id_type_can_have_animdata(const short id_type)
{
- /* Only some ID-blocks have this info for now */
- /* TODO: finish adding this for the other blocktypes */
- switch (id_type) {
- /* has AnimData */
- case ID_OB:
- case ID_ME:
- case ID_MB:
- case ID_CU:
- case ID_AR:
- case ID_LT:
- case ID_KE:
- case ID_PA:
- case ID_MA:
- case ID_TE:
- case ID_NT:
- case ID_LA:
- case ID_CA:
- case ID_WO:
- case ID_LS:
- case ID_LP:
- case ID_SPK:
- case ID_SCE:
- case ID_MC:
- case ID_MSK:
- case ID_GD:
- case ID_CF:
- case ID_HA:
- case ID_PT:
- case ID_VO:
- case ID_SIM:
- return true;
-
- /* no AnimData */
- default:
- return false;
+ const IDTypeInfo *typeinfo = BKE_idtype_get_info_from_idcode(id_type);
+ if (typeinfo != NULL) {
+ return (typeinfo->flags & IDTYPE_FLAGS_NO_ANIMDATA) == 0;
}
+ return false;
}
bool id_can_have_animdata(const ID *id)
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 3e45d7377b2..f559689608f 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -363,7 +363,7 @@ IDTypeInfo IDType_ID_BR = {
.name = "Brush",
.name_plural = "brushes",
.translation_context = BLT_I18NCONTEXT_ID_BRUSH,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = brush_init_data,
.copy_data = brush_copy_data,
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index de2ec273567..e49c0c63c84 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -166,7 +166,7 @@ IDTypeInfo IDType_ID_GR = {
.name = "Collection",
.name_plural = "collections",
.translation_context = BLT_I18NCONTEXT_ID_COLLECTION,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = collection_copy_data,
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 124e53b4008..e0bbdfaeed6 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -155,7 +155,7 @@ IDTypeInfo IDType_ID_VF = {
.name = "Font",
.name_plural = "fonts",
.translation_context = BLT_I18NCONTEXT_ID_VFONT,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = vfont_init_data,
.copy_data = vfont_copy_data,
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 0ddac216931..a02f2222503 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -311,7 +311,7 @@ IDTypeInfo IDType_ID_IM = {
.name = "Image",
.name_plural = "images",
.translation_context = BLT_I18NCONTEXT_ID_IMAGE,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = image_init_data,
.copy_data = image_copy_data,
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 3e92fd13370..17060750ed9 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -117,7 +117,8 @@ IDTypeInfo IDType_ID_IP = {
.name = "Ipo",
.name_plural = "ipos",
.translation_context = "",
- .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL |
+ IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = NULL,
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 4bbe3a4a26b..949e10d4721 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -68,7 +68,8 @@ IDTypeInfo IDType_ID_LI = {
.name = "Library",
.name_plural = "libraries",
.translation_context = BLT_I18NCONTEXT_ID_LIBRARY,
- .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL |
+ IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = NULL,
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index b09ee51995f..d363f5d0f5e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -133,7 +133,7 @@ IDTypeInfo IDType_ID_PAL = {
.name = "Palette",
.name_plural = "palettes",
.translation_context = BLT_I18NCONTEXT_ID_PALETTE,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = palette_init_data,
.copy_data = palette_copy_data,
@@ -194,7 +194,7 @@ IDTypeInfo IDType_ID_PC = {
.name = "PaintCurve",
.name_plural = "paint_curves",
.translation_context = BLT_I18NCONTEXT_ID_PAINTCURVE,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = paint_curve_copy_data,
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 16be894f9ad..d9686eba29a 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -238,7 +238,7 @@ IDTypeInfo IDType_ID_SCR = {
.name = "Screen",
.name_plural = "screens",
.translation_context = BLT_I18NCONTEXT_ID_SCREEN,
- .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_MAKELOCAL,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_MAKELOCAL | IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = NULL,
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index c8a31b51500..dbcc2482f5a 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -197,7 +197,7 @@ IDTypeInfo IDType_ID_SO = {
.name = "Sound",
.name_plural = "sounds",
.translation_context = BLT_I18NCONTEXT_ID_SOUND,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
/* A fuzzy case, think NULLified content is OK here... */
.init_data = NULL,
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 46e4581cb53..54999fd13f9 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -243,7 +243,7 @@ IDTypeInfo IDType_ID_TXT = {
.name = "Text",
.name_plural = "texts",
.translation_context = BLT_I18NCONTEXT_ID_TEXT,
- .flags = 0,
+ .flags = IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = text_init_data,
.copy_data = text_copy_data,
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index 775d83278e9..5db534b76b4 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -83,7 +83,7 @@ IDTypeInfo IDType_ID_WS = {
.name = "WorkSpace",
.name_plural = "workspaces",
.translation_context = BLT_I18NCONTEXT_ID_WORKSPACE,
- .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_MAKELOCAL,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_MAKELOCAL | IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = NULL,
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index db937737d07..12ccd2134cf 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -106,7 +106,8 @@ IDTypeInfo IDType_ID_WM = {
.name = "WindowManager",
.name_plural = "window_managers",
.translation_context = BLT_I18NCONTEXT_ID_WINDOWMANAGER,
- .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL,
+ .flags = IDTYPE_FLAGS_NO_COPY | IDTYPE_FLAGS_NO_LIBLINKING | IDTYPE_FLAGS_NO_MAKELOCAL |
+ IDTYPE_FLAGS_NO_ANIMDATA,
.init_data = NULL,
.copy_data = NULL,