2
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ You want a color picker, right? If yes, see: blender.stackexchange.com/questions/6154/…, blender.stackexchange.com/questions/10665/…, blender.stackexchange.com/questions/6984/… $\endgroup$ – p2or Jun 8 '15 at 17:31
  • $\begingroup$ 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. $\endgroup$ – Mayqel Jun 8 '15 at 18:16
  • $\begingroup$ Ok. What do you want to pick? $\endgroup$ – p2or Jun 9 '15 at 9:06
  • $\begingroup$ 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) $\endgroup$ – Mayqel Jun 9 '15 at 15:31

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.