2

I need an eyedropper button in my UI. My question is about how do I use bpy.ops.ui.eyedropper_color() correctly? I tried

layout.operator(bpy.ops.paint.sample_color.idname())

which nicely draws me a button on the UI, but has no function (but also no error message). I also tried

layout.operator(bpy.ops.paint.sample_color.idname())

which is successful, but automatically assigns the color to the active brush, while I need to assign it to my own prop. Furthermore, I need it outside the paint context. ...any ideas?

Mayqel
  • 443
  • 1
  • 5
  • 12
  • You want a color picker, right? If yes, see: http://blender.stackexchange.com/questions/6154/custom-color-property-in-panel-draw-layout, http://blender.stackexchange.com/questions/10665/how-to-make-interface-for-add-on-with-mutipule-colorpickers, http://blender.stackexchange.com/questions/6984/color-as-custom-property – p2or Jun 08 '15 at 17:31
  • hm no, that's not it... what I need is a pipette functionality which can be accessed directly by a button / hotkey, without having to open a color wheel widget. – Mayqel Jun 08 '15 at 18:16
  • Ok. What do you want to pick? – p2or Jun 09 '15 at 09:06
  • 1
    well, imagine you have a global hotkey, or a button on the menu bar or something like that. You press / click it, the cursor becomes a pipette icon and you can sample a color from anywhere on the screen (e.g. from a video in the sequencer, or from an RGB node's color field, just everywhere).

    The cool thing: the eyedropper of the standard color picker widget (bpy.ops.ui.eyedropper_color, that is) is doing exactly what I want. I just need it outside this widget.(which doesn't work so far)

    – Mayqel Jun 09 '15 at 15:31

0 Answers0