Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "DNA_brush_types.h"
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.h"
#include "BKE_brush.h"
#include "BKE_colortools.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_image.h"
#include "BKE_paint.h"
#include "WM_api.h"
#include "WM_types.h"
#include "GPU_immediate.h"
#include "GPU_state.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "IMB_imbuf_types.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include <float.h>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | PaintSample |
struct | PaintStroke |
Macros | |
#define | PAINT_STROKE_MODAL_CANCEL 1 |
Typedefs | |
typedef struct PaintSample | PaintSample |
typedef struct PaintStroke | PaintStroke |
#define PAINT_STROKE_MODAL_CANCEL 1 |
Definition at line 1129 of file paint_stroke.c.
typedef struct PaintSample PaintSample |
typedef struct PaintStroke PaintStroke |
|
static |
Definition at line 1016 of file paint_stroke.c.
References CURVES_SCULPT_TOOL_ADD, CURVES_SCULPT_TOOL_DENSITY, and ELEM.
Referenced by paint_space_stroke_enabled().
|
static |
Definition at line 502 of file paint_stroke.c.
References add_v2_v2v2(), add_v3_v3(), BKE_brush_jitter_pos(), BKE_brush_use_alpha_pressure(), BKE_brush_use_size_pressure(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), BRUSH_JITTER_PRESSURE, BRUSH_SPACING_PRESSURE, BRUSH_STROKE_INVERT, C, copy_v2_v2(), copy_v3_v3(), CTX_data_scene(), Brush::dash_ratio, Brush::dash_samples, Brush::flag, float(), UnifiedPaintSettings::last_hit, UnifiedPaintSettings::last_location, PaintStroke::last_mouse_position, PaintStroke::last_pressure, PaintStroke::last_scene_spacing_delta, PaintStroke::last_world_space_position, mul_m4_v3(), mul_v2_fl(), ViewContext::obact, Object::obmat, PaintStroke::original, paint_brush_update(), paint_stroke_use_dash(), paint_stroke_use_jitter(), paint_stroke_use_scene_spacing(), PaintStroke::pen_flip, UnifiedPaintSettings::pixel_radius, wmOperator::ptr, RNA_boolean_set(), RNA_collection_add(), RNA_collection_clear(), RNA_float_set(), RNA_float_set_array(), scene, SCULPT_stroke_get_location(), PaintStroke::stroke_mode, sub_v2_v2v2(), PaintStroke::tot_samples, PaintStroke::update_step, PaintStroke::ups, PaintStroke::vc, PaintStroke::x_tilt, PaintStroke::y_tilt, and PaintStroke::zoom_2d.
Referenced by paint_line_strokes_spacing(), paint_space_stroke(), paint_stroke_curve_end(), paint_stroke_line_end(), and paint_stroke_modal().
Definition at line 1676 of file paint_stroke.c.
References blender::compositor::area(), BKE_paint_brush(), BKE_paint_get_active_from_context(), C, CTX_data_active_object(), CTX_wm_area(), CTX_wm_region(), bToolRef_Runtime::data_block, ELEM, ARegion::regiontype, RGN_TYPE_WINDOW, bToolRef::runtime, SPACE_IMAGE, and SPACE_VIEW3D.
Referenced by paint_cursor_context_init(), paint_cursor_draw_3d_view_brush_cursor_inactive(), paint_stroke_modal(), and SCULPT_poll().
|
static |
Definition at line 285 of file paint_stroke.c.
References UnifiedPaintSettings::anchored_initial_mouse, UnifiedPaintSettings::anchored_size, atan2f, BKE_brush_randomize_texture_coords(), BKE_brush_size_get(), BKE_brush_use_size_pressure(), BLI_rng_get_float(), BLI_rng_new(), BRUSH_ANCHORED, MTex::brush_angle_mode, BRUSH_CURVE, BRUSH_EDGE_TO_EDGE, PaintStroke::brush_init, MTex::brush_map_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, C, PaintStroke::cached_size_pressure, copy_v2_v2(), CTX_data_scene(), UnifiedPaintSettings::draw_anchored, ELEM, Brush::flag, float(), PaintStroke::get_location, PaintStroke::initial_mouse, UnifiedPaintSettings::initial_pixel_radius, UnifiedPaintSettings::last_rake, M_PI, Brush::mask_mtex, UnifiedPaintSettings::mask_tex_mouse, Brush::mtex, MTEX_ANGLE_RANDOM, MTEX_MAP_MODE_AREA, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_VIEW, NULL, PaintStroke::original, paint_calculate_rake_rotation(), paint_supports_dynamic_size(), paint_supports_dynamic_tex_coords(), paint_tool_require_location(), PIL_check_seconds_timer_i(), UnifiedPaintSettings::pixel_radius, POINTER_AS_INT, PaintStroke::rake_started, MTex::random_angle, PaintStroke::rng, scene, UnifiedPaintSettings::size_pressure_value, sqrtf, UnifiedPaintSettings::stroke_active, PaintStroke::stroke_distance, MTex::tex, UnifiedPaintSettings::tex_mouse, UINT_MAX, PaintStroke::ups, zero_v3(), and PaintStroke::zoom_2d.
Referenced by paint_brush_stroke_add_step().
Definition at line 161 of file paint_stroke.c.
References BKE_paint_get_active_from_context(), C, PaintStroke::constrain_line, PaintStroke::constrained_pos, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_PRIM_LINES, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4f(), immVertex2f(), immVertexFormat(), PaintStroke::last_mouse_position, Paint::paint_cursor_col, ViewContext::region, PaintStroke::vc, ARegion::winrct, x, rcti::xmin, y, and rcti::ymin.
Referenced by paint_stroke_modal().
Definition at line 130 of file paint_stroke.c.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), C, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4ubv(), immVertex2f(), immVertexFormat(), PaintStroke::last_mouse_position, Paint::paint_cursor_col, pos, ViewContext::region, PaintStroke::vc, ARegion::winrct, x, rcti::xmin, y, and rcti::ymin.
Referenced by paint_stroke_modal().
|
static |
Slightly different version of spacing for line/curve strokes, makes sure the dabs stay on the line path.
Definition at line 1190 of file paint_stroke.c.
References add_v3_v3v3(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), BLI_assert, PaintStroke::brush, C, copy_v2_v2(), copy_v3_v3(), CTX_wm_region(), ED_view3d_project_v2(), PaintStroke::last_mouse_position, PaintStroke::last_world_space_position, len_v3(), blender::math::length(), mul_m4_v3(), mul_v3_v3fl(), normalize_v2(), normalize_v3(), ViewContext::obact, Object::obmat, PaintStroke::original, UnifiedPaintSettings::overlap_factor, paint_brush_stroke_add_step(), paint_stroke_integrate_overlap(), paint_stroke_use_scene_spacing(), SCULPT_stroke_get_location(), PaintStroke::stroke_distance, PaintStroke::stroke_over_mesh, sub_v2_v2v2(), sub_v3_v3v3(), PaintStroke::ups, PaintStroke::vc, zero_v3(), and PaintStroke::zoom_2d.
Referenced by paint_stroke_curve_end().
|
static |
Definition at line 627 of file paint_stroke.c.
References PaintStroke::brush, interp_v2_v2v2(), interpf(), PaintStroke::last_mouse_position, PaintStroke::last_pressure, len_squared_v2v2(), paint_supports_smooth_stroke(), sample, Brush::smooth_stroke_factor, Brush::smooth_stroke_radius, square_f(), and PaintStroke::zoom_2d.
Referenced by paint_stroke_modal().
|
static |
Definition at line 785 of file paint_stroke.c.
References add_v3_v3v3(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), PaintStroke::brush, C, copy_v3_v3(), count, CTX_data_scene(), CTX_wm_region(), ED_view3d_project_v2(), PaintStroke::last_mouse_position, PaintStroke::last_pressure, PaintStroke::last_scene_spacing_delta, PaintStroke::last_world_space_position, len_v3(), blender::math::length(), mul_m4_v3(), mul_v3_v3fl(), normalize_v2(), normalize_v3(), ViewContext::obact, Object::obmat, PaintStroke::original, UnifiedPaintSettings::overlap_factor, paint_brush_stroke_add_step(), paint_space_stroke_spacing(), paint_space_stroke_spacing_variable(), paint_stroke_integrate_overlap(), paint_stroke_use_scene_spacing(), scene, SCULPT_stroke_get_location(), PaintStroke::stroke_distance, PaintStroke::stroke_over_mesh, sub_v2_v2v2(), sub_v3_v3v3(), PaintStroke::ups, PaintStroke::vc, zero_v3(), and PaintStroke::zoom_2d.
Referenced by paint_stroke_line_end(), and paint_stroke_modal().
bool paint_space_stroke_enabled | ( | struct Brush * | br, |
enum ePaintMode | mode | ||
) |
Returns zero if the stroke dots should not be spaced, non-zero otherwise.
Definition at line 1021 of file paint_stroke.c.
References BRUSH_SPACE, curves_sculpt_brush_uses_spacing(), Brush::curves_sculpt_tool, Brush::flag, PAINT_MODE_SCULPT_CURVES, paint_supports_dynamic_size(), SCULPT_is_cloth_deform_brush(), Brush::sculpt_tool, and SCULPT_TOOL_CLOTH.
Referenced by paint_stroke_modal().
|
static |
Definition at line 655 of file paint_stroke.c.
References BKE_brush_size_get(), BKE_brush_unprojected_radius_get(), BKE_brush_use_locked_size(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), PaintStroke::brush, BRUSH_SPACING_PRESSURE, C, Brush::flag, Object::imat, PaintStroke::last_world_space_position, max_ff(), mul_v3_m4v3(), ViewContext::obact, paint_calc_object_space_radius(), paint_stroke_use_scene_spacing(), scene, SCULPT_is_cloth_deform_brush(), size(), Brush::spacing, PaintStroke::vc, and PaintStroke::zoom_2d.
Referenced by paint_space_stroke(), paint_space_stroke_spacing_variable(), and paint_stroke_curve_end().
|
static |
Definition at line 753 of file paint_stroke.c.
References BKE_brush_use_size_pressure(), PaintStroke::brush, C, PaintStroke::last_pressure, blender::math::length(), paint_space_stroke_spacing(), and scene.
Referenced by paint_space_stroke().
|
static |
Definition at line 1150 of file paint_stroke.c.
References CLAMPIS, PaintStroke::cur_sample, Paint::num_input_samples, PaintStroke::num_samples, PAINT_MAX_INPUT_SAMPLES, sample, PaintStroke::samples, x, and y.
Referenced by paint_stroke_modal().
void paint_stroke_cancel | ( | bContext * | C, |
wmOperator * | op, | ||
PaintStroke * | stroke | ||
) |
Definition at line 1641 of file paint_stroke.c.
References C, and stroke_done().
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_cancel(), paint_stroke_modal(), sculpt_brush_stroke_cancel(), blender::ed::sculpt_paint::sculpt_curves_stroke_cancel(), vpaint_cancel(), and wpaint_cancel().
|
static |
Definition at line 1294 of file paint_stroke.c.
References atan2f, PaintCurvePoint::bez, BKE_curve_forward_diff_bezier(), BKE_curve_forward_diff_tangent_bezier(), BKE_paintmode_get_active_from_context(), PaintStroke::brush, MTex::brush_angle_mode, BRUSH_CURVE, C, copy_v2_v2(), CTX_data_scene(), CTX_data_tool_settings(), data, Brush::flag, PaintStroke::last_mouse_position, PaintStroke::last_pressure, PaintStroke::last_world_space_position, Brush::mask_mtex, Brush::mtex, MTEX_ANGLE_RAKE, mul_m4_v3(), ViewContext::obact, Object::obmat, PaintStroke::original, UnifiedPaintSettings::overlap_factor, paint_brush_stroke_add_step(), Brush::paint_curve, PAINT_CURVE_NUM_SEGMENTS, paint_line_strokes_spacing(), paint_space_stroke_spacing(), paint_stroke_integrate_overlap(), paint_stroke_use_scene_spacing(), paint_update_brush_rake_rotation(), PaintCurve::points, scene, SCULPT_stroke_get_location(), stroke_done(), PaintStroke::stroke_over_mesh, PaintStroke::stroke_started, tangents, PaintStroke::test_start, TIMEIT_END_AVERAGED, TIMEIT_START_AVERAGED, PaintCurve::tot_points, ToolSettings::unified_paint_settings, PaintStroke::ups, PaintStroke::vc, and BezTriple::vec.
Referenced by paint_stroke_modal().
float paint_stroke_distance_get | ( | struct PaintStroke * | stroke | ) |
Definition at line 1666 of file paint_stroke.c.
References PaintStroke::stroke_distance.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), and sculpt_stroke_update_step().
int paint_stroke_exec | ( | bContext * | C, |
wmOperator * | op, | ||
PaintStroke * | stroke | ||
) |
Definition at line 1611 of file paint_stroke.c.
References C, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_BEGIN, RNA_END, RNA_float_get_array(), RNA_property_collection_lookup_int(), RNA_struct_find_property(), stroke_done(), PaintStroke::stroke_started, PaintStroke::test_start, and PaintStroke::update_step.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_exec(), sculpt_brush_stroke_exec(), vpaint_exec(), and wpaint_exec().
bool paint_stroke_flipped | ( | struct PaintStroke * | stroke | ) |
Definition at line 1656 of file paint_stroke.c.
References PaintStroke::pen_flip.
void paint_stroke_free | ( | bContext * | C, |
wmOperator * | UNUSEDop, | ||
PaintStroke * | stroke | ||
) |
Definition at line 956 of file paint_stroke.c.
References BKE_paint_set_overlay_override(), BLI_freelistN(), BLI_rng_free(), C, CTX_wm_manager(), CTX_wm_region_view3d(), CTX_wm_window(), UnifiedPaintSettings::draw_anchored, PaintStroke::line, MEM_SAFE_FREE, NULL, RegionView3D::rflag, PaintStroke::rng, RV3D_PAINTING, UnifiedPaintSettings::stroke_active, PaintStroke::stroke_cursor, PaintStroke::timer, PaintStroke::ups, WM_event_remove_timer(), and WM_paint_cursor_end().
Referenced by stroke_done().
Definition at line 728 of file paint_stroke.c.
References BRUSH_SPACE_ATTEN, fabs(), Brush::flag, usdtokens::g(), max, paint_stroke_overlapped_curve(), and Brush::spacing.
Referenced by paint_line_strokes_spacing(), paint_space_stroke(), paint_stroke_curve_end(), paint_stroke_line_end(), and paint_stroke_modal().
bool paint_stroke_inverted | ( | struct PaintStroke * | stroke | ) |
Definition at line 1661 of file paint_stroke.c.
References BRUSH_STROKE_INVERT, and PaintStroke::stroke_mode.
Referenced by blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_bucket_fill().
|
static |
Definition at line 1392 of file paint_stroke.c.
References angle(), atan2f, PaintStroke::constrain_line, PaintStroke::constrained_pos, cosf, float(), floorf, PaintStroke::last_mouse_position, len, len_v2(), M_PI, M_PI_4, sinf, and sub_v2_v2v2().
Referenced by paint_stroke_modal().
|
static |
Definition at line 1280 of file paint_stroke.c.
References PaintStroke::brush, BRUSH_LINE, C, Brush::flag, PaintStroke::last_mouse_position, UnifiedPaintSettings::overlap_factor, paint_brush_stroke_add_step(), paint_space_stroke(), paint_stroke_integrate_overlap(), PaintStroke::stroke_started, and PaintStroke::ups.
Referenced by paint_stroke_modal().
int paint_stroke_modal | ( | bContext * | C, |
wmOperator * | op, | ||
const wmEvent * | event, | ||
PaintStroke ** | stroke_p | ||
) |
Definition at line 1421 of file paint_stroke.c.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), BLI_assert, PaintStroke::brush, BRUSH_AIRBRUSH, BRUSH_ANCHORED, MTex::brush_angle_mode, BRUSH_DRAG_DOT, BRUSH_LINE, BRUSH_SMOOTH_STROKE, C, wmOperatorType::cancel, PaintStroke::constrain_line, copy_v2_fl2(), copy_v2_v2(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_window(), wmEvent::customdata, ELEM, PaintStroke::event_type, EVT_MODAL_MAP, EVT_RETKEY, EVT_SPACEKEY, Brush::flag, Paint::flags, INBETWEEN_MOUSEMOVE, ISMOUSE_MOTION, KM_ALT, KM_RELEASE, PaintStroke::last_mouse_position, PaintStroke::last_pressure, UnifiedPaintSettings::last_rake, PaintStroke::last_tablet_event_pressure, PaintStroke::last_world_space_position, len_v2(), Brush::mask_mtex, wmEvent::modifier, PaintSample::mouse, Brush::mtex, MTEX_ANGLE_RAKE, mul_m4_v3(), wmEvent::mval, NDOF_MOTION, NULL, ViewContext::obact, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, OPERATOR_RUNNING_MODAL, PaintStroke::original, UnifiedPaintSettings::overlap_factor, paint_brush_stroke_add_step(), PAINT_brush_tool_poll(), paint_calculate_rake_rotation(), paint_draw_line_cursor(), paint_draw_smooth_cursor(), PAINT_SHOW_BRUSH, paint_smooth_stroke(), paint_space_stroke(), paint_space_stroke_enabled(), paint_stroke_add_sample(), paint_stroke_cancel(), paint_stroke_curve_end(), paint_stroke_integrate_overlap(), paint_stroke_line_constrain(), paint_stroke_line_end(), PAINT_STROKE_MODAL_CANCEL, paint_stroke_sample_average(), paint_stroke_use_scene_spacing(), paint_supports_smooth_stroke(), paint_tool_require_inbetween_mouse_events(), PaintStroke::pen_flip, PaintSample::pressure, Brush::rate, PaintStroke::redraw, RGN_TYPE_ANY, SCULPT_stroke_get_location(), SPACE_TYPE_ANY, PaintStroke::stroke_cursor, PaintStroke::stroke_distance, stroke_done(), PaintStroke::stroke_init, PaintStroke::stroke_over_mesh, PaintStroke::stroke_started, sub_v2_v2v2(), PaintStroke::test_start, PaintStroke::timer, TIMER, wmOperator::type, wmEvent::type, PaintStroke::ups, wmEvent::val, PaintStroke::vc, WM_event_add_timer(), WM_event_is_tablet(), WM_event_tablet_data(), WM_paint_cursor_activate(), WM_paint_cursor_tag_redraw(), PaintStroke::x_tilt, and PaintStroke::y_tilt.
struct wmKeyMap* paint_stroke_modal_keymap | ( | struct wmKeyConfig * | keyconf | ) |
Called in paint_ops.c, on each regeneration of key-maps.
Definition at line 1131 of file paint_stroke.c.
References wmKeyMap::modal_items, EnumPropertyItem::name, PAINT_STROKE_MODAL_CANCEL, WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by ED_keymap_paint().
void* paint_stroke_mode_data | ( | struct PaintStroke * | stroke | ) |
Definition at line 1651 of file paint_stroke.c.
References PaintStroke::mode_data.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_redraw(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), vpaint_stroke_done(), vpaint_stroke_update_step(), vpaint_stroke_update_step_intern(), wpaint_stroke_done(), and wpaint_stroke_update_step().
PaintStroke* paint_stroke_new | ( | bContext * | C, |
wmOperator * | op, | ||
StrokeGetLocation | get_location, | ||
StrokeTestStart | test_start, | ||
StrokeUpdateStep | update_step, | ||
StrokeRedraw | redraw, | ||
StrokeDone | done, | ||
int | event_type | ||
) |
Definition at line 874 of file paint_stroke.c.
References UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_brush_size_get(), BKE_curvemapping_init(), BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paint_set_overlay_override(), BKE_paintmode_get_active_from_context(), PaintStroke::brush, BRUSH_CURVE, BRUSH_STROKE_INVERT, BRUSH_STROKE_NORMAL, C, Paint::cavity_curve, UnifiedPaintSettings::colorspace, CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region_view3d(), Brush::curve, depsgraph, UnifiedPaintSettings::do_linear_conversion, PaintStroke::done, ED_view3d_viewcontext_init(), PaintStroke::event_type, Brush::flag, Paint::flags, get_imapaint_zoom(), PaintStroke::get_location, Tex::ima, Tex::iuser, max_ff(), MEM_callocN, Brush::mtex, mul_v3_fl(), NULL, PaintStroke::original, UnifiedPaintSettings::overlap_factor, Brush::overlay_flags, paint_tool_raycast_original(), PAINT_USE_CAVITY_MASK, wmOperator::ptr, ImBuf::rect_colorspace, ImBuf::rect_float, PaintStroke::redraw, RegionView3D::rflag, RNA_enum_get(), RNA_enum_set(), RV3D_PAINTING, UnifiedPaintSettings::start_pixel_radius, UnifiedPaintSettings::stroke_active, PaintStroke::stroke_mode, PaintStroke::test_start, MTex::tex, TEX_IMAGE, Tex::type, ToolSettings::unified_paint_settings, PaintStroke::update_step, PaintStroke::ups, PaintStroke::vc, and PaintStroke::zoom_2d.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_exec(), blender::ed::sculpt_paint::image::ops::paint::paint_invoke(), sculpt_brush_stroke_exec(), sculpt_brush_stroke_invoke(), blender::ed::sculpt_paint::sculpt_curves_stroke_invoke(), vpaint_exec(), vpaint_invoke(), wpaint_exec(), and wpaint_invoke().
Definition at line 708 of file paint_stroke.c.
References BKE_brush_curve_strength(), fabsf, sum(), and x.
Referenced by paint_stroke_integrate_overlap().
|
static |
Definition at line 1169 of file paint_stroke.c.
References add_v2_v2(), average(), BLI_assert, PaintSample::mouse, mul_v2_fl(), PaintStroke::num_samples, PaintSample::pressure, and PaintStroke::samples.
Referenced by paint_stroke_modal().
void paint_stroke_set_mode_data | ( | PaintStroke * | stroke, |
void * | mode_data | ||
) |
Definition at line 1671 of file paint_stroke.c.
References PaintStroke::mode_data.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_stroke_test_start(), vpaint_stroke_test_start(), and wpaint_stroke_test_start().
Definition at line 481 of file paint_stroke.c.
References BRUSH_CURVE, BRUSH_LINE, BRUSH_SPACE, and Brush::flag.
Referenced by paint_brush_stroke_add_step().
|
static |
Definition at line 487 of file paint_stroke.c.
References BRUSH_ABSOLUTE_JITTER, BRUSH_ANCHORED, BRUSH_DRAG_DOT, ELEM, Brush::flag, Brush::imagepaint_tool, invert(), Brush::jitter, Brush::jitter_absolute, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, and PAINT_TOOL_CLONE.
Referenced by paint_brush_stroke_add_step().
|
static |
Definition at line 239 of file paint_stroke.c.
References BRUSH_SCENE_SPACING, Brush::flag, and PAINT_MODE_SCULPT.
Referenced by paint_brush_stroke_add_step(), paint_line_strokes_spacing(), paint_space_stroke(), paint_space_stroke_spacing(), paint_stroke_curve_end(), and paint_stroke_modal().
ViewContext* paint_stroke_view_context | ( | PaintStroke * | stroke | ) |
Definition at line 1646 of file paint_stroke.c.
References PaintStroke::vc.
Referenced by sculpt_update_cache_invariants(), and vwpaint_update_cache_invariants().
bool paint_supports_dynamic_size | ( | struct Brush * | br, |
enum ePaintMode | mode | ||
) |
Return true if the brush size can change during paint (normally used for pressure).
Definition at line 1059 of file paint_stroke.c.
References BRUSH_ANCHORED, BRUSH_USE_GRADIENT, Brush::flag, Brush::imagepaint_tool, PAINT_MODE_SCULPT, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_TOOL_FILL, and sculpt_is_grab_tool().
Referenced by paint_brush_update(), paint_space_stroke_enabled(), sculpt_update_cache_variants(), and vwpaint_update_cache_variants().
bool paint_supports_dynamic_tex_coords | ( | struct Brush * | br, |
enum ePaintMode | mode | ||
) |
Return true if the brush size can change during paint (normally used for pressure).
Definition at line 1111 of file paint_stroke.c.
References BRUSH_ANCHORED, Brush::flag, PAINT_MODE_SCULPT, and sculpt_is_grab_tool().
Referenced by paint_brush_update().
bool paint_supports_smooth_stroke | ( | Brush * | br, |
ePaintMode | mode | ||
) |
Definition at line 1085 of file paint_stroke.c.
References BRUSH_ANCHORED, BRUSH_DRAG_DOT, BRUSH_LINE, BRUSH_SMOOTH_STROKE, Brush::flag, PAINT_MODE_SCULPT, and sculpt_is_grab_tool().
Referenced by paint_smooth_stroke(), and paint_stroke_modal().
bool paint_supports_texture | ( | ePaintMode | mode | ) |
Definition at line 1104 of file paint_stroke.c.
References ELEM, PAINT_MODE_SCULPT, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, and PAINT_MODE_VERTEX.
Referenced by stencil_control_poll().
|
static |
Definition at line 250 of file paint_stroke.c.
References BRUSH_ANCHORED, and Brush::flag.
Referenced by paint_stroke_new().
|
static |
Definition at line 255 of file paint_stroke.c.
References BRUSH_ANCHORED, ELEM, Brush::flag, PAINT_MODE_SCULPT, Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLOTH, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK, and SCULPT_TOOL_THUMB.
Referenced by paint_stroke_modal().
|
static |
Definition at line 212 of file paint_stroke.c.
References ELEM, PAINT_MODE_SCULPT, SCULPT_is_cloth_deform_brush(), Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK, and SCULPT_TOOL_THUMB.
Referenced by paint_brush_update().
Definition at line 1043 of file paint_stroke.c.
References BRUSH_CLOTH_DEFORM_GRAB, Brush::cloth_deform_type, ELEM, Brush::sculpt_tool, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_CLOTH, SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_GRAB, SCULPT_TOOL_POSE, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK, and SCULPT_TOOL_THUMB.
Referenced by paint_supports_dynamic_size(), paint_supports_dynamic_tex_coords(), and paint_supports_smooth_stroke().
|
static |
Definition at line 990 of file paint_stroke.c.
References PaintStroke::brush, MTex::brush_angle_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, C, PaintStroke::done, Brush::mask_mtex, Brush::mtex, MTEX_ANGLE_RAKE, paint_stroke_free(), PaintStroke::redraw, PaintStroke::stroke_started, and PaintStroke::ups.
Referenced by paint_stroke_cancel(), paint_stroke_curve_end(), paint_stroke_exec(), and paint_stroke_modal().