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 12:11:45 +0300
committerBastien Montagne <bastien@blender.org>2021-09-16 15:30:55 +0300
commit4f38624bf5df66ed1cf03a7167c9f959bab21ef9 (patch)
treee9947d6fed40ad62346f1e92fd72f59046ab5ffc
parent95c2f0bea8b4991acb97ac69c1b516a7c4fd14d7 (diff)
IDType: Add `BKE_idtype_idcode_is_localizable`.
This is the same as `BKE_idtype_idcode_is_linkable` currently, used only in one place in UI code of IDtemplate.
-rw-r--r--source/blender/blenkernel/BKE_idtype.h6
-rw-r--r--source/blender/editors/interface/interface_templates.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index 66355ac82ac..3b45db19919 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -281,9 +281,13 @@ const struct IDTypeInfo *BKE_idtype_get_info_from_id(const struct ID *id);
const char *BKE_idtype_idcode_to_name(const short idcode);
const char *BKE_idtype_idcode_to_name_plural(const short idcode);
const char *BKE_idtype_idcode_to_translation_context(const short idcode);
-bool BKE_idtype_idcode_is_linkable(const short idcode);
+
bool BKE_idtype_idcode_is_valid(const short idcode);
+bool BKE_idtype_idcode_is_linkable(const short idcode);
+/* Macro currently, since any linkable IDtype should be localizable. */
+#define BKE_idtype_idcode_is_localizable BKE_idtype_idcode_is_linkable
+
short BKE_idtype_idcode_from_name(const char *idtype_name);
uint64_t BKE_idtype_idcode_to_idfilter(const short idcode);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 08d78552710..b9e4f2ef44a 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -1031,7 +1031,7 @@ static void template_ID(const bContext *C,
UI_but_flag_enable(but, UI_BUT_DISABLED);
}
else {
- const bool disabled = (!BKE_lib_id_make_local(CTX_data_main(C), id, true /* test */, 0) ||
+ const bool disabled = (!BKE_idtype_idcode_is_localizable(GS(id->name)) ||
(idfrom && idfrom->lib));
but = uiDefIconBut(block,
UI_BTYPE_BUT,