2
$\begingroup$

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.

color without useful tootip select color without useful tootip

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. select color with useful tootip 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.

$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.