83 const char *display_device;
101 const float col_conv[4],
102 const bool only_stroke,
103 const bool only_fill,
114 for (
short i = 0; i < *totcol; i++) {
121 if (gp_style !=
NULL) {
135 else if ((both) && (found_stroke) && (found_fill)) {
172 else if (only_fill) {
230 const bool only_stroke = (
event->modifier & (
KM_CTRL |
KM_SHIFT)) == 0;
248 if (eye->
mode == 0) {
273 switch (event->
type) {
275 switch (event->
val) {
362 ot->
name =
"Grease Pencil Eyedropper";
363 ot->
idname =
"UI_OT_eyedropper_gpencil_color";
364 ot->
description =
"Sample a color from the Blender Window and create Grease Pencil material";
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct Material * BKE_gpencil_object_material_new(struct Main *bmain, struct Object *ob, const char *name, int *r_index)
void id_us_min(struct ID *id)
General operations, lookup, etc. for materials.
struct Material * BKE_object_material_get(struct Object *ob, short act)
short * BKE_object_material_len_p(struct Object *ob)
struct Palette * BKE_palette_add(struct Main *bmain, const char *name)
void BKE_paint_palette_set(struct Paint *p, struct Palette *palette)
struct PaletteColor * BKE_palette_color_add(struct Palette *palette)
#define LISTBASE_FOREACH(type, var, list)
MINLINE bool compare_v3v3(const float a[3], const float b[3], float limit) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void zero_v4(float r[4])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
void DEG_relations_tag_update(struct Main *bmain)
@ GP_MATERIAL_STROKE_SHOW
void ED_workspace_status_text(struct bContext *C, const char *str)
void ED_undo_push(struct bContext *C, const char *str)
void IMB_colormanagement_scene_linear_to_display_v3(float pixel[3], struct ColorManagedDisplay *display)
struct ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
Read Guarded memory(de)allocation.
void eyedropper_color_sample_fl(bContext *C, const int m_xy[2], float r_col[3])
get the color from the screen.
static void eyedropper_gpencil_color_sample(bContext *C, EyedropperGPencil *eye, const int m_xy[2])
static void eyedropper_gpencil_status_indicators(bContext *C)
static void eyedropper_gpencil_cancel(bContext *C, wmOperator *op)
static void eyedropper_add_material(bContext *C, const float col_conv[4], const bool only_stroke, const bool only_fill, const bool both)
static int eyedropper_gpencil_exec(bContext *C, wmOperator *op)
static bool eyedropper_gpencil_init(bContext *C, wmOperator *op)
static bool eyedropper_gpencil_poll(bContext *C)
void UI_OT_eyedropper_gpencil_color(wmOperatorType *ot)
static void eyedropper_gpencil_exit(bContext *C, wmOperator *op)
static int eyedropper_gpencil_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void eyedropper_gpencil_color_set(bContext *C, const wmEvent *event, EyedropperGPencil *eye)
static void eyedropper_add_palette_color(bContext *C, const float col_conv[4])
struct EyedropperGPencil EyedropperGPencil
static int eyedropper_gpencil_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
@ EYE_MODAL_SAMPLE_CONFIRM
void *(* MEM_callocN)(size_t len, const char *str)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct ColorManagedDisplay * display
struct MaterialGPencilStyle * gp_style
struct ToolSettings * toolsettings
ColorManagedDisplaySettings display_settings
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)