From 08a92d8578ea57109406022f75bc7b123e9cbcbb Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 31 Oct 2018 12:18:36 +0100 Subject: UI/Unique ID name: add library ID name if present. Also reshuffle a bit that whole code, did some renaming, `BKE_id_to_unique_string_key()` is now using same base code (instead of using whole library filepath...), etc. --- source/blender/makesrna/intern/rna_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern/rna_main.c') diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index a807e363842..4f145d1f48d 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -310,15 +310,14 @@ static int rna_ID_lookup_string(ListBase *lb, const char *key, PointerRNA *r_ptr { ID *id; for (id = lb->first; id != NULL; id = id->next) { - printf("%s vs %s\n", id->name, key); if (STREQ(id->name + 2, key)) { break; } else if (strstr(key, id->name + 2) != NULL) { - char uiname[MAX_ID_NAME * 3]; - BKE_id_ui_prefix(uiname, id); - printf("second chance: %s vs %s\n", uiname, key); - if (STREQ(uiname, key)) { + char full_name_ui[MAX_ID_FULL_NAME_UI]; + BKE_id_full_name_ui_prefix_get(full_name_ui, id); + /* Second check skips the three 'UI keycode letters' prefix. */ + if (STREQ(full_name_ui, key) || STREQ(full_name_ui + 3, key)) { break; } } -- cgit v1.2.3