69 float mouse_end[2]) = 0;
77 float mouse_end[2]) = 0;
97 paint_2d_stroke(stroke_handle, prev_mouse, mouse, eraser, pressure, distance, size);
116 float mouse_start[2],
117 float mouse_end[2])
override
128 float mouse_start[2],
129 float mouse_end[2])
override
159 paint_proj_stroke(C, stroke_handle, prev_mouse, mouse, eraser, pressure, distance, size);
178 float mouse_start[2],
179 float mouse_end[2])
override
181 paint_fill(C, scene, paint, brush, stroke, stroke_handle, mouse_start, mouse_end);
190 float mouse_start[2],
191 float mouse_end[2])
override
193 paint_fill(C, scene, paint, brush, stroke, stroke_handle, mouse_start, mouse_end);
203 float mouse_start[2],
287 const float mouse[2])
292 std::unique_ptr<PaintOperation> pop = std::make_unique<PaintOperation>();
306 bool uvs, mat,
tex, stencil;
312 pop->mode = MEM_new<ProjectionPaintMode>(
"ProjectionPaintMode");
315 pop->mode = MEM_new<ImagePaintMode>(
"ImagePaintMode");
318 pop->stroke_handle = pop->mode->paint_new_stroke(C, op, ob, mouse, mode);
319 if (!pop->stroke_handle) {
423 if (pop->s.warnmultifile) {
426 "Image requires 4 color channels to paint: %s",
427 pop->s.warnmultifile);
429 if (pop->s.warnpackedfile) {
432 "Packed MultiLayer files cannot be painted: %s",
433 pop->s.warnpackedfile);
440 std::unique_ptr<PaintOperation> pop;
514 float dummy_location[3];
517 paint_brush_update(C, brush, mode, stroke, mouse, mouse_out, pressure, dummy_location, &dummy);
540 ot->
idname =
"PAINT_OT_image_paint";
bool BKE_brush_use_alpha_pressure(const Brush *brush)
int BKE_brush_size_get(const Scene *scene, const Brush *brush)
const float * BKE_brush_secondary_color_get(const Scene *scene, const Paint *paint, const Brush *brush)
void BKE_brush_alpha_set(Scene *scene, Brush *brush, float alpha)
float BKE_brush_alpha_get(const Scene *scene, const Brush *brush)
const float * BKE_brush_color_get(const Scene *scene, const Paint *paint, const Brush *brush)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
const Brush * BKE_paint_brush_for_read(const Paint *paint)
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
MINLINE float max_ff(float a, float b)
void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
@ IMAGE_PAINT_BRUSH_TYPE_FILL
#define OPERATOR_RETVAL_CHECK(ret)
bool ED_image_tools_paint_poll(bContext *C)
void ED_image_undo_push_begin(const char *name, PaintMode paint_mode)
void ED_image_undo_push_end()
void ED_paint_data_warning(ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil)
void ED_image_undo_restore(UndoStep *us)
bool ED_paint_proj_mesh_data_check(Scene &scene, Object &ob, bool *r_has_uvs, bool *r_has_mat, bool *r_has_tex, bool *r_has_stencil)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
virtual void paint_stroke_redraw(const bContext *C, void *stroke_handle, bool final)=0
virtual void paint_stroke_done(void *stroke_handle)=0
virtual void paint_gradient_fill(const bContext *C, const Scene *scene, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2])=0
virtual void paint_bucket_fill(const bContext *C, const Scene *scene, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2])=0
virtual void paint_stroke(bContext *C, void *stroke_handle, float prev_mouse[2], float mouse[2], int eraser, float pressure, float distance, float size)=0
virtual void * paint_new_stroke(bContext *C, wmOperator *op, Object *ob, const float mouse[2], int mode)=0
virtual ~AbstractPaintMode()=default
void paint_stroke(bContext *, void *stroke_handle, float prev_mouse[2], float mouse[2], int eraser, float pressure, float distance, float size) override
void paint_bucket_fill(const bContext *C, const Scene *scene, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
void paint_gradient_fill(const bContext *C, const Scene *, const Paint *, Brush *brush, PaintStroke *, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
void paint_stroke_done(void *stroke_handle) override
void * paint_new_stroke(bContext *C, wmOperator *op, Object *, const float[2], int mode) override
void paint_stroke_redraw(const bContext *C, void *stroke_handle, bool final) override
void * paint_new_stroke(bContext *C, wmOperator *, Object *ob, const float mouse[2], int mode) override
void paint_stroke_done(void *stroke_handle) override
void paint_gradient_fill(const bContext *C, const Scene *scene, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
void paint_stroke_redraw(const bContext *C, void *stroke_handle, bool final) override
void paint_bucket_fill(const bContext *C, const Scene *scene, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
void paint_stroke(bContext *C, void *stroke_handle, float prev_mouse[2], float mouse[2], int eraser, float pressure, float distance, float size) override
const Depsgraph * depsgraph
static void gradient_draw_line(bContext *, int x, int y, void *customdata)
static void paint_stroke_update_step(bContext *C, wmOperator *, PaintStroke *stroke, PointerRNA *itemptr)
static bool paint_stroke_test_start(bContext *C, wmOperator *op, const float mouse[2])
static std::unique_ptr< PaintOperation > texture_paint_init(bContext *C, wmOperator *op, const float mouse[2])
static void paint_stroke_done(const bContext *C, PaintStroke *stroke)
static int paint_exec(bContext *C, wmOperator *op)
static int paint_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void paint_stroke_redraw(const bContext *C, PaintStroke *stroke, bool final)
static void paint_cancel(bContext *C, wmOperator *op)
static int paint_modal(bContext *C, wmOperator *op, const wmEvent *event)
int paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke)
void paint_stroke_jitter_pos(Scene &scene, const PaintStroke &stroke, const PaintMode mode, const Brush &brush, const float pressure, const float mval[2], float r_mouse_out[2])
void paint_stroke_cancel(bContext *C, wmOperator *op, PaintStroke *stroke)
bool paint_stroke_flipped(PaintStroke *stroke)
int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintStroke **stroke_p)
bool paint_brush_update(bContext *C, const Brush &brush, PaintMode mode, PaintStroke *stroke, const float mouse_init[2], float mouse[2], float pressure, float r_location[3], bool *r_location_is_set)
void * paint_stroke_mode_data(PaintStroke *stroke)
float paint_stroke_distance_get(PaintStroke *stroke)
void paint_stroke_free(bContext *C, wmOperator *op, PaintStroke *stroke)
PaintStroke * paint_stroke_new(bContext *C, wmOperator *op, StrokeGetLocation get_location, StrokeTestStart test_start, StrokeUpdateStep update_step, StrokeRedraw redraw, StrokeDone done, int event_type)
bool paint_stroke_inverted(PaintStroke *stroke)
void paint_stroke_set_mode_data(PaintStroke *stroke, std::unique_ptr< PaintModeData > mode_data)
void * paint_2d_new_stroke(bContext *C, wmOperator *op, int mode)
void paint_2d_bucket_fill(const bContext *C, const float color[3], Brush *br, const float mouse_init[2], const float mouse_final[2], void *ps)
void paint_2d_gradient_fill(const bContext *C, Brush *br, const float mouse_init[2], const float mouse_final[2], void *ps)
void paint_2d_stroke_done(void *ps)
void paint_2d_stroke(void *ps, const float prev_mval[2], const float mval[2], const bool eraser, float pressure, float distance, float base_size)
void paint_2d_redraw(const bContext *C, void *ps, bool final)
void PAINT_OT_image_paint(wmOperatorType *ot)
void * paint_proj_new_stroke(bContext *C, Object *ob, const float mouse[2], int mode)
void paint_proj_stroke(const bContext *C, void *ps_handle_p, const float prev_pos[2], const float pos[2], const bool eraser, float pressure, float distance, float size)
void paint_proj_redraw(const bContext *C, void *ps_handle_p, bool final)
void paint_proj_stroke_done(void *ps_handle_p)
void paint_stroke_operator_properties(wmOperatorType *ot)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* cancel)(bContext *C, wmOperator *op)
struct ReportList * reports
struct wmOperatorType * type
struct UndoStack * undo_stack
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool WM_paint_cursor_end(wmPaintCursor *handle)
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)