70 float mouse_end[2]) = 0;
77 float mouse_end[2]) = 0;
115 float mouse_start[2],
116 float mouse_end[2])
override
126 float mouse_start[2],
127 float mouse_end[2])
override
175 float mouse_start[2],
176 float mouse_end[2])
override
178 paint_fill(
C,
paint, brush, stroke, stroke_handle, mouse_start, mouse_end);
186 float mouse_start[2],
187 float mouse_end[2])
override
189 paint_fill(
C,
paint, brush, stroke, stroke_handle, mouse_start, mouse_end);
198 float mouse_start[2],
285 const float mouse[2])
290 std::unique_ptr<PaintOperation> pop = std::make_unique<PaintOperation>();
304 bool uvs, mat, tex, stencil;
310 pop->mode = MEM_new<ProjectionPaintMode>(
"ProjectionPaintMode");
313 pop->mode = MEM_new<ImagePaintMode>(
"ImagePaintMode");
316 pop->stroke_handle = pop->mode->paint_new_stroke(
C, op, ob, mouse, mode);
317 if (!pop->stroke_handle) {
421 if (pop->s.warnmultifile) {
424 "Image requires 4 color channels to paint: %s",
425 pop->s.warnmultifile);
427 if (pop->s.warnpackedfile) {
430 "Packed MultiLayer files cannot be painted: %s",
431 pop->s.warnpackedfile);
438 std::unique_ptr<PaintOperation> pop;
511 float dummy_location[3];
514 paint_brush_update(
C, brush, mode, stroke, mouse, mouse_out, pressure, dummy_location, &dummy);
536 ot->name =
"Image Paint";
537 ot->idname =
"PAINT_OT_image_paint";
538 ot->description =
"Paint a stroke into the image";
bool BKE_brush_use_alpha_pressure(const Brush *brush)
float BKE_brush_alpha_get(const Paint *paint, const Brush *brush)
const float * BKE_brush_color_get(const Paint *paint, const Brush *brush)
const float * BKE_brush_secondary_color_get(const Paint *paint, const Brush *brush)
float BKE_brush_radius_get(const Paint *paint, const Brush *brush)
void BKE_brush_alpha_set(Paint *paint, Brush *brush, float alpha)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Scene * CTX_data_scene(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)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
@ 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_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_blend(GPUBlend blend)
Read Guarded memory(de)allocation.
BPy_StructRNA * depsgraph
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_bucket_fill(const bContext *C, 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 void paint_gradient_fill(const bContext *C, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2])=0
virtual ~AbstractPaintMode()=default
void paint_gradient_fill(const bContext *C, const Paint *, Brush *brush, PaintStroke *, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
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_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_bucket_fill(const bContext *C, const Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2]) 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 Paint *paint, Brush *brush, PaintStroke *stroke, void *stroke_handle, float mouse_start[2], float mouse_end[2]) override
void paint_bucket_fill(const bContext *C, 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_stroke(bContext *C, void *stroke_handle, float prev_mouse[2], float mouse[2], int eraser, float pressure, float distance, float size) override
float distance(VecOp< float, D >, VecOp< float, D >) RET
static wmOperatorStatus paint_exec(bContext *C, wmOperator *op)
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 gradient_draw_line(bContext *, const blender::int2 &xy, const blender::float2 &, void *customdata)
static wmOperatorStatus paint_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void paint_stroke_update_step(bContext *C, wmOperator *op, PaintStroke *stroke, PointerRNA *itemptr)
static void paint_stroke_done(const bContext *C, PaintStroke *stroke)
static wmOperatorStatus 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)
void paint_stroke_jitter_pos(const PaintStroke &stroke, PaintMode mode, const Brush &brush, float pressure, const float mval[2], float r_mouse_out[2])
wmOperatorStatus paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke)
void paint_stroke_cancel(bContext *C, wmOperator *op, PaintStroke *stroke)
bool paint_stroke_flipped(PaintStroke *stroke)
wmOperatorStatus 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)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
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)
struct CurveMapping * curve_strength
struct ToolSettings * toolsettings
~PaintOperation() override
wmOperatorStatus(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
WindowManagerRuntimeHandle * runtime
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)