|
Blender
V2.93
|
Functions to paint images in 2D and 3D. More...
#include <float.h>#include <math.h>#include <stdio.h>#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "DNA_brush_types.h"#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_node_types.h"#include "DNA_object_types.h"#include "BKE_brush.h"#include "BKE_colorband.h"#include "BKE_context.h"#include "BKE_image.h"#include "BKE_main.h"#include "BKE_material.h"#include "BKE_mesh.h"#include "BKE_node.h"#include "BKE_paint.h"#include "BKE_undo_system.h"#include "DEG_depsgraph.h"#include "UI_interface.h"#include "UI_view2d.h"#include "ED_image.h"#include "ED_object.h"#include "ED_paint.h"#include "ED_screen.h"#include "ED_view3d.h"#include "WM_api.h"#include "WM_message.h"#include "WM_toolsystem.h"#include "WM_types.h"#include "RNA_access.h"#include "RNA_define.h"#include "GPU_immediate.h"#include "GPU_state.h"#include "IMB_colormanagement.h"#include "paint_intern.h"Go to the source code of this file.
Classes | |
| struct | PaintOperation |
| struct | GrabClone |
| struct | SampleColorData |
Typedefs | |
| typedef enum eTexPaintMode | eTexPaintMode |
| typedef struct PaintOperation | PaintOperation |
| typedef struct GrabClone | GrabClone |
Enumerations | |
| enum | eTexPaintMode { PAINT_MODE_2D , PAINT_MODE_3D_PROJECT } |
Variables | |
| static ImagePaintPartialRedraw | imapaintpartial = {0, 0, 0, 0, 0} |
Functions to paint images in 2D and 3D.
Definition in file paint_image.c.
| typedef enum eTexPaintMode eTexPaintMode |
| typedef struct PaintOperation PaintOperation |
| enum eTexPaintMode |
| Enumerator | |
|---|---|
| PAINT_MODE_2D | |
| PAINT_MODE_3D_PROJECT | |
Definition at line 332 of file paint_image.c.
|
static |
Definition at line 1271 of file paint_image.c.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), C, CTX_data_scene(), UnifiedPaintSettings::flag, NA_EDITED, NC_BRUSH, OPERATOR_CANCELLED, OPERATOR_FINISHED, Brush::rgb, UnifiedPaintSettings::rgb, scene, Brush::secondary_rgb, UnifiedPaintSettings::secondary_rgb, swap_v3_v3(), Scene::toolsettings, UNIFIED_PAINT_COLOR, ToolSettings::unified_paint_settings, and WM_event_add_notifier().
Referenced by PAINT_OT_brush_colors_flip().
|
static |
Definition at line 1294 of file paint_image.c.
References C, CTX_data_active_object(), ELEM, image_paint_brush(), image_paint_poll(), Brush::imagepaint_tool, Object::mode, NULL, OB_MODE_SCULPT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, PAINT_TOOL_DRAW, and PAINT_TOOL_FILL.
Referenced by PAINT_OT_brush_colors_flip().
| void ED_imapaint_bucket_fill | ( | struct bContext * | C, |
| float | color[3], | ||
| wmOperator * | op, | ||
| const int | mouse[2] | ||
| ) |
Definition at line 1328 of file paint_image.c.
References C, CTX_wm_space_image(), DEG_id_tag_update(), ED_image_undo_push_begin(), ED_image_undo_push_end(), Image::id, SpaceImage::image, wmOperatorType::name, NULL, paint_2d_bucket_fill(), PAINT_MODE_TEXTURE_2D, and wmOperator::type.
Referenced by drop_color_invoke().
| void ED_imapaint_clear_partial_redraw | ( | void | ) |
Definition at line 104 of file paint_image.c.
References imapaintpartial.
Referenced by image_flip_exec(), image_invert_exec(), image_scale_exec(), paint_2d_bucket_fill(), paint_2d_gradient_fill(), and paint_2d_redraw().
| void ED_imapaint_dirty_region | ( | Image * | ima, |
| ImBuf * | ibuf, | ||
| ImageUser * | iuser, | ||
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| bool | find_old | ||
| ) |
Definition at line 122 of file paint_image.c.
References BKE_image_mark_dirty(), ED_image_paint_tile_list_get(), ED_image_paint_tile_push(), ImagePaintPartialRedraw::enabled, imapaint_region_tiles(), imapaintpartial, IMB_freeImBuf(), IMB_rectclip(), max_ii(), min_ii(), NULL, w(), x, ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, y, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by paint_2d_bucket_fill(), paint_2d_gradient_fill(), and paint_2d_op().
| void ED_object_texture_paint_mode_enter | ( | bContext * | C | ) |
Definition at line 1182 of file paint_image.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), ED_object_texture_paint_mode_enter_ex(), and scene.
Definition at line 1122 of file paint_image.c.
References Object::actcol, blender::compositor::area(), bScreen::areabase, BKE_image_free_all_gputextures(), BKE_image_paint_set_mipmap(), BKE_mesh_from_object(), BKE_object_material_get(), BKE_paint_init(), BKE_paint_toolslots_brush_validate(), BKE_texpaint_slots_refresh_object(), BLI_assert, ImagePaintSettings::canvas, DEG_id_tag_update(), ED_paint_proj_mesh_data_check(), ED_space_image_set(), ListBase::first, Mesh::id, ID_RECALC_COPY_ON_WRITE, TexPaintSlot::ima, IMAGEPAINT_MODE_IMAGE, IMAGEPAINT_MODE_MATERIAL, ToolSettings::imapaint, Object::mode, ImagePaintSettings::mode, NC_SCENE, ND_MODE, NULL, OB_MODE_TEXTURE_PAINT, ImagePaintSettings::paint, Material::paint_active_slot, PAINT_CURSOR_TEXTURE_PAINT, PAINT_MODE_TEXTURE_3D, SpaceImage::pin, scene, SPACE_IMAGE, SpaceLink::spacetype, Material::texpaintslot, toggle_paint_cursor(), Scene::toolsettings, wmWindowManager::windows, Main::wm, WM_main_add_notifier(), and WM_window_get_active_screen().
Referenced by ED_object_texture_paint_mode_enter(), and texture_paint_toggle_exec().
| void ED_object_texture_paint_mode_exit | ( | bContext * | C | ) |
Definition at line 1206 of file paint_image.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), ED_object_texture_paint_mode_exit_ex(), and scene.
Definition at line 1190 of file paint_image.c.
References BKE_image_free_all_gputextures(), BKE_image_paint_set_mipmap(), BKE_mesh_from_object(), BLI_assert, DEG_id_tag_update(), Mesh::id, ID_RECALC_COPY_ON_WRITE, Object::mode, NC_SCENE, ND_MODE, NULL, OB_MODE_TEXTURE_PAINT, scene, toggle_paint_cursor(), and WM_main_add_notifier().
Referenced by ed_object_mode_generic_exit_ex(), ED_object_texture_paint_mode_exit(), and texture_paint_toggle_exec().
| void ED_space_image_paint_update | ( | Main * | bmain, |
| wmWindowManager * | wm, | ||
| Scene * | scene | ||
| ) |
Definition at line 807 of file paint_image.c.
References blender::compositor::area(), bScreen::areabase, BKE_paint_init(), enabled, image_paint_poll(), ToolSettings::imapaint, LISTBASE_FOREACH, ImagePaintSettings::paint, paint_cursor_delete_textures(), paint_cursor_start(), PAINT_CURSOR_TEXTURE_PAINT, PAINT_MODE_TEXTURE_2D, scene, SI_MODE_PAINT, SPACE_IMAGE, Scene::toolsettings, wmWindowManager::windows, and WM_window_get_active_screen().
Referenced by ED_editors_init().
| bool facemask_paint_poll | ( | bContext * | C | ) |
Definition at line 1365 of file paint_image.c.
References BKE_paint_select_face_test(), C, and CTX_data_active_object().
Referenced by ED_keymap_paint(), PAINT_OT_face_select_all(), PAINT_OT_face_select_hide(), PAINT_OT_face_select_linked(), PAINT_OT_face_select_linked_pick(), and PAINT_OT_face_select_reveal().
Definition at line 768 of file paint_image.c.
References blender::compositor::area(), C, CTX_wm_area(), CTX_wm_region(), ED_space_image_get_zoom(), SpaceImage::mode, SI_MODE_PAINT, and SPACE_IMAGE.
Referenced by paint_cursor_context_init(), and paint_stroke_new().
| ImagePaintPartialRedraw* get_imapaintpartial | ( | void | ) |
Definition at line 92 of file paint_image.c.
References imapaintpartial.
|
static |
Definition at line 842 of file paint_image.c.
References add_v2_v2(), C, Brush::clone, CTX_wm_region(), ED_region_tag_redraw(), image_paint_brush(), BrushClone::offset, wmOperator::ptr, and RNA_float_get_array().
Referenced by grab_clone_exec(), and grab_clone_modal().
|
static |
Definition at line 908 of file paint_image.c.
References wmOperator::customdata, and MEM_freeN.
Referenced by PAINT_OT_grab_clone().
|
static |
Definition at line 852 of file paint_image.c.
References C, grab_clone_apply(), and OPERATOR_FINISHED.
Referenced by PAINT_OT_grab_clone().
|
static |
Definition at line 859 of file paint_image.c.
References C, Brush::clone, copy_v2_v2(), wmOperator::customdata, image_paint_brush(), MEM_callocN, BrushClone::offset, OPERATOR_RUNNING_MODAL, GrabClone::startoffset, GrabClone::startx, GrabClone::starty, and WM_event_add_modal_handler().
Referenced by PAINT_OT_grab_clone().
|
static |
Definition at line 875 of file paint_image.c.
References C, Brush::clone, copy_v2_v2(), CTX_wm_region(), wmOperator::customdata, grab_clone_apply(), image_paint_brush(), LEFTMOUSE, MEM_freeN, MIDDLEMOUSE, MOUSEMOVE, BrushClone::offset, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RIGHTMOUSE, RNA_float_set_array(), GrabClone::startoffset, GrabClone::startx, GrabClone::starty, wmEvent::type, UI_view2d_region_to_view(), ARegion::v2d, ARegion::winrct, wmEvent::x, rcti::xmin, wmEvent::y, and rcti::ymin.
Referenced by PAINT_OT_grab_clone().
|
static |
Definition at line 439 of file paint_image.c.
References GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4ub(), immVertex2i(), immVertexFormat(), pos, ViewContext::region, PaintOperation::startmouse, PaintOperation::vc, ARegion::winrct, x, rcti::xmin, y, and rcti::ymin.
Referenced by texture_paint_init().
|
static |
Definition at line 316 of file paint_image.c.
References C, Brush::clone, CTX_wm_region_view3d(), BrushClone::image, image_paint_brush(), image_paint_poll(), Brush::imagepaint_tool, and PAINT_TOOL_CLONE.
Referenced by PAINT_OT_grab_clone().
Definition at line 266 of file paint_image.c.
References BKE_paint_brush(), C, CTX_data_scene(), ToolSettings::imapaint, ImagePaintSettings::paint, scene, and Scene::toolsettings.
Referenced by brush_colors_flip_poll(), grab_clone_apply(), grab_clone_invoke(), grab_clone_modal(), image_paint_2d_clone_poll(), and image_paint_poll_ex().
|
static |
Definition at line 306 of file paint_image.c.
References C, and image_paint_poll_ex().
Referenced by brush_colors_flip_poll(), ED_space_image_paint_update(), image_paint_2d_clone_poll(), image_texture_paint_poll(), PAINT_OT_image_paint(), texture_paint_init(), and toggle_paint_cursor().
|
static |
Definition at line 274 of file paint_image.c.
References C, CTX_data_active_object(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_space_image(), ID_IS_LINKED, SpaceImage::image, image_paint_brush(), Object::mode, SpaceImage::mode, NULL, OB_MODE_TEXTURE_PAINT, ARegion::regiontype, RGN_TYPE_WINDOW, SI_MODE_PAINT, and WM_toolsystem_active_tool_is_brush().
Referenced by image_paint_poll(), and image_paint_poll_ignore_tool().
|
static |
Definition at line 311 of file paint_image.c.
References C, and image_paint_poll_ex().
Referenced by sample_color_poll().
| bool image_texture_paint_poll | ( | bContext * | C | ) |
Definition at line 1360 of file paint_image.c.
References C, image_paint_poll(), and texture_paint_poll().
Referenced by ED_keymap_paint().
| void imapaint_image_update | ( | SpaceImage * | sima, |
| Image * | image, | ||
| ImBuf * | ibuf, | ||
| ImageUser * | iuser, | ||
| short | texpaint | ||
| ) |
Definition at line 167 of file paint_image.c.
References BKE_image_update_gputexture(), IB_MIPMAP_INVALID, imapaintpartial, IMB_partial_display_buffer_update_delayed(), SpaceImage::lock, ImBuf::mipmap, ImBuf::userflags, w(), ImagePaintPartialRedraw::x1, ImagePaintPartialRedraw::x2, ImagePaintPartialRedraw::y1, and ImagePaintPartialRedraw::y2.
Referenced by paint_2d_bucket_fill(), paint_2d_gradient_fill(), paint_2d_redraw(), and project_image_refresh_tagged().
| void imapaint_region_tiles | ( | ImBuf * | ibuf, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| int * | tx, | ||
| int * | ty, | ||
| int * | tw, | ||
| int * | th | ||
| ) |
Definition at line 109 of file paint_image.c.
References ED_IMAGE_UNDO_TILE_BITS, IMB_rectclip(), NULL, w(), x, and y.
Referenced by ED_imapaint_dirty_region(), and paint_2d_op().
| bool mask_paint_poll | ( | bContext * | C | ) |
Definition at line 1375 of file paint_image.c.
References BKE_paint_select_elem_test(), C, and CTX_data_active_object().
Referenced by PAINT_OT_weight_set().
| void paint_brush_color_get | ( | struct Scene * | scene, |
| struct Brush * | br, | ||
| bool | color_correction, | ||
| bool | invert, | ||
| float | distance, | ||
| float | pressure, | ||
| float | color[3], | ||
| struct ColorManagedDisplay * | display | ||
| ) |
Definition at line 365 of file paint_image.c.
References BKE_brush_color_get(), BKE_brush_secondary_color_get(), BKE_colorband_evaluate(), BRUSH_GRADIENT_PRESSURE, BRUSH_GRADIENT_SPACING_CLAMP, BRUSH_GRADIENT_SPACING_REPEAT, BRUSH_USE_GRADIENT, copy_v3_v3(), distance(), Brush::flag, Brush::gradient, Brush::gradient_spacing, Brush::gradient_stroke_mode, IMB_colormanagement_display_to_scene_linear_v3(), IMB_colormanagement_scene_linear_to_srgb_v3(), invert(), and scene.
Referenced by brush_painter_imbuf_new(), brush_painter_imbuf_update(), and paint_proj_stroke_ps().
| void paint_brush_exit_tex | ( | Brush * | brush | ) |
Definition at line 425 of file paint_image.c.
References bNodeTree::execdata, Brush::mask_mtex, Brush::mtex, Tex::nodetree, ntreeTexEndExecTree(), and MTex::tex.
Referenced by paint_2d_stroke_done(), and paint_proj_stroke_done().
| void paint_brush_init_tex | ( | Brush * | brush | ) |
Definition at line 409 of file paint_image.c.
References Brush::mask_mtex, Brush::mtex, Tex::nodetree, ntreeTexBeginExecTree(), and MTex::tex.
Referenced by paint_2d_new_stroke(), and paint_proj_new_stroke().
| void paint_delete_blur_kernel | ( | BlurKernel * | kernel | ) |
Definition at line 257 of file paint_image.c.
References MEM_freeN, and BlurKernel::wdata.
Referenced by paint_2d_canvas_free(), and project_paint_end().
|
static |
Definition at line 722 of file paint_image.c.
References C, wmOperator::customdata, NULL, OPERATOR_CANCELLED, paint_stroke_done(), paint_stroke_exec(), paint_stroke_new(), paint_stroke_redraw(), paint_stroke_test_start(), paint_stroke_update_step(), wmOperator::ptr, RNA_float_get_array(), RNA_property_collection_lookup_int(), and RNA_struct_find_property().
Referenced by PAINT_OT_image_paint().
|
static |
Definition at line 696 of file paint_image.c.
References BLI_assert, C, wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, paint_stroke_done(), paint_stroke_free(), paint_stroke_new(), paint_stroke_redraw(), paint_stroke_test_start(), paint_stroke_update_step(), wmOperator::type, wmEvent::type, and WM_event_add_modal_handler().
Referenced by PAINT_OT_image_paint().
| BlurKernel* paint_new_blur_kernel | ( | Brush * | br, |
| bool | proj | ||
| ) |
Definition at line 191 of file paint_image.c.
References Brush::blur_kernel_radius, Brush::blur_mode, KDL::exp(), KERNEL_BOX, KERNEL_GAUSSIAN, MEM_freeN, MEM_mallocN, NULL, BlurKernel::pixel_len, BlurKernel::side, BlurKernel::side_squared, type, and BlurKernel::wdata.
Referenced by paint_2d_new_stroke(), and project_state_init().
| void PAINT_OT_brush_colors_flip | ( | wmOperatorType * | ot | ) |
Definition at line 1313 of file paint_image.c.
References brush_colors_flip_exec(), brush_colors_flip_poll(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_grab_clone | ( | wmOperatorType * | ot | ) |
Definition at line 913 of file paint_image.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, grab_clone_cancel(), grab_clone_exec(), grab_clone_invoke(), grab_clone_modal(), wmOperatorType::idname, image_paint_2d_clone_poll(), wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_float_vector(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_image_paint | ( | wmOperatorType * | ot | ) |
Definition at line 748 of file paint_image.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, image_paint_poll(), wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, paint_exec(), paint_invoke(), paint_stroke_cancel(), paint_stroke_modal(), paint_stroke_operator_properties(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_sample_color | ( | wmOperatorType * | ot | ) |
Definition at line 1094 of file paint_image.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_int_vector(), RNA_def_property_flag(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), sample_color_poll(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_texture_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 1256 of file paint_image.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, texture_paint_toggle_exec(), and texture_paint_toggle_poll().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 595 of file paint_image.c.
References BKE_brush_color_get(), BKE_brush_secondary_color_get(), BKE_brush_size_get(), BKE_paint_brush(), BKE_reportf(), BRUSH_USE_GRADIENT, C, CTX_data_scene(), PaintOperation::cursor, PaintOperation::custom_paint, ED_image_undo_push_end(), Brush::flag, ImagePaintSettings::flag, IMAGEPAINT_DRAWING, Brush::imagepaint_tool, ToolSettings::imapaint, MEM_freeN, PaintOperation::mode, ImagePaintSettings::paint, paint_2d_bucket_fill(), paint_2d_gradient_fill(), paint_2d_stroke_done(), PAINT_MODE_2D, PAINT_MODE_3D_PROJECT, paint_proj_redraw(), paint_proj_stroke(), paint_proj_stroke_done(), paint_stroke_flipped(), paint_stroke_inverted(), paint_stroke_mode_data(), PAINT_TOOL_FILL, PaintOperation::prevmouse, RPT_WARNING, scene, srgb_to_linearrgb_v3_v3(), PaintOperation::startmouse, Scene::toolsettings, and WM_paint_cursor_end().
Referenced by paint_exec(), and paint_invoke().
|
static |
Definition at line 583 of file paint_image.c.
References C, PaintOperation::custom_paint, PaintOperation::mode, paint_2d_redraw(), PAINT_MODE_3D_PROJECT, paint_proj_redraw(), and paint_stroke_mode_data().
Referenced by paint_exec(), and paint_invoke().
|
static |
Definition at line 680 of file paint_image.c.
References C, wmOperator::customdata, paint_stroke_set_mode_data(), and texture_paint_init().
Referenced by paint_exec(), and paint_invoke().
|
static |
Definition at line 527 of file paint_image.c.
References BKE_brush_alpha_get(), BKE_brush_alpha_set(), BKE_brush_use_alpha_pressure(), BKE_paint_brush(), BRUSH_ACCUMULATE, BRUSH_ANCHORED, BRUSH_DRAG_DOT, C, copy_v2_v2(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_manager(), PaintOperation::custom_paint, distance(), ED_image_undo_restore(), Brush::flag, Brush::imagepaint_tool, ToolSettings::imapaint, max_ff(), PaintOperation::mode, UnifiedPaintSettings::overlap_factor, ImagePaintSettings::paint, paint_2d_stroke(), PAINT_MODE_3D_PROJECT, paint_proj_stroke(), paint_stroke_distance_get(), paint_stroke_mode_data(), PAINT_TOOL_FILL, PaintOperation::prevmouse, RNA_boolean_get(), RNA_float_get(), RNA_float_get_array(), scene, size(), UndoStack::step_init, wmWindowManager::undo_stack, and ToolSettings::unified_paint_settings.
Referenced by paint_exec(), and paint_invoke().
| bool paint_use_opacity_masking | ( | Brush * | brush | ) |
Definition at line 350 of file paint_image.c.
References BRUSH_AIRBRUSH, BRUSH_ANCHORED, BRUSH_DRAG_DOT, MTex::brush_map_mode, BRUSH_USE_GRADIENT, ELEM, Brush::flag, Brush::imagepaint_tool, Brush::mtex, MTEX_MAP_MODE_3D, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_TILED, PAINT_TOOL_FILL, PAINT_TOOL_SMEAR, PAINT_TOOL_SOFTEN, and MTex::tex.
Referenced by paint_2d_canvas_set(), and project_state_init().
|
static |
Definition at line 967 of file paint_image.c.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), C, CTX_wm_region(), CTX_wm_window(), Paint::flags, NA_EDITED, NC_BRUSH, OPERATOR_FINISHED, PAINT_MODE_TEXTURE_3D, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, RNA_boolean_get(), RNA_int_get_array(), WM_event_add_notifier(), WM_paint_cursor_tag_redraw(), and WM_redraw_windows().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 998 of file paint_image.c.
References BKE_brush_color_get(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), C, copy_v3_v3(), CTX_data_scene(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, data, Paint::flags, MEM_mallocN, wmEvent::mval, NA_EDITED, NC_BRUSH, OPERATOR_RUNNING_MODAL, PAINT_MODE_TEXTURE_3D, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, RNA_boolean_get(), RNA_int_set_array(), sample_color_update_header(), scene, wmEvent::type, WM_CURSOR_EYEDROPPER, WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_event_add_notifier(), WM_paint_cursor_tag_redraw(), WM_redraw_windows(), and WM_userdef_event_type_from_keymap_type().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 1036 of file paint_image.c.
References BKE_brush_color_set(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), C, CTX_data_scene(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, data, ED_workspace_status_text(), Paint::flags, KM_PRESS, KM_RELEASE, LEFTMOUSE, MEM_freeN, MOUSEMOVE, wmEvent::mval, NA_EDITED, NC_BRUSH, NULL, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, PAINT_MODE_TEXTURE_3D, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, RNA_boolean_get(), RNA_boolean_set(), RNA_int_set_array(), sample_color_update_header(), scene, wmEvent::type, wmEvent::val, WM_cursor_modal_restore(), and WM_event_add_notifier().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 1089 of file paint_image.c.
References C, image_paint_poll_ignore_tool(), and vertex_paint_poll_ignore_tool().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 951 of file paint_image.c.
References blender::compositor::area(), BLI_snprintf(), C, CTX_wm_area(), data, ED_workspace_status_text(), TIP_, and UI_MAX_DRAW_STR.
Referenced by sample_color_invoke(), and sample_color_modal().
| void set_imapaintpartial | ( | struct ImagePaintPartialRedraw * | ippr | ) |
Definition at line 97 of file paint_image.c.
References imapaintpartial.
Referenced by project_image_refresh_tagged().
|
static |
Definition at line 479 of file paint_image.c.
References BKE_paint_brush(), BRUSH_USE_GRADIENT, C, copy_v2_v2(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region_view3d(), PaintOperation::cursor, PaintOperation::custom_paint, depsgraph, ED_image_undo_push_begin(), ED_paint_data_warning(), ED_paint_proj_mesh_data_check(), ED_view3d_viewcontext_init(), Brush::flag, ImagePaintSettings::flag, gradient_draw_line(), image_paint_poll(), IMAGEPAINT_DRAWING, Brush::imagepaint_tool, ToolSettings::imapaint, MEM_callocN, MEM_freeN, PaintOperation::mode, wmOperatorType::name, NC_SCENE, ND_TOOLSETTINGS, NULL, OBACT, ImagePaintSettings::paint, paint_2d_new_stroke(), PAINT_MODE_2D, PAINT_MODE_3D_PROJECT, PAINT_MODE_TEXTURE_2D, paint_proj_new_stroke(), PAINT_TOOL_FILL, PaintOperation::prevmouse, wmOperator::ptr, wmOperator::reports, RGN_TYPE_ANY, RNA_enum_get(), scene, SPACE_TYPE_ANY, PaintOperation::startmouse, tex, Scene::toolsettings, wmOperator::type, PaintOperation::vc, WM_event_add_notifier(), and WM_paint_cursor_activate().
Referenced by paint_stroke_test_start().
|
static |
Definition at line 1349 of file paint_image.c.
References C, CTX_data_active_object(), OB_MODE_TEXTURE_PAINT, and texture_paint_toggle_poll().
Referenced by image_texture_paint_poll().
|
static |
Definition at line 1227 of file paint_image.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), CTX_wm_message_bus(), ED_object_mode_compat_set(), ED_object_texture_paint_mode_enter_ex(), ED_object_texture_paint_mode_exit_ex(), Object::id, Object::mode, OB_MODE_TEXTURE_PAINT, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, scene, WM_msg_publish_rna_prop, and WM_toolsystem_update_from_context_view3d().
Referenced by PAINT_OT_texture_paint_toggle().
|
static |
Definition at line 1214 of file paint_image.c.
References C, CTX_data_active_object(), Object::data, ID_IS_LINKED, NULL, OB_MESH, and Object::type.
Referenced by PAINT_OT_texture_paint_toggle(), and texture_paint_poll().
|
static |
Definition at line 787 of file paint_image.c.
References image_paint_poll(), ToolSettings::imapaint, NULL, ImagePaintSettings::paint, Paint::paint_cursor, paint_cursor_delete_textures(), paint_cursor_start(), scene, Scene::toolsettings, and WM_paint_cursor_end().
Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_object_texture_paint_mode_exit_ex().
| bool vert_paint_poll | ( | bContext * | C | ) |
Definition at line 1370 of file paint_image.c.
References BKE_paint_select_vert_test(), C, and CTX_data_active_object().
Referenced by ED_keymap_paint(), PAINT_OT_vert_select_all(), and PAINT_OT_vert_select_ungrouped().
|
static |
This is a static resource for non-global access. Maybe it should be exposed as part of the paint operation, but for now just give a public interface.
Definition at line 90 of file paint_image.c.
Referenced by ED_imapaint_clear_partial_redraw(), ED_imapaint_dirty_region(), get_imapaintpartial(), imapaint_image_update(), and set_imapaintpartial().