|
Blender V4.5
|
#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 583 of file brush.cc.
References BKE_brush_add(), BKE_brush_init_curves_sculpt_settings(), BKE_brush_init_gpencil_settings(), BKE_id_new(), ELEM, 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.
Referenced by BKE_brush_add(), TEST_F(), and TEST_F().
Definition at line 1269 of file brush.cc.
References UnifiedPaintSettings::alpha, BKE_brush_alpha_get(), UnifiedPaintSettings::flag, Scene::toolsettings, UNIFIED_PAINT_ALPHA, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_alpha_get(), 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 1256 of file brush.cc.
References UnifiedPaintSettings::alpha, BKE_brush_alpha_set(), BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, Scene::toolsettings, UNIFIED_PAINT_ALPHA, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_alpha_set(), and 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 1381 of file brush.cc.
References BKE_brush_calc_curve_factors(), 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 BKE_brush_calc_curve_factors(), 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 1128 of file brush.cc.
References BKE_brush_color_get(), BKE_paint_use_unified_color(), UnifiedPaintSettings::rgb, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_color_get(), 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().
| const std::optional< BrushColorJitterSettings > BKE_brush_color_jitter_get_settings | ( | const Scene * | scene, |
| const Paint * | paint, | ||
| const Brush * | brush ) |
Get color jitter settings if enabled.
Definition at line 1137 of file brush.cc.
References BKE_brush_color_jitter_get_settings(), 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::flag, UnifiedPaintSettings::hsv_jitter, Scene::toolsettings, UNIFIED_PAINT_COLOR_JITTER, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_color_jitter_get_settings(), 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().
| void BKE_brush_color_set | ( | Scene * | scene, |
| const Paint * | paint, | ||
| Brush * | brush, | ||
| const float | color[3] ) |
Definition at line 1182 of file brush.cc.
References BKE_brush_color_set(), BKE_brush_tag_unsaved_changes(), BKE_paint_use_unified_color(), copy_v3_v3(), UnifiedPaintSettings::rgb, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_color_set(), paint_sample_color(), blender::ed::sculpt_paint::sample_color_invoke(), sample_color_modal(), and ui_do_but_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 869 of file brush.cc.
References BKE_brush_color_texture_get(), and OB_MODE_SCULPT.
Referenced by BKE_brush_color_texture_get(), and do_projectpaint_thread().
| void BKE_brush_curve_preset | ( | Brush * | b, |
| eCurveMappingPreset | preset ) |
Library Operations
Definition at line 843 of file brush.cc.
References b, BKE_brush_curve_preset(), BKE_brush_tag_unsaved_changes(), BKE_curvemap_reset(), BKE_curvemapping_add(), BKE_curvemapping_changed(), CurveMapping::clipr, CUMA_EXTEND_EXTRAPOLATE, CURVEMAP_SLOPE_NEGATIVE, CurveMapping::flag, and CurveMapping::preset.
Referenced by BKE_brush_curve_preset(), brush_blend_read_data(), brush_curve_preset_exec(), and brush_init_data().
| float BKE_brush_curve_strength | ( | const Brush * | br, |
| float | p, | ||
| float | len ) |
Definition at line 1561 of file brush.cc.
References BKE_brush_curve_strength(), Brush::curve, Brush::curve_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 1510 of file brush.cc.
References BKE_brush_curve_strength(), BKE_curvemapping_evaluateF(), 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(), 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().
| float BKE_brush_curve_strength_clamped | ( | const Brush * | br, |
| float | p, | ||
| float | len ) |
Uses the brush curve control to find a strength value between 0 and 1.
Definition at line 1566 of file brush.cc.
References BKE_brush_curve_strength(), BKE_brush_curve_strength_clamped(), CLAMP, and len().
Referenced by BKE_brush_curve_strength_clamped(), 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 737 of file brush.cc.
References BKE_brush_debug_print_state(), BR_TEST, BR_TEST_FLAG, BR_TEST_FLAG_OVERLAY, BRUSH_ACCUMULATE, BRUSH_ADAPTIVE_SPACE, BRUSH_AIRBRUSH, BRUSH_ALPHA_PRESSURE, BRUSH_ANCHORED, BRUSH_CUSTOM_ICON, 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().
Referenced by BKE_brush_debug_print_state().
Delete a Brush.
Definition at line 630 of file brush.cc.
References BKE_brush_delete(), BKE_id_delete(), BKE_library_ID_is_indirectly_used(), ID_EXTRA_USERS, ID_REAL_USERS, and ID_TAG_INDIRECT.
Referenced by BKE_brush_delete().
| 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 646 of file brush.cc.
References BKE_brush_duplicate(), 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_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 BKE_brush_duplicate(), 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 727 of file brush.cc.
References BKE_brush_first_search(), Main::brushes, and LISTBASE_FOREACH.
Referenced by BKE_brush_first_search().
Radial control.
Definition at line 1606 of file brush.cc.
References BKE_brush_curve_strength_clamped(), BKE_brush_gen_radial_control_imbuf(), BKE_curvemapping_init(), brush_gen_texture(), Brush::curve, 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 BKE_brush_gen_radial_control_imbuf(), and radial_control_set_tex().
Definition at line 1636 of file brush.cc.
References BKE_brush_has_cube_tip(), ELEM, Sculpt, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, and SCULPT_BRUSH_TYPE_PAINT.
Referenced by BKE_brush_has_cube_tip(), 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 704 of file brush.cc.
References BrushCurvesSculptSettings::add_amount, BKE_brush_init_curves_sculpt_settings(), 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(), and BKE_brush_init_curves_sculpt_settings().
| void BKE_brush_init_gpencil_settings | ( | Brush * | brush | ) |
Add grease pencil settings.
Definition at line 604 of file brush.cc.
References BKE_brush_init_gpencil_settings(), BKE_curvemapping_add(), GP_BRUSH_USE_JITTER_PRESSURE, GP_BRUSH_USE_PRESSURE, and MEM_callocN().
Referenced by BKE_brush_add(), BKE_brush_init_gpencil_settings(), 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 1296 of file brush.cc.
References BKE_brush_input_samples_get(), UnifiedPaintSettings::flag, UnifiedPaintSettings::input_samples, Scene::toolsettings, UNIFIED_PAINT_INPUT_SAMPLES, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_input_samples_get(), and blender::ed::sculpt_paint::paint_stroke_modal().
Definition at line 1303 of file brush.cc.
References BKE_brush_input_samples_set(), BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UnifiedPaintSettings::input_samples, Scene::toolsettings, UNIFIED_PAINT_INPUT_SAMPLES, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_input_samples_set().
| void BKE_brush_jitter_pos | ( | const Scene & | scene, |
| const Brush & | brush, | ||
| const float | pos[2], | ||
| float | jitterpos[2] ) |
Definition at line 1340 of file brush.cc.
References BKE_brush_jitter_pos(), BKE_brush_size_get(), BLI_rng_get_float(), BRUSH_ABSOLUTE_JITTER, brush_rng, len_squared_v2(), and square_f().
Referenced by BKE_brush_jitter_pos(), and 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 861 of file brush.cc.
References BKE_brush_mask_texture_get(), and OB_MODE_SCULPT.
Referenced by BKE_brush_mask_texture_get(), 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::sculpt_fix_noise_tear(), and update_brush_local_mat().
| void BKE_brush_randomize_texture_coords | ( | UnifiedPaintSettings * | ups, |
| bool | mask ) |
Definition at line 1367 of file brush.cc.
References BKE_brush_randomize_texture_coords(), BLI_rng_get_float(), brush_rng, mask(), UnifiedPaintSettings::mask_tex_mouse, UnifiedPaintSettings::pixel_radius, and UnifiedPaintSettings::tex_mouse.
Referenced by BKE_brush_randomize_texture_coords(), and blender::ed::sculpt_paint::paint_brush_update().
| float BKE_brush_sample_masktex | ( | const Scene * | scene, |
| Brush * | br, | ||
| const float | point[2], | ||
| int | thread, | ||
| ImagePool * | pool ) |
Definition at line 1000 of file brush.cc.
References angle(), atan2f, BKE_brush_sample_masktex(), MTex::brush_map_mode, BRUSH_MASK_PRESSURE_CUTOFF, BRUSH_MASK_PRESSURE_RAMP, UnifiedPaintSettings::brush_rotation_sec, CLAMP, cosf, fabsf, Brush::mask_mtex, Brush::mask_pressure, Brush::mask_stencil_dimension, Brush::mask_stencil_pos, UnifiedPaintSettings::mask_tex_mouse, MTEX_MAP_MODE_RANDOM, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_VIEW, UnifiedPaintSettings::pixel_radius, RE_texture_evaluate(), MTex::rot, sinf, UnifiedPaintSettings::size_pressure_value, sqrtf, UnifiedPaintSettings::start_pixel_radius, MTex::tex, Scene::toolsettings, ToolSettings::unified_paint_settings, x, y, and zero_v4().
Referenced by BKE_brush_sample_masktex(), brush_painter_mask_ibuf_new(), brush_painter_mask_imbuf_update(), and do_projectpaint_thread().
| float BKE_brush_sample_tex_3d | ( | const Scene * | scene, |
| 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 877 of file brush.cc.
References angle(), atan2f, BKE_brush_sample_tex_3d(), MTex::brush_map_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::colorspace, cosf, UnifiedPaintSettings::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, UnifiedPaintSettings::pixel_radius, RE_texture_evaluate(), MTex::rot, sinf, sqrtf, UnifiedPaintSettings::start_pixel_radius, Brush::stencil_dimension, Brush::stencil_pos, MTex::tex, UnifiedPaintSettings::tex_mouse, Brush::texture_sample_bias, Scene::toolsettings, ToolSettings::unified_paint_settings, x, y, and zero_v4().
Referenced by BKE_brush_sample_tex_3d(), 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_size | ( | int * | r_brush_size, |
| float | new_unprojected_radius, | ||
| float | old_unprojected_radius ) |
Scale brush size to reflect a change in the brush's unprojected radius.
Definition at line 1328 of file brush.cc.
References BKE_brush_scale_size().
Referenced by BKE_brush_scale_size().
| void BKE_brush_scale_unprojected_radius | ( | float * | unprojected_radius, |
| int | new_brush_size, | ||
| int | old_brush_size ) |
Scale unprojected radius to reflect a change in the brush's 2D size.
Definition at line 1316 of file brush.cc.
References BKE_brush_scale_unprojected_radius().
Referenced by BKE_brush_scale_unprojected_radius().
| const float * BKE_brush_secondary_color_get | ( | const Scene * | scene, |
| const Paint * | paint, | ||
| const Brush * | brush ) |
Definition at line 1172 of file brush.cc.
References BKE_brush_secondary_color_get(), BKE_paint_use_unified_color(), UnifiedPaintSettings::secondary_rgb, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_secondary_color_get(), 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 1210 of file brush.cc.
References BKE_brush_size_get(), UnifiedPaintSettings::flag, size(), UnifiedPaintSettings::size, Scene::toolsettings, ToolSettings::unified_paint_settings, and UNIFIED_PAINT_SIZE.
Referenced by BKE_brush_jitter_pos(), BKE_brush_size_get(), blender::ed::sculpt_paint::greasepencil::brush_radius(), blender::ed::sculpt_paint::brush_radius_get(), brush_scale_size_exec(), 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_radius(), blender::ed::sculpt_paint::paint_draw_cursor_overlay(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), paint_proj_new_stroke(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::paint_stroke_new(), project_paint_begin(), blender::ed::sculpt_paint::smooth_brush_toggle_on(), blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_on(), texture_paint_camera_project_exec(), blender::ed::sculpt_paint::vwpaint::update_cache_variants(), blender::ed::sculpt_paint::update_modal_transform(), and blender::ed::sculpt_paint::use_add_density_mode().
Definition at line 1194 of file brush.cc.
References BKE_brush_size_set(), BKE_brush_tag_unsaved_changes(), CLAMP, UnifiedPaintSettings::flag, MAX_BRUSH_PIXEL_RADIUS, size(), UnifiedPaintSettings::size, Scene::toolsettings, ToolSettings::unified_paint_settings, and UNIFIED_PAINT_SIZE.
Referenced by BKE_brush_size_set(), 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 518 of file brush.cc.
References BKE_brush_system_exit(), BLI_rng_free(), and brush_rng.
Referenced by BKE_blender_free(), and BKE_brush_system_exit().
| void BKE_brush_system_init | ( | ) |
Definition at line 512 of file brush.cc.
References BKE_brush_system_init(), BLI_rng_new(), BLI_rng_srandom(), and brush_rng.
Referenced by BKE_brush_system_init(), and 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 720 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), and 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_tag_unsaved_changes(), BKE_brush_unprojected_radius_set(), BKE_brush_weight_set(), BKE_gpencil_brush_material_set(), brush_colors_flip_exec(), brush_scale_size_exec(), brush_sculpt_curves_falloff_preset_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 1249 of file brush.cc.
References BKE_brush_unprojected_radius_get(), UnifiedPaintSettings::flag, Scene::toolsettings, ToolSettings::unified_paint_settings, UNIFIED_PAINT_SIZE, and UnifiedPaintSettings::unprojected_radius.
Referenced by BKE_brush_unprojected_radius_get(), brush_scale_size_exec(), 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 1236 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), BKE_brush_unprojected_radius_set(), UnifiedPaintSettings::flag, Scene::toolsettings, ToolSettings::unified_paint_settings, UNIFIED_PAINT_SIZE, and UnifiedPaintSettings::unprojected_radius.
Referenced by BKE_brush_unprojected_radius_set(), brush_scale_size_exec(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_radius(), 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 1231 of file brush.cc.
References BKE_brush_use_alpha_pressure(), and BRUSH_ALPHA_PRESSURE.
Referenced by BKE_brush_use_alpha_pressure(), 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 1218 of file brush.cc.
References BKE_brush_use_locked_size(), BRUSH_LOCK_SIZE, UnifiedPaintSettings::flag, Scene::toolsettings, UNIFIED_PAINT_BRUSH_LOCK_SIZE, ToolSettings::unified_paint_settings, and UNIFIED_PAINT_SIZE.
Referenced by BKE_brush_use_locked_size(), 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_radius(), 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 1226 of file brush.cc.
References BKE_brush_use_size_pressure(), and BRUSH_SIZE_PRESSURE.
Referenced by BKE_brush_use_size_pressure(), 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_radius(), 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(), restore_from_undo_step_if_necessary(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), and blender::ed::sculpt_paint::vwpaint::update_cache_variants().
Definition at line 1276 of file brush.cc.
References BKE_brush_weight_get(), UnifiedPaintSettings::flag, Scene::toolsettings, ToolSettings::unified_paint_settings, UNIFIED_PAINT_WEIGHT, and UnifiedPaintSettings::weight.
Referenced by BKE_brush_weight_get(), BKE_brush_weight_get(), 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 1283 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), BKE_brush_weight_set(), UnifiedPaintSettings::flag, Scene::toolsettings, ToolSettings::unified_paint_settings, UNIFIED_PAINT_WEIGHT, and UnifiedPaintSettings::weight.
Referenced by BKE_brush_weight_set(), blender::ed::greasepencil::weight_sample_invoke(), and weight_sample_invoke().