[Bf-blender-cvs] [26d5c24f0aa] master: Fix T80258: UILayout.prop_search() issues with datablock names

Philipp Oeser noreply at git.blender.org
Tue Sep 1 15:29:15 CEST 2020


Commit: 26d5c24f0aad85d137f7e465858877d80c0d6a36
Author: Philipp Oeser
Date:   Mon Aug 31 12:37:50 2020 +0200
Branches: master
https://developer.blender.org/rB26d5c24f0aad85d137f7e465858877d80c0d6a36

Fix T80258: UILayout.prop_search() issues with datablock names

If the search menu was used for a string property, and a data-block was
selected from the search, the value set would be an invalid name. The
property would get the modified UI string, not the proper data name set.

This problem was already once solved in rB249ccab111ac, but resurfaced
in rB937d89afba36.

Now only use the modified UI string if requires_exact_data_name is not
true.

Note: the comments in rB249ccab111ac [reg. library hints and string
properties, also that pointer properties are preferred over string
properties when dealing with IDs] still apply.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8759

(cherry picked from 2.90 commit
cb0b0416f454419cd1902434f7dffa2682417a56)

===================================================================

M	source/blender/editors/interface/interface_utils.c

===================================================================

diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 6be281cd050..c413cac6023 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -489,7 +489,7 @@ void ui_rna_collection_search_update_fn(const struct bContext *C,
     /* If no item has an own icon to display, libraries can use the library icons rather than the
      * name prefix for showing the library status. */
     int name_prefix_offset = cis->name_prefix_offset;
-    if (!has_id_icon && cis->is_id) {
+    if (!has_id_icon && cis->is_id && !requires_exact_data_name) {
       cis->iconid = UI_library_icon_get(cis->data);
       /* No need to re-allocate, string should be shorter than before (lib status prefix is
        * removed). */



More information about the Bf-blender-cvs mailing list