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:
authorBastien Montagne <bastien@blender.org>2021-09-16 15:26:49 +0300
committerBastien Montagne <bastien@blender.org>2021-09-16 15:30:56 +0300
commite97653ccf3356c57100606f0a0a175dbf4676df7 (patch)
treef8a8dd65db3c1dddcaa1c8684b6a07c5b5c30ff2 /source/blender/blenkernel/BKE_idtype.h
parent3deb56424f2927ffe8a7ca8ef3de3fa5bc56e304 (diff)
Fix: properly implement the 'only append' execption case for WorkSpaces.
Add needed extra flag and utils to IDType to mark and check an ID type as only appendable. Note that this is only a loose user-level enforcement currently, in any case you need to be able to link an ID to append it currently, so for low-level code this does not really matter. Currently only WorkSpace and Screen ID types are marked with the new `IDTYPE_FLAGS_ONLY_APPEND` flag.
Diffstat (limited to 'source/blender/blenkernel/BKE_idtype.h')
-rw-r--r--source/blender/blenkernel/BKE_idtype.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index 3b45db19919..7136a3fd7af 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -45,6 +45,10 @@ enum {
IDTYPE_FLAGS_NO_COPY = 1 << 0,
/** Indicates that the given IDType does not support linking/appending from a library file. */
IDTYPE_FLAGS_NO_LIBLINKING = 1 << 1,
+ /** Indicates that the given IDType should not be directly linked from a library file, but may be
+ * appended.
+ * NOTE: Mutually exclusive with `IDTYPE_FLAGS_NO_LIBLINKING`. */
+ IDTYPE_FLAGS_ONLY_APPEND = 1 << 2,
/** Indicates that the given IDType does not have animation data. */
IDTYPE_FLAGS_NO_ANIMDATA = 1 << 3,
};
@@ -285,6 +289,7 @@ const char *BKE_idtype_idcode_to_translation_context(const short idcode);
bool BKE_idtype_idcode_is_valid(const short idcode);
bool BKE_idtype_idcode_is_linkable(const short idcode);
+bool BKE_idtype_idcode_is_only_appendable(const short idcode);
/* Macro currently, since any linkable IDtype should be localizable. */
#define BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable