|
Blender V4.3
|
#include <cstddef>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_listbase.h"#include "BLI_math_vector.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "IMB_interp.hh"#include "DNA_brush_types.h"#include "DNA_customdata_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_brush.hh"#include "BKE_context.hh"#include "BKE_image.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_paint.hh"#include "BKE_report.hh"#include "ED_image.hh"#include "ED_paint.hh"#include "ED_screen.hh"#include "WM_api.hh"#include "WM_toolsystem.hh"#include "WM_types.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "curves_sculpt_intern.hh"#include "paint_hide.hh"#include "paint_intern.hh"#include "paint_mask.hh"#include "sculpt_intern.hh"Go to the source code of this file.
Classes | |
| struct | StencilControlData |
Macros | |
| #define | PIXEL_MARGIN 5 |
Enumerations | |
| enum | StencilControlMode { STENCIL_TRANSLATE , STENCIL_SCALE , STENCIL_ROTATE } |
| enum | StencilTextureMode { STENCIL_PRIMARY = 0 , STENCIL_SECONDARY = 1 } |
| enum | StencilConstraint { STENCIL_CONSTRAINT_X = 1 , STENCIL_CONSTRAINT_Y = 2 } |
| #define PIXEL_MARGIN 5 |
Referenced by stencil_control_calculate().
| enum StencilConstraint |
| Enumerator | |
|---|---|
| STENCIL_CONSTRAINT_X | |
| STENCIL_CONSTRAINT_Y | |
Definition at line 548 of file paint_ops.cc.
| enum StencilControlMode |
| Enumerator | |
|---|---|
| STENCIL_TRANSLATE | |
| STENCIL_SCALE | |
| STENCIL_ROTATE | |
Definition at line 537 of file paint_ops.cc.
| enum StencilTextureMode |
| Enumerator | |
|---|---|
| STENCIL_PRIMARY | |
| STENCIL_SECONDARY | |
Definition at line 543 of file paint_ops.cc.
|
static |
Definition at line 112 of file paint_ops.cc.
References brush_scale_size_exec(), wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, ot, RNA_def_float(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 785 of file paint_ops.cc.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, ot, wmOperatorType::poll, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_enum(), RNA_def_property_flag(), wmOperatorType::srna, stencil_control_cancel(), stencil_control_invoke(), stencil_control_modal(), stencil_control_poll(), STENCIL_PRIMARY, STENCIL_ROTATE, STENCIL_SCALE, STENCIL_SECONDARY, and STENCIL_TRANSLATE.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 877 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, stencil_control_poll(), and stencil_fit_image_aspect_exec().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 933 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, stencil_control_poll(), and stencil_reset_transform_exec().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 52 of file paint_ops.cc.
References abs(), BKE_brush_size_get(), BKE_brush_size_set(), BKE_brush_tag_unsaved_changes(), BKE_brush_unprojected_radius_get(), BKE_brush_unprojected_radius_set(), BKE_paint_brush(), BKE_paint_get_active_from_context(), CTX_data_scene(), Brush::gpencil_settings, int, max_ii(), NA_EDITED, NC_BRUSH, Brush::ob_mode, OB_MODE_PAINT_GREASE_PENCIL, OPERATOR_FINISHED, wmOperator::ptr, RNA_float_get(), Brush::size, Brush::unprojected_radius, and WM_main_add_notifier().
Referenced by BRUSH_OT_scale_size().
| void ED_keymap_paint | ( | wmKeyConfig * | keyconf | ) |
Definition at line 1081 of file paint_ops.cc.
References facemask_paint_poll(), image_texture_paint_poll(), paint_curve_poll(), wmKeyMap::poll, RGN_TYPE_WINDOW, SCULPT_mode_poll(), SPACE_EMPTY, vert_paint_poll(), vertex_paint_mode_poll(), weight_paint_mode_poll(), WM_keymap_ensure(), and WM_modalkeymap_assign().
Referenced by ED_spacetypes_keymap().
| void ED_operatormacros_paint | ( | ) |
Definition at line 953 of file paint_ops.cc.
References wmOperatorType::description, OPTYPE_UNDO, ot, wmOperatorTypeMacro::ptr, RNA_boolean_set(), WM_operatortype_append_macro(), and WM_operatortype_macro_define().
Referenced by ED_spacemacros_init().
| void ED_operatortypes_paint | ( | ) |
Definition at line 969 of file paint_ops.cc.
References BRUSH_OT_curve_preset(), BRUSH_OT_scale_size(), BRUSH_OT_sculpt_curves_falloff_preset(), BRUSH_OT_stencil_control(), BRUSH_OT_stencil_fit_image_aspect(), BRUSH_OT_stencil_reset_transform(), PAINT_OT_add_simple_uvs(), PAINT_OT_add_texture_paint_slot(), PAINT_OT_brush_colors_flip(), PAINT_OT_face_select_all(), PAINT_OT_face_select_hide(), PAINT_OT_face_select_less(), PAINT_OT_face_select_linked(), PAINT_OT_face_select_linked_pick(), PAINT_OT_face_select_loop(), PAINT_OT_face_select_more(), PAINT_OT_face_vert_reveal(), PAINT_OT_grab_clone(), PAINT_OT_image_from_view(), PAINT_OT_image_paint(), PAINT_OT_project_image(), PAINT_OT_sample_color(), PAINT_OT_texture_paint_toggle(), PAINT_OT_vert_select_all(), PAINT_OT_vert_select_hide(), PAINT_OT_vert_select_less(), PAINT_OT_vert_select_linked(), PAINT_OT_vert_select_linked_pick(), PAINT_OT_vert_select_more(), PAINT_OT_vert_select_ungrouped(), PAINT_OT_vertex_color_brightness_contrast(), PAINT_OT_vertex_color_from_weight(), PAINT_OT_vertex_color_hsv(), PAINT_OT_vertex_color_invert(), PAINT_OT_vertex_color_levels(), PAINT_OT_vertex_color_set(), PAINT_OT_vertex_color_smooth(), PAINT_OT_vertex_paint(), PAINT_OT_vertex_paint_toggle(), PAINT_OT_weight_from_bones(), PAINT_OT_weight_gradient(), PAINT_OT_weight_paint(), PAINT_OT_weight_paint_toggle(), PAINT_OT_weight_sample(), PAINT_OT_weight_sample_group(), PAINT_OT_weight_set(), PAINTCURVE_OT_add_point(), PAINTCURVE_OT_cursor(), PAINTCURVE_OT_delete_point(), PAINTCURVE_OT_draw(), PAINTCURVE_OT_new(), PAINTCURVE_OT_select(), PAINTCURVE_OT_slide(), PALETTE_OT_color_add(), PALETTE_OT_color_delete(), PALETTE_OT_color_move(), PALETTE_OT_extract_from_image(), PALETTE_OT_join(), PALETTE_OT_new(), PALETTE_OT_sort(), SCULPT_OT_uv_sculpt_grab(), SCULPT_OT_uv_sculpt_pinch(), SCULPT_OT_uv_sculpt_relax(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
|
static |
Definition at line 170 of file paint_ops.cc.
References Palette::active_color, BKE_brush_color_get(), BKE_paint_brush_for_read(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), BKE_palette_color_add(), BLI_listbase_count(), color, Palette::colors, copy_v3_v3(), CTX_data_scene(), ELEM, GPencil, OPERATOR_FINISHED, Paint::palette, Sculpt, Texture2D, Texture3D, Vertex, VertexGPencil, Weight, Brush::weight, and zero_v3().
Referenced by PALETTE_OT_color_add().
|
static |
Definition at line 217 of file paint_ops.cc.
References Palette::active_color, BKE_paint_get_active_from_context(), BKE_palette_color_remove(), BLI_findlink(), Palette::colors, OPERATOR_FINISHED, and Paint::palette.
Referenced by PALETTE_OT_color_delete().
|
static |
Definition at line 425 of file paint_ops.cc.
References Palette::active_color, BKE_paint_get_active_from_context(), BLI_assert, BLI_findlink(), BLI_listbase_link_move(), Palette::colors, ELEM, NA_EDITED, NC_BRUSH, OPERATOR_CANCELLED, OPERATOR_FINISHED, Paint::palette, wmOperator::ptr, RNA_enum_get(), and WM_event_add_notifier().
Referenced by PALETTE_OT_color_move().
|
static |
Definition at line 259 of file paint_ops.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_palette_from_hash(), BKE_reportf(), BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_int_new(), ImBuf::byte_buffer, col, CTX_data_main(), CTX_wm_space_image(), ImBufByteBuffer::data, SpaceImage::image, IMB_sampleImageAtLocation(), int, SpaceImage::iuser, lock, OPERATOR_FINISHED, POINTER_FROM_INT, pow(), wmOperator::ptr, range, wmOperator::reports, rgb_to_cpack(), RNA_int_get(), RPT_INFO, ImBuf::x, and ImBuf::y.
Referenced by PALETTE_OT_extract_from_image().
|
static |
Definition at line 246 of file paint_ops.cc.
References BKE_image_has_ibuf(), CTX_wm_space_data(), CTX_wm_space_image(), SpaceImage::image, SpaceImage::iuser, SPACE_IMAGE, and SpaceLink::spacetype.
Referenced by PALETTE_OT_extract_from_image().
|
static |
Definition at line 471 of file paint_ops.cc.
References BKE_libblock_find_name(), BKE_paint_get_active_from_context(), BKE_palette_color_add(), BKE_palette_color_remove(), BLI_listbase_count(), Palette::colors, copy_v3_v3(), CTX_data_main(), ID_PAL, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MAX_ID_NAME, NA_EDITED, NC_BRUSH, OPERATOR_CANCELLED, OPERATOR_FINISHED, Paint::palette, wmOperator::ptr, PaletteColor::rgb, RNA_string_get(), PaletteColor::value, and WM_event_add_notifier().
Referenced by PALETTE_OT_join().
|
static |
Definition at line 130 of file paint_ops.cc.
References BKE_paint_get_active_from_context(), BKE_paint_palette_set(), BKE_palette_add(), CTX_data_main(), and OPERATOR_FINISHED.
Referenced by PALETTE_OT_new().
|
static |
Definition at line 203 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_color_add_exec(), palette_poll(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 231 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_color_delete_exec(), palette_poll(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 447 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_color_move_exec(), palette_poll(), wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 307 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_extract_img_exec(), palette_extract_img_poll(), wmOperatorType::poll, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_int(), RNA_def_property_flag(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 517 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MAX_ID_NAME, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_join_exec(), palette_poll(), wmOperatorType::poll, RNA_def_string(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 143 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, and palette_new_exec().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 399 of file paint_ops.cc.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, palette_poll(), palette_sort_exec(), wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 157 of file paint_ops.cc.
References BKE_paint_get_active_from_context(), ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, and Paint::palette.
Referenced by PALETTE_OT_color_add(), PALETTE_OT_color_delete(), PALETTE_OT_color_move(), PALETTE_OT_join(), and PALETTE_OT_sort().
|
static |
Definition at line 329 of file paint_ops.cc.
References BKE_paint_get_active_from_context(), BKE_palette_color_add(), BKE_palette_color_remove(), BKE_palette_sort_hsv(), BKE_palette_sort_luminance(), BKE_palette_sort_svh(), BKE_palette_sort_vhs(), BLI_listbase_count(), Palette::colors, copy_v3_v3(), tPaletteColorHSV::h, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MEM_SAFE_FREE, NA_EDITED, NC_BRUSH, OPERATOR_CANCELLED, OPERATOR_FINISHED, Paint::palette, wmOperator::ptr, PaletteColor::rgb, tPaletteColorHSV::rgb, rgb_to_hsv(), RNA_enum_get(), tPaletteColorHSV::s, tPaletteColorHSV::v, v, tPaletteColorHSV::value, and WM_event_add_notifier().
Referenced by PALETTE_OT_sort().
|
static |
Definition at line 657 of file paint_ops.cc.
References add_v2_v2v2(), angle(), StencilControlData::area_size, atan2f, BKE_brush_tag_unsaved_changes(), StencilControlData::br, CLAMP, clamp_v2(), StencilControlData::constrain_mode, copy_v2_v2(), StencilControlData::dim_target, float, StencilControlData::init_angle, StencilControlData::init_mouse, StencilControlData::init_rot, StencilControlData::init_sdim, StencilControlData::init_spos, len, len_v2(), StencilControlData::lenorig, M_PI, StencilControlData::mode, PIXEL_MARGIN, StencilControlData::pos_target, StencilControlData::rot_target, STENCIL_CONSTRAINT_X, STENCIL_CONSTRAINT_Y, STENCIL_ROTATE, STENCIL_SCALE, STENCIL_TRANSLATE, and sub_v2_v2v2().
Referenced by stencil_control_modal().
|
static |
Definition at line 650 of file paint_ops.cc.
References wmOperator::customdata, MEM_freeN(), and stencil_restore().
Referenced by BRUSH_OT_stencil_control(), and stencil_control_modal().
|
static |
Definition at line 604 of file paint_ops.cc.
References StencilControlData::area_size, BKE_paint_brush(), BKE_paint_get_active_from_context(), StencilControlData::br, MTex::brush_map_mode, copy_v2_v2(), CTX_wm_region(), wmOperator::customdata, float, StencilControlData::init_mouse, StencilControlData::launch_event, mask(), StencilControlData::mask, Brush::mask_mtex, MEM_mallocN, StencilControlData::mode, Brush::mtex, MTEX_MAP_MODE_STENCIL, wmEvent::mval, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, wmOperator::ptr, RNA_enum_get(), stencil_set_target(), wmEvent::type, WM_event_add_modal_handler(), and WM_userdef_event_type_from_keymap_type().
Referenced by BRUSH_OT_stencil_control().
|
static |
Definition at line 713 of file paint_ops.cc.
References StencilControlData::constrain_mode, CTX_wm_region(), wmOperator::customdata, ED_region_tag_redraw(), EVT_ESCKEY, EVT_XKEY, EVT_YKEY, KM_PRESS, KM_RELEASE, StencilControlData::launch_event, MEM_freeN(), MOUSEMOVE, wmEvent::mval, NC_WINDOW, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, STENCIL_CONSTRAINT_X, STENCIL_CONSTRAINT_Y, stencil_control_calculate(), stencil_control_cancel(), wmEvent::type, wmEvent::val, and WM_event_add_notifier().
Referenced by BRUSH_OT_stencil_control().
|
static |
Definition at line 768 of file paint_ops.cc.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), MTex::brush_map_mode, Brush::mask_mtex, Brush::mtex, MTEX_MAP_MODE_STENCIL, and blender::ed::sculpt_paint::paint_supports_texture().
Referenced by BRUSH_OT_stencil_control(), BRUSH_OT_stencil_fit_image_aspect(), and BRUSH_OT_stencil_reset_transform().
|
static |
Definition at line 820 of file paint_ops.cc.
References BKE_brush_tag_unsaved_changes(), BKE_paint_brush(), BKE_paint_get_active_from_context(), ED_image_get_uv_aspect(), Tex::extend, fabsf, Tex::ima, Brush::mask_mtex, Brush::mask_stencil_dimension, Brush::mtex, NC_WINDOW, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), MTex::size, sqrtf, Brush::stencil_dimension, MTex::tex, tex, TEX_IMAGE, TEX_REPEAT, Tex::type, WM_event_add_notifier(), Tex::xrepeat, and Tex::yrepeat.
Referenced by BRUSH_OT_stencil_fit_image_aspect().
|
static |
Definition at line 898 of file paint_ops.cc.
References BKE_brush_tag_unsaved_changes(), BKE_paint_brush(), BKE_paint_get_active_from_context(), Brush::mask_mtex, Brush::mask_stencil_dimension, Brush::mask_stencil_pos, Brush::mtex, NC_WINDOW, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), MTex::rot, Brush::stencil_dimension, Brush::stencil_pos, and WM_event_add_notifier().
Referenced by BRUSH_OT_stencil_reset_transform().
|
static |
Definition at line 643 of file paint_ops.cc.
References copy_v2_v2(), StencilControlData::dim_target, StencilControlData::init_rot, StencilControlData::init_sdim, StencilControlData::init_spos, StencilControlData::pos_target, and StencilControlData::rot_target.
Referenced by stencil_control_cancel().
|
static |
Definition at line 572 of file paint_ops.cc.
References atan2f, StencilControlData::br, copy_v2_v2(), StencilControlData::dim_target, StencilControlData::init_angle, StencilControlData::init_mouse, StencilControlData::init_rot, StencilControlData::init_sdim, StencilControlData::init_spos, len_v2(), StencilControlData::lenorig, StencilControlData::mask, Brush::mask_mtex, Brush::mask_stencil_dimension, Brush::mask_stencil_pos, Brush::mtex, StencilControlData::pos_target, MTex::rot, StencilControlData::rot_target, Brush::stencil_dimension, Brush::stencil_pos, and sub_v2_v2v2().
Referenced by stencil_control_invoke().