I recently found out about the great "Paint Palettes" addon that comes with Blender but one thing that I really would have liked to see implemented is useful tooltips like name and/or values for when hovering over colors.
I searched stackoverflow for a while and found out about dynamic tooltips for operators (Changing tooltip for menu entries which use the same operator), but there doesn't seem to be (an easy) one for properties (Is there any way to override UILayout.prop tooltip?)
I customized the addon to display names by adding this code in "class IMAGE_OT_select_color(Operator)" at line 440:
@classmethod def description(cls, context, properties): pp = context.scene.palette_props color_name = pp.colors[properties.color_index].name return color_name
so now tooltip works and displays name of color when hovering over 'paint.select_color' operator. Yay, not bad for a noob programmer.
How do I do the same for the color box above it which is a UILayout.prop in stead of a UILayout.operator?
If custom/dynamic tooltips for properties is not possible, is wrapping a property inside an operator and using that operator as a ui element an option and how can that be done in this situation?
Thanks in advance.