|
Blender V5.0
|
#include <optional>#include "BLI_span.hh"#include "DNA_brush_enums.h"#include "DNA_color_types.h"#include "DNA_object_enums.h"#include "DNA_userdef_enums.h"Go to the source code of this file.
Classes | |
| struct | BrushColorJitterSettings |
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::brush |
General operations for brushes.
Definition in file BKE_brush.hh.
| Brush * BKE_brush_add | ( | Main * | bmain, |
| const char * | name, | ||
| eObjectMode | ob_mode ) |
Definition at line 627 of file brush.cc.
References BKE_brush_init_curves_sculpt_settings(), BKE_brush_init_gpencil_settings(), BKE_id_new(), ELEM, name, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_SCULPT_CURVES, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, and OB_MODE_WEIGHT_GREASE_PENCIL.
Definition at line 1357 of file brush.cc.
References UnifiedPaintSettings::alpha, UnifiedPaintSettings::flag, and UNIFIED_PAINT_ALPHA.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_fill_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), brush_strength(), blender::ed::sculpt_paint::brush_strength_get(), blender::ed::sculpt_paint::color::do_paint_brush_task(), do_projectpaint_thread(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::vwpaint::get_brush_alpha_data(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), paint_2d_bucket_fill(), paint_2d_gradient_fill(), paint_2d_lift_soften(), paint_2d_op(), blender::ed::sculpt_paint::paint_cursor_draw_main_inactive_cursor(), blender::ed::sculpt_paint::paint_draw_3D_view_inactive_brush_cursor(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), and wpaint_stroke_update_step().
Definition at line 1344 of file brush.cc.
References UnifiedPaintSettings::alpha, BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, and UNIFIED_PAINT_ALPHA.
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step().
| void BKE_brush_calc_curve_factors | ( | eBrushCurvePreset | preset, |
| const CurveMapping * | cumap, | ||
| blender::Span< float > | distances, | ||
| float | brush_radius, | ||
| blender::MutableSpan< float > | factors ) |
Combine the brush strength based on the distances and brush settings with the existing factors.
Definition at line 1448 of file brush.cc.
References BKE_curvemapping_evaluateF(), BLI_assert, BRUSH_CURVE_CONSTANT, BRUSH_CURVE_CUSTOM, BRUSH_CURVE_INVSQUARE, BRUSH_CURVE_LIN, BRUSH_CURVE_POW4, BRUSH_CURVE_ROOT, BRUSH_CURVE_SHARP, BRUSH_CURVE_SMOOTH, BRUSH_CURVE_SMOOTHER, BRUSH_CURVE_SPHERE, distance(), i, blender::Span< T >::index_range(), pow3f(), blender::math::rcp(), blender::MutableSpan< T >::size(), blender::Span< T >::size(), and sqrtf.
Referenced by blender::ed::sculpt_paint::calc_brush_strength_factors(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::brushes::sample_node_surface_bmesh(), blender::ed::sculpt_paint::brushes::sample_node_surface_grids(), and blender::ed::sculpt_paint::brushes::sample_node_surface_mesh().
Definition at line 1161 of file brush.cc.
References BKE_paint_use_unified_color().
Referenced by blender::ed::sculpt_paint::expand::cache_initial_config_set(), blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), blender::ed::sculpt_paint::grease_pencil_brush_cursor_draw(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), paint_brush_color_get(), blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_bucket_fill(), palette_color_add_exec(), sample_color_invoke(), and vpaint_get_current_col().
| std::optional< BrushColorJitterSettings > BKE_brush_color_jitter_get_settings | ( | const Paint * | paint, |
| const Brush * | brush ) |
Get color jitter settings if enabled.
Definition at line 1170 of file brush.cc.
References BKE_paint_use_unified_color(), BRUSH_JITTER_COLOR, UnifiedPaintSettings::color_jitter_flag, UnifiedPaintSettings::curve_rand_hue, UnifiedPaintSettings::curve_rand_saturation, UnifiedPaintSettings::curve_rand_value, UnifiedPaintSettings::hsv_jitter, and UNIFIED_PAINT_COLOR_JITTER.
Referenced by brush_painter_2d_new(), brush_painter_2d_refresh_cache(), blender::ed::sculpt_paint::color::do_paint_brush_task(), get_brush_color(), blender::ed::greasepencil::grease_pencil_primitive_update_curves(), paint_brush_color_get(), paint_proj_new_stroke(), paint_use_opacity_masking(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::PaintOperationExecutor(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), and blender::ed::sculpt_paint::vwpaint::update_cache_invariants().
Definition at line 1213 of file brush.cc.
References BKE_brush_color_sync_legacy(), BKE_brush_tag_unsaved_changes(), BKE_paint_use_unified_color(), UnifiedPaintSettings::color, and copy_v3_v3().
Referenced by paint_sample_color(), blender::ed::sculpt_paint::sample_color_invoke(), sample_color_modal(), and ui_do_but_COLOR().
| void BKE_brush_color_sync_legacy | ( | Brush * | brush | ) |
Definition at line 1227 of file brush.cc.
References linearrgb_to_srgb_v3_v3().
Referenced by BKE_brush_color_set(), brush_colors_flip_exec(), brush_foreach_working_space_color(), and blender::ui::greasepencil::eyedropper_set_brush_color().
| void BKE_brush_color_sync_legacy | ( | UnifiedPaintSettings * | ups | ) |
Definition at line 1234 of file brush.cc.
References UnifiedPaintSettings::color, linearrgb_to_srgb_v3_v3(), and UnifiedPaintSettings::secondary_color.
| const MTex * BKE_brush_color_texture_get | ( | const Brush * | brush, |
| eObjectMode | object_mode ) |
Get the color texture for this given object mode.
This is preferred above using mtex/mask_mtex attributes directly as due to legacy these attributes got switched in sculpt mode.
Definition at line 912 of file brush.cc.
References OB_MODE_SCULPT.
Referenced by do_projectpaint_thread().
| void BKE_brush_curve_preset | ( | Brush * | b, |
| eCurveMappingPreset | preset ) |
Library Operations
Definition at line 886 of file brush.cc.
References b, BKE_brush_tag_unsaved_changes(), BKE_curvemap_reset(), BKE_curvemapping_add(), BKE_curvemapping_changed(), CurveMapping::clipr, CUMA_EXTEND_EXTRAPOLATE, CurveMapping::flag, Negative, and CurveMapping::preset.
Referenced by brush_blend_read_data(), and brush_init_data().
Definition at line 1631 of file brush.cc.
References BKE_brush_curve_strength(), Brush::curve_distance_falloff, Brush::curve_distance_falloff_preset, and len.
| float BKE_brush_curve_strength | ( | eBrushCurvePreset | preset, |
| const CurveMapping * | cumap, | ||
| float | distance, | ||
| float | brush_radius ) |
Uses the brush curve control to find a strength value.
Definition at line 1577 of file brush.cc.
References BKE_curvemapping_evaluateF(), BLI_assert, BRUSH_CURVE_CONSTANT, BRUSH_CURVE_CUSTOM, BRUSH_CURVE_INVSQUARE, BRUSH_CURVE_LIN, BRUSH_CURVE_POW4, BRUSH_CURVE_ROOT, BRUSH_CURVE_SHARP, BRUSH_CURVE_SMOOTH, BRUSH_CURVE_SMOOTHER, BRUSH_CURVE_SPHERE, distance(), pow3f(), and sqrtf.
Referenced by blender::ed::sculpt_paint::cloth::add_constraints_for_verts(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::add_point_under_brush_to_brush_buffer(), BKE_brush_curve_strength(), BKE_brush_curve_strength_clamped(), blender::ed::sculpt_paint::greasepencil::brush_fill_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), calc_strength(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::compute_piecewise_linear_falloff(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::SlideOperationExecutor::find_curves_to_slide(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::sculpt_paint::expand::gradient_value_get(), blender::ed::sculpt_paint::boundary::init_falloff_bmesh(), blender::ed::sculpt_paint::boundary::init_falloff_grids(), blender::ed::sculpt_paint::boundary::init_falloff_mesh(), blender::ed::sculpt_paint::paint_stroke_overlapped_curve(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_spherical_with_symmetry(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::soft_eraser(), blender::ed::sculpt_paint::pose::solve_roll_chain(), and blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook().
Uses the brush curve control to find a strength value between 0 and 1.
Definition at line 1637 of file brush.cc.
References BKE_brush_curve_strength(), CLAMP, and len.
Referenced by BKE_brush_gen_radial_control_imbuf(), do_projectpaint_thread(), gradientVert_update(), blender::ed::sculpt_paint::load_tex_cursor_task_cb(), radial_control_paint_curve(), and blender::ed::sculpt_paint::update_sampled_curve().
| void BKE_brush_debug_print_state | ( | Brush * | br | ) |
Definition at line 781 of file brush.cc.
References blend(), BR_TEST, BR_TEST_FLAG, BR_TEST_FLAG_OVERLAY, BRUSH_ACCUMULATE, BRUSH_ADAPTIVE_SPACE, BRUSH_AIRBRUSH, BRUSH_ALPHA_PRESSURE, BRUSH_ANCHORED, brush_defaults(), BRUSH_DIR_IN, BRUSH_DRAG_DOT, BRUSH_EDGE_TO_EDGE, BRUSH_FRONTFACE, BRUSH_INVERSE_SMOOTH_PRESSURE, BRUSH_JITTER_PRESSURE, BRUSH_LOCK_ALPHA, BRUSH_LOCK_SIZE, BRUSH_OFFSET_PRESSURE, BRUSH_ORIGINAL_NORMAL, BRUSH_OVERLAY_CURSOR, BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_PRIMARY, BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_SECONDARY, BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE, BRUSH_PERSISTENT, BRUSH_PLANE_TRIM, BRUSH_SIZE_PRESSURE, BRUSH_SMOOTH_STROKE, BRUSH_SPACE, BRUSH_SPACE_ATTEN, BRUSH_SPACING_PRESSURE, printf, and size().
Delete a Brush.
Definition at line 674 of file brush.cc.
References BKE_id_delete(), BKE_library_ID_is_indirectly_used(), ID_EXTRA_USERS, ID_REAL_USERS, and ID_TAG_INDIRECT.
| Brush * BKE_brush_duplicate | ( | Main * | bmain, |
| Brush * | brush, | ||
| eDupli_ID_Flags | dupflag, | ||
| uint | duplicate_options ) |
Perform deep-copy of a Brush and its 'children' data-blocks.
| dupflag | Controls which sub-data are also duplicated (see eDupli_ID_Flags in DNA_userdef_types.h). |
| duplicate_options | Additional context information about current duplicate call (e.g. if it's part of a higher-level duplication or not, etc.). (see eLibIDDuplicateFlags in BKE_lib_id.hh). |
Definition at line 690 of file brush.cc.
References BKE_id_copy_for_duplicate(), BKE_libblock_relink_to_newid(), BKE_library_foreach_ID_link(), BKE_main_id_newptr_and_tag_clear(), BLI_assert, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, Brush::id, ID_REMAP_SKIP_USER_CLEAR, ID_TAG_NEW, IDWALK_CB_EMBEDDED, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_CB_LOOPBACK, IDWALK_NOP, IDWALK_RECURSE, LIB_ID_COPY_DEFAULT, LIB_ID_DUPLICATE_IS_ROOT_ID, LIB_ID_DUPLICATE_IS_SUBPROCESS, ID::tag, USER_DUP_LINKED_ID, and USER_DUP_OBDATA.
Referenced by blender::ed::sculpt_paint::brush_asset_save_as_exec(), TEST_F(), and TEST_F().
| Brush * BKE_brush_first_search | ( | Main * | bmain, |
| eObjectMode | ob_mode ) |
Definition at line 771 of file brush.cc.
References Main::brushes, and LISTBASE_FOREACH.
Radial control.
Definition at line 1677 of file brush.cc.
References BKE_brush_curve_strength_clamped(), BKE_curvemapping_init(), brush_gen_texture(), Brush::curve_distance_falloff, ImBufFloatBuffer::data, ImBuf::float_buffer, i, IB_DO_NOT_TAKE_OWNERSHIP, IMB_assign_float_buffer(), MEM_calloc_arrayN(), MEM_callocN(), pow2f(), sqrtf, ImBuf::x, and ImBuf::y.
Referenced by radial_control_set_tex().
Definition at line 1707 of file brush.cc.
References ELEM, Sculpt, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, and SCULPT_BRUSH_TYPE_PAINT.
Referenced by blender::ed::sculpt_paint::calc_brush_node_mask(), paint_rake_rotation_active(), and blender::ed::sculpt_paint::sculpt_brush_needs_normal().
| void BKE_brush_init_curves_sculpt_settings | ( | Brush * | brush | ) |
Definition at line 748 of file brush.cc.
References BrushCurvesSculptSettings::add_amount, BKE_curvemapping_add(), BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS, BrushCurvesSculptSettings::curve_length, BrushCurvesSculptSettings::curve_parameter_falloff, BrushCurvesSculptSettings::curve_radius, BrushCurvesSculptSettings::density_add_attempts, BrushCurvesSculptSettings::flag, MEM_callocN(), BrushCurvesSculptSettings::minimum_length, and BrushCurvesSculptSettings::points_per_curve.
Referenced by BKE_brush_add().
| void BKE_brush_init_gpencil_settings | ( | Brush * | brush | ) |
Add grease pencil settings.
Definition at line 648 of file brush.cc.
References BKE_curvemapping_add(), GP_BRUSH_USE_JITTER_PRESSURE, GP_BRUSH_USE_PRESSURE, and MEM_callocN().
Referenced by BKE_brush_add(), blender::ed::sculpt_paint::greasepencil::create_fill_guide_brush(), blender::ed::sculpt_paint::grease_pencil_fill_init(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), blender::ed::sculpt_paint::greasepencil::init_brush(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::greasepencil::paintmode_toggle_exec(), and blender::ed::greasepencil::stroke_trim_execute().
Definition at line 1384 of file brush.cc.
References UnifiedPaintSettings::flag, UnifiedPaintSettings::input_samples, and UNIFIED_PAINT_INPUT_SAMPLES.
Referenced by blender::ed::sculpt_paint::paint_stroke_modal().
Definition at line 1391 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UnifiedPaintSettings::input_samples, and UNIFIED_PAINT_INPUT_SAMPLES.
| void BKE_brush_jitter_pos | ( | const Paint & | paint, |
| const Brush & | brush, | ||
| const float | pos[2], | ||
| float | jitterpos[2] ) |
Definition at line 1406 of file brush.cc.
References BKE_brush_radius_get(), BLI_rng_get_float(), BRUSH_ABSOLUTE_JITTER, brush_rng, len_squared_v2(), pos, and square_f().
Referenced by blender::ed::sculpt_paint::paint_stroke_jitter_pos().
| const MTex * BKE_brush_mask_texture_get | ( | const Brush * | brush, |
| eObjectMode | object_mode ) |
Get the mask texture for this given object mode.
This is preferred above using mtex/mask_mtex attributes directly as due to legacy these attributes got switched in sculpt mode.
Definition at line 904 of file brush.cc.
References OB_MODE_SCULPT.
Referenced by blender::ed::sculpt_paint::brush_exit_tex(), brush_init_tex(), blender::ed::sculpt_paint::calc_brush_texture_factors(), blender::ed::sculpt_paint::calc_brush_texture_factors(), blender::ed::sculpt_paint::expand::falloff_value_vertex_get(), blender::ed::sculpt_paint::expand::max_vert_falloff_get(), paint_and_tex_color_alpha_intern(), sculpt_apply_texture(), blender::ed::sculpt_paint::sculpt_brush_needs_normal(), blender::ed::sculpt_paint::expand::sculpt_expand_modal(), blender::ed::sculpt_paint::expand::sculpt_expand_status(), blender::ed::sculpt_paint::sculpt_fix_noise_tear(), and update_brush_local_mat().
Definition at line 1272 of file brush.cc.
References BKE_brush_size_get().
Referenced by BKE_brush_jitter_pos(), blender::ed::sculpt_paint::greasepencil::brush_radius(), blender::ed::sculpt_paint::brush_radius_get(), blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::ed::sculpt_paint::vwpaint::get_brush_alpha_data(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), blender::ed::sculpt_paint::grease_pencil_brush_cursor_draw(), blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), blender::ed::sculpt_paint::object_space_radius_get(), blender::ed::sculpt_paint::paint_brush_update(), blender::ed::sculpt_paint::paint_cursor_context_init(), blender::ed::sculpt_paint::paint_cursor_update_pixel_radius(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_size(), blender::ed::sculpt_paint::paint_draw_cursor_overlay(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::paint_stroke_new(), blender::ed::sculpt_paint::vwpaint::update_cache_variants(), blender::ed::sculpt_paint::update_modal_transform(), and blender::ed::sculpt_paint::use_add_density_mode().
| void BKE_brush_randomize_texture_coords | ( | Paint * | paint, |
| bool | mask ) |
Definition at line 1433 of file brush.cc.
References BLI_rng_get_float(), brush_rng, mask(), blender::bke::PaintRuntime::mask_tex_mouse, blender::bke::PaintRuntime::pixel_radius, and blender::bke::PaintRuntime::tex_mouse.
Referenced by blender::ed::sculpt_paint::paint_brush_update().
| float BKE_brush_sample_masktex | ( | const Paint * | paint, |
| Brush * | br, | ||
| const float | point[2], | ||
| int | thread, | ||
| ImagePool * | pool ) |
Definition at line 1043 of file brush.cc.
References angle(), atan2f, MTex::brush_map_mode, BRUSH_MASK_PRESSURE_CUTOFF, BRUSH_MASK_PRESSURE_RAMP, blender::bke::PaintRuntime::brush_rotation_sec, CLAMP, cosf, fabsf, Brush::mask_mtex, Brush::mask_pressure, Brush::mask_stencil_dimension, Brush::mask_stencil_pos, blender::bke::PaintRuntime::mask_tex_mouse, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_VIEW, blender::bke::PaintRuntime::pixel_radius, RE_texture_evaluate(), MTex::rot, sinf, blender::bke::PaintRuntime::size_pressure_value, sqrtf, blender::bke::PaintRuntime::start_pixel_radius, MTex::tex, x, y, and zero_v4().
Referenced by brush_painter_mask_ibuf_new(), brush_painter_mask_imbuf_update(), and do_projectpaint_thread().
| float BKE_brush_sample_tex_3d | ( | const Paint * | paint, |
| const Brush * | br, | ||
| const MTex * | mtex, | ||
| const float | point[3], | ||
| float | rgba[4], | ||
| int | thread, | ||
| ImagePool * | pool ) |
Generic texture sampler for 3D painting systems. point has to be either in region space mouse coordinates, or 3d world coordinates for 3D mapping.
RGBA outputs straight alpha.
Definition at line 920 of file brush.cc.
References angle(), atan2f, MTex::brush_map_mode, blender::bke::PaintRuntime::brush_rotation, blender::bke::PaintRuntime::colorspace, cosf, blender::bke::PaintRuntime::do_linear_conversion, fabsf, IMB_colormanagement_colorspace_to_scene_linear_v3(), MTEX_MAP_MODE_3D, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_VIEW, blender::bke::PaintRuntime::pixel_radius, RE_texture_evaluate(), MTex::rot, sinf, sqrtf, blender::bke::PaintRuntime::start_pixel_radius, Brush::stencil_dimension, Brush::stencil_pos, MTex::tex, blender::bke::PaintRuntime::tex_mouse, Brush::texture_sample_bias, x, y, and zero_v4().
Referenced by brush_painter_imbuf_new(), brush_painter_imbuf_update(), do_projectpaint_thread(), blender::ed::sculpt_paint::expand::falloff_value_vertex_get(), paint_and_tex_color_alpha_intern(), and sculpt_apply_texture().
| void BKE_brush_scale_unprojected_size | ( | float * | unprojected_size, |
| int | new_brush_size, | ||
| int | old_brush_size ) |
Definition at line 1205 of file brush.cc.
References BKE_paint_use_unified_color().
Referenced by blender::ed::sculpt_paint::color::do_paint_brush_task(), blender::ed::sculpt_paint::paint::image::do_paint_pixels(), paint_brush_color_get(), blender::ed::sculpt_paint::image::ops::paint::ImagePaintMode::paint_bucket_fill(), and vpaint_get_current_col().
Definition at line 1264 of file brush.cc.
References UnifiedPaintSettings::flag, size(), UnifiedPaintSettings::size, and UNIFIED_PAINT_SIZE.
Referenced by BKE_brush_radius_get(), brush_scale_size_exec(), paint_proj_new_stroke(), project_paint_begin(), blender::ed::sculpt_paint::smooth_brush_toggle_on(), blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_on(), and texture_paint_camera_project_exec().
Definition at line 1248 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), CLAMP, UnifiedPaintSettings::flag, MAX_BRUSH_PIXEL_DIAMETER, size(), UnifiedPaintSettings::size, and UNIFIED_PAINT_SIZE.
Referenced by brush_scale_size_exec(), blender::ed::sculpt_paint::paint_cursor_sculpt_session_update_and_init(), paint_proj_new_stroke(), paint_proj_stroke_done(), blender::ed::sculpt_paint::smooth_brush_toggle_off(), blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_off(), blender::ed::sculpt_paint::smooth_brush_toggle_on(), blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_on(), and texture_paint_camera_project_exec().
| void BKE_brush_system_exit | ( | ) |
Definition at line 562 of file brush.cc.
References BLI_rng_free(), and brush_rng.
Referenced by BKE_blender_free().
| void BKE_brush_system_init | ( | ) |
Definition at line 556 of file brush.cc.
References BLI_rng_new(), BLI_rng_srandom(), and brush_rng.
Referenced by main().
| void BKE_brush_tag_unsaved_changes | ( | Brush * | brush | ) |
Tag a linked brush as having changed settings so an indicator can be displayed to the user, showing that the brush settings differ from the state of the imported brush asset. Call every time a user visible change to the brush is done.
Since this is meant to indicate brushes that are known to differ from the linked source file, tagging is only performed for linked brushes. File local brushes are normal data-blocks that get saved with the file, and don't need special attention by the user.
For convenience, null may be passed for brush.
Definition at line 764 of file brush.cc.
References ID_IS_LINKED.
Referenced by BKE_brush_alpha_set(), BKE_brush_color_set(), BKE_brush_curve_preset(), BKE_brush_input_samples_set(), BKE_brush_size_set(), BKE_brush_unprojected_size_set(), BKE_brush_weight_set(), BKE_gpencil_brush_material_set(), brush_colors_flip_exec(), brush_scale_size_exec(), blender::ed::transform::calculateCenterActive(), ED_render_id_flush_update(), blender::ui::greasepencil::eyedropper_set_brush_color(), blender::ed::transform::flushTransPaintCurve(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_modal(), paintcurve_delete_point_exec(), paintcurve_new_exec(), paintcurve_point_add(), paintcurve_slide_invoke(), set_current_brush_texture(), stencil_control_calculate(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), texture_changed(), blender::ed::greasepencil::toggle_weight_tool_direction_exec(), and ui_do_but_COLOR().
Definition at line 1315 of file brush.cc.
References BKE_brush_unprojected_size_get().
Referenced by blender::ed::sculpt_paint::object_space_radius_get(), blender::ed::sculpt_paint::paint_cursor_update_pixel_radius(), and blender::ed::sculpt_paint::update_modal_transform().
Definition at line 1308 of file brush.cc.
References UnifiedPaintSettings::flag, UNIFIED_PAINT_SIZE, and UnifiedPaintSettings::unprojected_size.
Referenced by BKE_brush_unprojected_radius_get(), and brush_scale_size_exec().
Definition at line 1295 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UNIFIED_PAINT_SIZE, and UnifiedPaintSettings::unprojected_size.
Referenced by brush_scale_size_exec(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_size(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and blender::ed::sculpt_paint::vwpaint::update_cache_variants().
| bool BKE_brush_use_alpha_pressure | ( | const Brush * | brush | ) |
Definition at line 1290 of file brush.cc.
References BRUSH_ALPHA_PRESSURE.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_fill_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), brush_strength(), blender::ed::sculpt_paint::brush_strength_factor(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), blender::ed::sculpt_paint::vwpaint::get_brush_alpha_data(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_mouse_input_sample(), blender::ed::greasepencil::opacity_from_input_sample(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), and blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step().
Definition at line 1277 of file brush.cc.
References BRUSH_LOCK_SIZE, UNIFIED_PAINT_BRUSH_LOCK_SIZE, and UNIFIED_PAINT_SIZE.
Referenced by blender::ed::sculpt_paint::object_space_radius_get(), blender::ed::sculpt_paint::paint_cursor_sculpt_session_update_and_init(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_size(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and blender::ed::sculpt_paint::update_modal_transform().
| bool BKE_brush_use_size_pressure | ( | const Brush * | brush | ) |
Definition at line 1285 of file brush.cc.
References BRUSH_SIZE_PRESSURE.
Referenced by blender::ed::sculpt_paint::greasepencil::brush_radius(), blender::ed::sculpt_paint::brush_radius_factor(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), blender::ed::sculpt_paint::vwpaint::get_brush_alpha_data(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_mouse_input_sample(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::paint_brush_update(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_size(), blender::ed::sculpt_paint::paint_draw_2D_view_brush_cursor_default(), blender::ed::sculpt_paint::paint_draw_cursor_overlay(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), blender::ed::sculpt_paint::paint_space_stroke_spacing_variable(), blender::ed::greasepencil::radius_from_input_sample(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and blender::ed::sculpt_paint::vwpaint::update_cache_variants().
Definition at line 1364 of file brush.cc.
References UnifiedPaintSettings::flag, UNIFIED_PAINT_WEIGHT, and UnifiedPaintSettings::weight.
Referenced by brush_edit_apply(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), paint_weight_gradient_exec(), weight_paint_set_exec(), and wpaint_paint_leaves().
Definition at line 1371 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UNIFIED_PAINT_WEIGHT, and UnifiedPaintSettings::weight.
Referenced by blender::ed::greasepencil::weight_sample_invoke(), and weight_sample_invoke().