fix [#28751] Item in Enum propertie is grayed out
authorCampbell Barton <ideasman42@gmail.com>
Tue, 27 Sep 2011 16:23:40 +0000 (16:23 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 27 Sep 2011 16:23:40 +0000 (16:23 +0000)
was infact a very old bug where an empty title took the following word for the title, eg: "%t|First Item|Second Item"
the first item would be evaluated as a title.

source/blender/editors/interface/interface_regions.c
source/blender/python/intern/bpy_props.c

index 4a9eb8113fe9ee0370913ea6e877b875d95f4825..4ecaec610531384e3c42ae126caae627b75eb4c1 100644 (file)
@@ -174,7 +174,7 @@ static MenuData *decompose_menu_string(const char *str)
                                *s= '\0';
                                s++;
                        } else if (s[1]=='t') {
-                               nitem_is_title= 1;
+                               nitem_is_title= (s[2] != '|'); /* check for empty title */
 
                                *s= '\0';
                                s++;
index a3d5bc99ad84f495127330ad80de34c230fb7f35..04c64bcbd3c162ac813208b1065d8f2b15269669 100644 (file)
@@ -973,7 +973,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 
                        PyErr_Format(PyExc_TypeError,
                                     "EnumProperty(..., default=\'%s\'): not found in enum members",
-                                    def);
+                                    def_cmp);
                        return NULL;
                }
        }