I have a UIList in which I list materials to which I have attached an additional EnumProperty.

My goal is to highlight items in this UIList based on this EnumProperty by changing their background color. Is this possible?

I guess something like

if item.my_enum == "target_value":
    #I guess here i have to use something instead of layout.prop()?

in the draw_item() function is necessary?


You can't change the colors of items in the UI-List, arbitrarily.

You can however have an "active" property, which is an index that defines the active item in the UI list (as is used for vertex groups, uv layers... etc).

See the UI List template in the text editor.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.