Blender V5.0
paint_sample_color.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cmath>
10#include <cstdlib>
11
12#include "DNA_material_types.h"
13#include "DNA_mesh_types.h"
14#include "DNA_object_types.h"
15
16#include "DNA_brush_types.h"
17#include "DNA_scene_types.h"
18
19#include "BLI_listbase.h"
20#include "BLI_math_color.h"
21#include "BLI_math_matrix.hh"
22#include "BLI_math_vector.hh"
23#include "BLI_rect.h"
24#include "BLI_string_utf8.h"
25#include "BLI_utildefines.h"
26
27#include "BLT_translation.hh"
28
29#include "BKE_brush.hh"
30#include "BKE_bvhutils.hh"
31#include "BKE_context.hh"
32#include "BKE_customdata.hh"
33#include "BKE_image.hh"
34#include "BKE_layer.hh"
35#include "BKE_material.hh"
36#include "BKE_mesh.hh"
37#include "BKE_mesh_sample.hh"
38#include "BKE_object.hh"
39#include "BKE_paint.hh"
40#include "BKE_paint_types.hh"
41#include "BKE_report.hh"
42
44
45#include "RNA_access.hh"
46#include "RNA_define.hh"
47
48#include "IMB_imbuf_types.hh"
49#include "IMB_interp.hh"
50
51#include "ED_grease_pencil.hh"
52#include "ED_image.hh"
53#include "ED_screen.hh"
54#include "ED_view3d.hh"
55
56#include "ED_mesh.hh" /* for face mask functions */
57
58#include "UI_interface_types.hh"
59
60#include "WM_api.hh"
61#include "WM_types.hh"
62
64
65#include "paint_intern.hh"
66
67/* -------------------------------------------------------------------- */
70
71/* compute uv coordinates of mouse in face */
72static blender::float2 imapaint_pick_uv(const Mesh *mesh_eval,
73 Scene *scene,
74 Object *ob_eval,
75 const int tri_index,
76 const blender::float3 &bary_coord)
77{
78 using namespace blender;
80
81 const Span<int3> tris = mesh_eval->corner_tris();
82 const Span<int> tri_faces = mesh_eval->corner_tri_faces();
83
84 const bke::AttributeAccessor attributes = mesh_eval->attributes();
85 const VArray<int> material_indices = *attributes.lookup_or_default<int>(
86 "material_index", bke::AttrDomain::Face, 0);
87
88 /* face means poly here, not triangle, indeed */
89 const int face_i = tri_faces[tri_index];
90
91 VArraySpan<float2> uv_map;
92
93 if (mode == PAINT_CANVAS_SOURCE_MATERIAL) {
94 const Material *ma;
95 const TexPaintSlot *slot;
96
97 ma = BKE_object_material_get(ob_eval, material_indices[face_i] + 1);
98 slot = &ma->texpaintslot[ma->paint_active_slot];
99 if (slot && slot->uvname) {
100 uv_map = *attributes.lookup<float2>(slot->uvname, bke::AttrDomain::Corner);
101 }
102 }
103
104 if (uv_map.is_empty()) {
105 const char *active_name = CustomData_get_active_layer_name(&mesh_eval->corner_data,
107 uv_map = *attributes.lookup<float2>(active_name, bke::AttrDomain::Corner);
108 }
109
111 bary_coord, tris[tri_index], uv_map);
112}
113
114/* returns 0 if not found, otherwise 1 */
116 const int mval[2],
117 int *r_tri_index,
118 int *r_face_index,
119 blender::float3 *r_bary_coord,
120 const Mesh &mesh)
121{
122 using namespace blender;
123 if (mesh.faces_num == 0) {
124 return 0;
125 }
126
127 float3 start_world, end_world;
129 vc->depsgraph, vc->region, vc->v3d, float2(mval[0], mval[1]), start_world, end_world, true);
130
131 const float4x4 &world_to_object = vc->obact->world_to_object();
132 const float3 start_object = math::transform_point(world_to_object, start_world);
133 const float3 end_object = math::transform_point(world_to_object, end_world);
134
135 bke::BVHTreeFromMesh mesh_bvh = mesh.bvh_corner_tris();
136
137 BVHTreeRayHit ray_hit;
138 ray_hit.dist = FLT_MAX;
139 ray_hit.index = -1;
140 BLI_bvhtree_ray_cast(mesh_bvh.tree,
141 start_object,
142 math::normalize(end_object - start_object),
143 0.0f,
144 &ray_hit,
145 mesh_bvh.raycast_callback,
146 &mesh_bvh);
147 if (ray_hit.index == -1) {
148 return 0;
149 }
150
152 mesh.vert_positions(), mesh.corner_verts(), mesh.corner_tris()[ray_hit.index], ray_hit.co);
153
154 *r_tri_index = ray_hit.index;
155 *r_face_index = mesh.corner_tri_faces()[ray_hit.index];
156 return 1;
157}
158
160 bContext *C, ARegion *region, int x, int y, bool texpaint_proj, bool use_palette)
161{
162 using namespace blender;
163 Scene *scene = CTX_data_scene(C);
166 Palette *palette = BKE_paint_palette(paint);
167 PaletteColor *color = nullptr;
169
170 CLAMP(x, 0, region->winx);
171 CLAMP(y, 0, region->winy);
172
173 if (use_palette) {
174 if (!palette) {
175 palette = BKE_palette_add(CTX_data_main(C), "Palette");
176 BKE_paint_palette_set(paint, palette);
177 }
178
179 color = BKE_palette_color_add(palette);
180 palette->active_color = BLI_listbase_count(&palette->colors) - 1;
181 }
182
184 const View3D *v3d = CTX_wm_view3d(C);
185
186 if (v3d && texpaint_proj) {
187 /* first try getting a color directly from the mesh faces if possible */
188 ViewLayer *view_layer = CTX_data_view_layer(C);
189 BKE_view_layer_synced_ensure(scene, view_layer);
191 Object *ob_eval = DEG_get_evaluated(depsgraph, ob);
192 ImagePaintSettings *imapaint = &scene->toolsettings->imapaint;
193 bool use_material = (imapaint->mode == IMAGEPAINT_MODE_MATERIAL);
194
195 if (ob) {
196 const Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob_eval);
197 const bke::AttributeAccessor attributes = mesh_eval->attributes();
198 const VArray material_indices = *attributes.lookup_or_default<int>(
199 "material_index", bke::AttrDomain::Face, 0);
200
203
204 const int mval[2] = {x, y};
205 int tri_index;
206 float3 bary_coord;
207 int faceindex;
208 const VArray<bool> hide_poly = *mesh_eval->attributes().lookup_or_default<bool>(
209 ".hide_poly", bke::AttrDomain::Face, false);
210 const bool is_hit = imapaint_pick_face(
211 &vc, mval, &tri_index, &faceindex, &bary_coord, *mesh_eval) &&
212 !hide_poly[faceindex];
213
214 if (is_hit) {
215 Image *image = nullptr;
217
218 if (use_material) {
219 /* Image and texture interpolation from material. */
220 Material *ma = BKE_object_material_get(ob_eval, material_indices[faceindex] + 1);
221
222 /* Force refresh since paint slots are not updated when changing interpolation. */
223 BKE_texpaint_slot_refresh_cache(scene, ma, ob);
224
225 if (ma && ma->texpaintslot) {
226 image = ma->texpaintslot[ma->paint_active_slot].ima;
228 }
229 }
230 else {
231 /* Image and texture interpolation from tool settings. */
232 image = imapaint->canvas;
233 interp = imapaint->interp;
234 }
235
236 if (image) {
237 /* XXX get appropriate ImageUser instead */
238 ImageUser iuser;
239 BKE_imageuser_default(&iuser);
240 iuser.framenr = image->lastframe;
241
242 float2 uv = imapaint_pick_uv(mesh_eval, scene, ob_eval, tri_index, bary_coord);
243
244 if (image->source == IMA_SRC_TILED) {
245 float new_uv[2];
246 iuser.tile = BKE_image_get_tile_from_pos(image, uv, new_uv, nullptr);
247 uv[0] = new_uv[0];
248 uv[1] = new_uv[1];
249 }
250
251 ImBuf *ibuf = BKE_image_acquire_ibuf(image, &iuser, nullptr);
252 if (ibuf && (ibuf->byte_buffer.data || ibuf->float_buffer.data)) {
253 float u = uv[0] * ibuf->x;
254 float v = uv[1] * ibuf->y;
255
256 if (ibuf->float_buffer.data) {
257 float4 rgba_f = interp == SHD_INTERP_CLOSEST ?
260 rgba_f = math::clamp(rgba_f, 0.0f, 1.0f);
261 straight_to_premul_v4(rgba_f);
262 if (use_palette) {
264 }
265 else {
266 BKE_brush_color_set(paint, br, rgba_f);
267 }
268 }
269 else {
273 float rgba_f[4];
274 rgba_uchar_to_float(rgba_f, rgba);
275
276 if ((ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA) == 0) {
278 ibuf->byte_buffer.colorspace);
279 }
280
281 if (use_palette) {
283 }
284 else {
285 BKE_brush_color_set(paint, br, rgba_f);
286 }
287 }
288 BKE_image_release_ibuf(image, ibuf, nullptr);
289 return;
290 }
291
292 BKE_image_release_ibuf(image, ibuf, nullptr);
293 }
294 }
295 }
296 }
297 }
298 else if (sima != nullptr) {
299 /* Sample from the active image buffer. The sampled color is in
300 * Linear Scene Reference Space. */
301 float rgba_f[3];
302 bool is_data;
303 if (ED_space_image_color_sample(sima, region, blender::int2(x, y), rgba_f, &is_data)) {
304 if (use_palette) {
306 }
307 else {
308 BKE_brush_color_set(paint, br, rgba_f);
309 }
310 return;
311 }
312 }
313
314 /* No sample found; sample directly from the GPU front buffer. */
315 {
316 float rgb_fl[3];
319 blender::int2(x + region->winrct.xmin, y + region->winrct.ymin),
320 rgb_fl);
321
322 /* The sampled color is in display colorspace, convert to scene linear. */
326
327 if (use_palette) {
329 }
330 else {
331 BKE_brush_color_set(paint, br, rgb_fl);
332 }
333 }
334}
335
342
344{
345 char msg[UI_MAX_DRAW_STR];
346 ScrArea *area = CTX_wm_area(C);
347
348 if (area) {
349 SNPRINTF_UTF8(msg,
350 IFACE_("Sample color for %s"),
351 !data->sample_palette ?
352 IFACE_("Brush. Use Left Click to sample for palette instead") :
353 IFACE_("Palette. Use Left Click to sample more colors"));
355 }
356}
357
359{
361 Brush *brush = BKE_paint_brush(paint);
363 ARegion *region = CTX_wm_region(C);
364 wmWindow *win = CTX_wm_window(C);
365 const bool show_cursor = ((paint->flags & PAINT_SHOW_BRUSH) != 0);
366 int location[2];
367 paint->flags &= ~PAINT_SHOW_BRUSH;
368
369 /* force redraw without cursor */
370 WM_paint_cursor_tag_redraw(win, region);
372
373 RNA_int_get_array(op->ptr, "location", location);
374 const bool use_palette = RNA_boolean_get(op->ptr, "palette");
375 const bool use_sample_texture = (mode == PaintMode::Texture3D) &&
376 !RNA_boolean_get(op->ptr, "merged");
377
378 paint_sample_color(C, region, location[0], location[1], use_sample_texture, use_palette);
379
380 if (show_cursor) {
381 paint->flags |= PAINT_SHOW_BRUSH;
382 }
383
385
386 return OPERATOR_FINISHED;
387}
388
390{
392 Brush *brush = BKE_paint_brush(paint);
393 SampleColorData *data = MEM_new<SampleColorData>("sample color custom data");
394 ARegion *region = CTX_wm_region(C);
395 wmWindow *win = CTX_wm_window(C);
396
397 data->launch_event = WM_userdef_event_type_from_keymap_type(event->type);
398 data->show_cursor = ((paint->flags & PAINT_SHOW_BRUSH) != 0);
399 copy_v3_v3(data->initcolor, BKE_brush_color_get(paint, brush));
400 data->sample_palette = false;
401 op->customdata = data;
402 paint->flags &= ~PAINT_SHOW_BRUSH;
403
405
407
408 /* force redraw without cursor */
409 WM_paint_cursor_tag_redraw(win, region);
411
412 RNA_int_set_array(op->ptr, "location", event->mval);
413
415 const bool use_sample_texture = (mode == PaintMode::Texture3D) &&
416 !RNA_boolean_get(op->ptr, "merged");
417
418 paint_sample_color(C, region, event->mval[0], event->mval[1], use_sample_texture, false);
420
422
424}
425
427{
428 SampleColorData *data = static_cast<SampleColorData *>(op->customdata);
430 Brush *brush = BKE_paint_brush(paint);
431
432 if ((event->type == data->launch_event) && (event->val == KM_RELEASE)) {
433 if (data->show_cursor) {
434 paint->flags |= PAINT_SHOW_BRUSH;
435 }
436
437 if (data->sample_palette) {
438 BKE_brush_color_set(paint, brush, data->initcolor);
439 RNA_boolean_set(op->ptr, "palette", true);
441 }
443 MEM_delete(data);
444 ED_workspace_status_text(C, nullptr);
445
446 return OPERATOR_FINISHED;
447 }
448
450 const bool use_sample_texture = (mode == PaintMode::Texture3D) &&
451 !RNA_boolean_get(op->ptr, "merged");
452
453 switch (event->type) {
454 case MOUSEMOVE: {
455 ARegion *region = CTX_wm_region(C);
456 RNA_int_set_array(op->ptr, "location", event->mval);
457 paint_sample_color(C, region, event->mval[0], event->mval[1], use_sample_texture, false);
459 break;
460 }
461
462 case LEFTMOUSE:
463 if (event->val == KM_PRESS) {
464 ARegion *region = CTX_wm_region(C);
465 RNA_int_set_array(op->ptr, "location", event->mval);
466 paint_sample_color(C, region, event->mval[0], event->mval[1], use_sample_texture, true);
467 if (!data->sample_palette) {
468 data->sample_palette = true;
470 BKE_report(op->reports, RPT_INFO, "Sampling color for palette");
471 }
473 }
474 break;
475 default: {
476 break;
477 }
478 }
479
481}
482
488
490{
491 /* identifiers */
492 ot->name = "Sample Color";
493 ot->idname = "PAINT_OT_sample_color";
494 ot->description = "Use the mouse to sample a color in the image";
495
496 /* API callbacks. */
497 ot->exec = sample_color_exec;
498 ot->invoke = sample_color_invoke;
499 ot->modal = sample_color_modal;
500 ot->poll = sample_color_poll;
501
502 /* flags */
504
505 /* properties */
506 PropertyRNA *prop;
507
508 prop = RNA_def_int_vector(
509 ot->srna, "location", 2, nullptr, 0, INT_MAX, "Location", "", 0, 16384);
511
512 RNA_def_boolean(ot->srna, "merged", false, "Sample Merged", "Sample the output display color");
513 RNA_def_boolean(ot->srna, "palette", false, "Add to Palette", "");
514}
515
const float * BKE_brush_color_get(const Paint *paint, const Brush *brush)
Definition brush.cc:1161
void BKE_brush_color_set(Paint *paint, Brush *brush, const float color[3])
Definition brush.cc:1213
SpaceImage * CTX_wm_space_image(const bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
const char * CustomData_get_active_layer_name(const CustomData *data, eCustomDataType type)
int BKE_image_get_tile_from_pos(Image *ima, const float uv[2], float r_uv[2], float r_ofs[2])
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
void BKE_imageuser_default(ImageUser *iuser)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
General operations, lookup, etc. for materials.
void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma, const Object *ob)
Material * BKE_object_material_get(Object *ob, short act)
General operations, lookup, etc. for blender objects.
Mesh * BKE_object_get_evaluated_mesh(const Object *object_eval)
PaletteColor * BKE_palette_color_add(Palette *palette)
Definition paint.cc:1433
Paint * BKE_paint_get_active_from_context(const bContext *C)
Definition paint.cc:476
Palette * BKE_palette_add(Main *bmain, const char *name)
Definition paint.cc:1427
Brush * BKE_paint_brush(Paint *paint)
Definition paint.cc:645
void BKE_palette_color_set(PaletteColor *color, const float rgb[3])
Definition paint.cc:1416
Palette * BKE_paint_palette(Paint *paint)
Definition paint.cc:1375
void BKE_paint_palette_set(Paint *paint, Palette *palette)
Definition paint.cc:1380
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
Definition paint.cc:505
PaintMode
@ RPT_INFO
Definition BKE_report.hh:35
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
int BLI_bvhtree_ray_cast(const BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
int BLI_listbase_count(const ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:524
MINLINE void straight_to_premul_v4(float color[4])
MINLINE void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define SNPRINTF_UTF8(dst, format,...)
#define CLAMP(a, b, c)
#define IFACE_(msgid)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ CD_PROP_FLOAT2
@ IMA_SRC_TILED
@ SHD_INTERP_LINEAR
@ SHD_INTERP_CLOSEST
Object is a sort of wrapper for general info.
#define IMAGEPAINT_MODE_MATERIAL
@ PAINT_SHOW_BRUSH
ePaintCanvasSource
@ PAINT_CANVAS_SOURCE_MATERIAL
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
bool ED_space_image_color_sample(SpaceImage *sima, ARegion *region, const int mval[2], float r_col[3], bool *r_is_data)
void ED_workspace_status_text(bContext *C, const char *str)
Definition area.cc:1024
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
bool ED_view3d_win_to_segment_clipped(const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes)
void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], const ColorSpace *colorspace)
void IMB_colormanagement_display_to_scene_linear_v3(float pixel[3], const ColorManagedDisplay *display, const ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW)
const ColorManagedDisplay * IMB_colormanagement_display_get_named(const char *name)
@ IMB_COLORMANAGE_IS_DATA
@ PROP_SKIP_SAVE
Definition RNA_types.hh:344
@ PROP_HIDDEN
Definition RNA_types.hh:338
#define C
Definition RandGen.cpp:29
#define UI_MAX_DRAW_STR
blender::ocio::Display ColorManagedDisplay
#define NC_BRUSH
Definition WM_types.hh:385
@ KM_PRESS
Definition WM_types.hh:311
@ KM_RELEASE
Definition WM_types.hh:312
@ OPTYPE_DEPENDS_ON_CURSOR
Definition WM_types.hh:218
@ OPTYPE_REGISTER
Definition WM_types.hh:180
#define NA_EDITED
Definition WM_types.hh:584
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v
BPy_StructRNA * depsgraph
AttributeSet attributes
constexpr bool is_empty() const
Definition BLI_span.hh:260
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GAttributeReader lookup(const StringRef attribute_id) const
MatBase< 4, 4 > float4x4
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:502
float3 compute_bary_coord_in_triangle(Span< float3 > vert_positions, Span< int > corner_verts, const int3 &corner_tri, const float3 &position)
T sample_corner_attribute_with_bary_coords(const float3 &bary_weights, const int3 &corner_tri, const Span< T > corner_attribute)
bool grease_pencil_painting_poll(bContext *C)
uchar4 interpolate_nearest_wrap_byte(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:42
uchar4 interpolate_bilinear_wrap_byte(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:95
float4 interpolate_nearest_wrap_fl(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:46
float4 interpolate_bilinear_wrap_fl(const ImBuf *in, float u, float v)
Definition IMB_interp.hh:99
T clamp(const T &a, const T &min, const T &max)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< float, 3 > float3
bool image_paint_poll_ignore_tool(bContext *C)
bool vertex_paint_poll_ignore_tool(bContext *C)
static blender::float2 imapaint_pick_uv(const Mesh *mesh_eval, Scene *scene, Object *ob_eval, const int tri_index, const blender::float3 &bary_coord)
static int imapaint_pick_face(ViewContext *vc, const int mval[2], int *r_tri_index, int *r_face_index, blender::float3 *r_bary_coord, const Mesh &mesh)
static wmOperatorStatus sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void PAINT_OT_sample_color(wmOperatorType *ot)
static void sample_color_update_header(SampleColorData *data, bContext *C)
static wmOperatorStatus sample_color_exec(bContext *C, wmOperator *op)
static void paint_sample_color(bContext *C, ARegion *region, int x, int y, bool texpaint_proj, bool use_palette)
static bool sample_color_poll(bContext *C)
static wmOperatorStatus sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
#define FLT_MAX
Definition stdcycles.h:14
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
int colormanage_flag
struct Image * canvas
short source
short paint_active_slot
struct TexPaintSlot * texpaintslot
CustomData corner_data
int faces_num
ListBase colors
struct ToolSettings * toolsettings
ColorManagedDisplaySettings display_settings
struct Image * ima
struct ImagePaintSettings imapaint
ARegion * region
Definition ED_view3d.hh:77
View3D * v3d
Definition ED_view3d.hh:78
Object * obact
Definition ED_view3d.hh:75
Depsgraph * depsgraph
Definition ED_view3d.hh:72
BVHTree_RayCastCallback raycast_callback
int ymin
int xmin
wmEventType type
Definition WM_types.hh:757
short val
Definition WM_types.hh:759
int mval[2]
Definition WM_types.hh:763
struct ReportList * reports
struct PointerRNA * ptr
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
@ WM_CURSOR_EYEDROPPER
Definition wm_cursors.hh:36
void WM_redraw_windows(bContext *C)
Definition wm_draw.cc:1695
void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *)
Definition wm_draw.cc:1606
bool WM_window_pixels_read_sample(bContext *C, wmWindow *win, const int pos[2], float r_col[3])
Definition wm_draw.cc:1492
int WM_userdef_event_type_from_keymap_type(int kmitype)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
@ MOUSEMOVE
@ LEFTMOUSE
wmOperatorType * ot
Definition wm_files.cc:4237