diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-10-31 14:18:36 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-10-31 15:34:06 +0300 |
commit | 08a92d8578ea57109406022f75bc7b123e9cbcbb (patch) | |
tree | 9e80c392c4cd726ed1b929888fafa1b2c66c40bc /source/blender/makesrna | |
parent | 7fe1ecf89dae2df2b0474df44defb806b4fa00c3 (diff) |
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.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 9 |
1 files changed, 4 insertions, 5 deletions
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; } } |