|
Blender V4.3
|
#include <array>#include <optional>#include "MEM_guardedalloc.h"#include "DNA_ID.h"#include "DNA_brush_types.h"#include "DNA_defaults.h"#include "DNA_material_types.h"#include "DNA_scene_types.h"#include "BLI_listbase.h"#include "BLI_math_base.hh"#include "BLI_math_rotation.h"#include "BLI_rand.h"#include "BLT_translation.hh"#include "BKE_asset.hh"#include "BKE_bpath.hh"#include "BKE_brush.hh"#include "BKE_colortools.hh"#include "BKE_gpencil_legacy.h"#include "BKE_grease_pencil.hh"#include "BKE_idprop.hh"#include "BKE_idtype.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_main.hh"#include "BKE_material.h"#include "BKE_paint.hh"#include "BKE_preview_image.hh"#include "BKE_texture.h"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"#include "RE_texture.h"#include "BLO_read_write.hh"Go to the source code of this file.
Macros | |
| #define | FROM_DEFAULT(member) memcpy((void *)&brush->member, (void *)&brush_def->member, sizeof(brush->member)) |
| #define | FROM_DEFAULT_PTR(member) memcpy(brush->member, brush_def->member, sizeof(brush->member)) |
| #define | BR_TEST(field, t) |
| #define | BR_TEST_FLAG(_f) |
| #define | BR_TEST_FLAG_OVERLAY(_f) |
Variables | |
| static AssetTypeInfo | AssetType_BR |
| IDTypeInfo | IDType_ID_BR |
| static RNG * | brush_rng |
| #define BR_TEST | ( | field, | |
| t ) |
Referenced by BKE_brush_debug_print_state().
| #define BR_TEST_FLAG | ( | _f | ) |
Referenced by BKE_brush_debug_print_state().
| #define BR_TEST_FLAG_OVERLAY | ( | _f | ) |
Referenced by BKE_brush_debug_print_state().
| #define FROM_DEFAULT | ( | member | ) | memcpy((void *)&brush->member, (void *)&brush_def->member, sizeof(brush->member)) |
Referenced by brush_defaults().
| #define FROM_DEFAULT_PTR | ( | member | ) | memcpy(brush->member, brush_def->member, sizeof(brush->member)) |
Referenced by brush_defaults().
| Brush * BKE_brush_add | ( | Main * | bmain, |
| const char * | name, | ||
| eObjectMode | ob_mode ) |
Definition at line 542 of file brush.cc.
References BKE_brush_init_curves_sculpt_settings(), BKE_brush_init_gpencil_settings(), BKE_id_new(), ELEM, ID_BR, Brush::ob_mode, 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 1153 of file brush.cc.
References Brush::alpha, 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::SelectionPaintOperationExecutor::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::image::ops::paint::paint_stroke_update_step(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), and wpaint_stroke_update_step().
Definition at line 1140 of file brush.cc.
References Brush::alpha, 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 1265 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, 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::sample_node_surface_bmesh(), blender::ed::sculpt_paint::sample_node_surface_grids(), and blender::ed::sculpt_paint::sample_node_surface_mesh().
Definition at line 1029 of file brush.cc.
References BKE_paint_use_unified_color(), and Brush::rgb.
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().
| void BKE_brush_color_set | ( | Scene * | scene, |
| const Paint * | paint, | ||
| Brush * | brush, | ||
| const float | color[3] ) |
Definition at line 1047 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), BKE_paint_use_unified_color(), copy_v3_v3(), Brush::rgb, and UnifiedPaintSettings::rgb.
Referenced by 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, |
| const 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 770 of file brush.cc.
References Brush::mask_mtex, Brush::mtex, and OB_MODE_SCULPT.
Referenced by do_projectpaint_thread().
| void BKE_brush_curve_preset | ( | Brush * | b, |
| enum eCurveMappingPreset | preset ) |
Library Operations
Definition at line 744 of file brush.cc.
References b, BKE_brush_tag_unsaved_changes(), BKE_curvemap_reset(), BKE_curvemapping_add(), BKE_curvemapping_changed(), CurveMapping::clipr, CURVEMAP_SLOPE_NEGATIVE, CurveMapping::flag, and CurveMapping::preset.
Referenced by brush_blend_read_data(), brush_curve_preset_exec(), and brush_init_data().
Definition at line 1439 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 1388 of file brush.cc.
References 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_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 1444 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 638 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_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, and printf.
Delete a Brush.
Definition at line 589 of file brush.cc.
References BKE_id_delete(), BKE_library_ID_is_indirectly_used(), Brush::id, ID_EXTRA_USERS, ID_REAL_USERS, ID_TAG_INDIRECT, and ID::tag.
| Brush * BKE_brush_first_search | ( | Main * | bmain, |
| const eObjectMode | ob_mode ) |
Definition at line 628 of file brush.cc.
References Main::brushes, and LISTBASE_FOREACH.
Radial control.
Definition at line 1484 of file brush.cc.
References BKE_brush_curve_strength_clamped(), BKE_curvemapping_init(), brush_gen_texture(), Brush::curve, ImBufFloatBuffer::data, ImBuf::float_buffer, IB_DO_NOT_TAKE_OWNERSHIP, IMB_assign_float_buffer(), MEM_callocN, pow2f(), sqrtf, ImBuf::x, and ImBuf::y.
Referenced by radial_control_set_tex().
Definition at line 1514 of file brush.cc.
References ELEM, Sculpt, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_MULTIPLANE_SCRAPE, SCULPT_BRUSH_TYPE_PAINT, Brush::tip_roundness, and Brush::tip_scale_x.
Referenced by blender::ed::sculpt_paint::do_brush_action(), 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 605 of file brush.cc.
References BKE_curvemapping_add(), BRUSH_CURVES_SCULPT_FLAG_INTERPOLATE_RADIUS, Brush::curves_sculpt_settings, and BrushCurvesSculptSettings::flag.
Referenced by BKE_brush_add().
| void BKE_brush_init_gpencil_settings | ( | Brush * | brush | ) |
Add grease pencil settings.
Definition at line 563 of file brush.cc.
References BKE_curvemapping_add(), BrushGpencilSettings::curve_jitter, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, BrushGpencilSettings::draw_jitter, BrushGpencilSettings::draw_smoothlvl, BrushGpencilSettings::draw_strength, BrushGpencilSettings::flag, GP_BRUSH_USE_JITTER_PRESSURE, GP_BRUSH_USE_PRESSURE, and Brush::gpencil_settings.
Referenced by BKE_brush_add(), 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 1180 of file brush.cc.
References UnifiedPaintSettings::flag, Brush::input_samples, UnifiedPaintSettings::input_samples, and UNIFIED_PAINT_INPUT_SAMPLES.
Referenced by blender::ed::sculpt_paint::paint_stroke_modal().
Definition at line 1187 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, Brush::input_samples, UnifiedPaintSettings::input_samples, and UNIFIED_PAINT_INPUT_SAMPLES.
| void BKE_brush_jitter_pos | ( | const Scene & | scene, |
| const Brush & | brush, | ||
| const float | pos[2], | ||
| float | jitterpos[2] ) |
Definition at line 1224 of file brush.cc.
References BKE_brush_size_get(), BLI_rng_get_float(), BRUSH_ABSOLUTE_JITTER, brush_rng, Brush::flag, Brush::jitter, Brush::jitter_absolute, 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, |
| const 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 762 of file brush.cc.
References Brush::mask_mtex, Brush::mtex, and 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::sculpt_fix_noise_tear(), and update_brush_local_mat().
| void BKE_brush_randomize_texture_coords | ( | UnifiedPaintSettings * | ups, |
| bool | mask ) |
Definition at line 1251 of file brush.cc.
References BLI_rng_get_float(), brush_rng, UnifiedPaintSettings::mask_tex_mouse, UnifiedPaintSettings::pixel_radius, and UnifiedPaintSettings::tex_mouse.
Referenced by blender::ed::sculpt_paint::paint_brush_update().
| float BKE_brush_sample_masktex | ( | const Scene * | scene, |
| Brush * | br, | ||
| const float | point[2], | ||
| const int | thread, | ||
| ImagePool * | pool ) |
Definition at line 901 of file brush.cc.
References atan2f, 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, 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 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 778 of file brush.cc.
References atan2f, 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, 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().
| bool BKE_brush_sculpt_has_secondary_color | ( | const Brush * | brush | ) |
Definition at line 1101 of file brush.cc.
References ELEM, Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_BLOB, SCULPT_BRUSH_TYPE_CLAY, SCULPT_BRUSH_TYPE_CLAY_STRIPS, SCULPT_BRUSH_TYPE_CLAY_THUMB, SCULPT_BRUSH_TYPE_CREASE, SCULPT_BRUSH_TYPE_DRAW, SCULPT_BRUSH_TYPE_DRAW_SHARP, SCULPT_BRUSH_TYPE_FILL, SCULPT_BRUSH_TYPE_FLATTEN, SCULPT_BRUSH_TYPE_INFLATE, SCULPT_BRUSH_TYPE_LAYER, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_PINCH, and SCULPT_BRUSH_TYPE_SCRAPE.
Referenced by blender::ed::sculpt_paint::paint_cursor_context_init().
| const float * BKE_brush_secondary_color_get | ( | const Scene * | scene, |
| const Paint * | paint, | ||
| const Brush * | brush ) |
Definition at line 1037 of file brush.cc.
References BKE_paint_use_unified_color(), and Brush::secondary_rgb.
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 1075 of file brush.cc.
References UnifiedPaintSettings::flag, Brush::size, size(), UnifiedPaintSettings::size, and UNIFIED_PAINT_SIZE.
Referenced by BKE_brush_jitter_pos(), blender::ed::sculpt_paint::greasepencil::brush_radius(), blender::ed::sculpt_paint::brush_radius_get(), brush_scale_size_exec(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::trim::calculate_depth(), 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::paint_brush_update(), blender::ed::sculpt_paint::paint_cursor_context_init(), blender::ed::sculpt_paint::paint_cursor_update_object_space_radius(), 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::sculpt_calc_radius(), SCULPT_cursor_geometry_info_update(), 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 1059 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), CLAMP, UnifiedPaintSettings::flag, MAX_BRUSH_PIXEL_RADIUS, Brush::size, 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 476 of file brush.cc.
References BLI_rng_free(), and brush_rng.
Referenced by BKE_blender_free().
| void BKE_brush_system_init | ( | ) |
Definition at line 470 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 621 of file brush.cc.
References Brush::has_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_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(), calculateCenterActive(), ED_render_id_flush_update(), blender::ui::greasepencil::eyedropper_set_brush_color(), flushTransPaintCurve(), grab_clone_apply(), grab_clone_modal(), 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(), blender::ed::greasepencil::toggle_weight_tool_direction(), and ui_do_but_COLOR().
Definition at line 1133 of file brush.cc.
References UnifiedPaintSettings::flag, UNIFIED_PAINT_SIZE, Brush::unprojected_radius, and UnifiedPaintSettings::unprojected_radius.
Referenced by brush_scale_size_exec(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::sculpt_paint::paint_cursor_update_object_space_radius(), blender::ed::sculpt_paint::paint_cursor_update_pixel_radius(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::sculpt_calc_radius(), SCULPT_cursor_geometry_info_update(), and blender::ed::sculpt_paint::update_modal_transform().
Definition at line 1120 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UNIFIED_PAINT_SIZE, Brush::unprojected_radius, and UnifiedPaintSettings::unprojected_radius.
Referenced by 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 1096 of file brush.cc.
References BRUSH_ALPHA_PRESSURE, and Brush::flag.
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 1083 of file brush.cc.
References BRUSH_LOCK_SIZE, Brush::flag, UNIFIED_PAINT_BRUSH_LOCK_SIZE, and UNIFIED_PAINT_SIZE.
Referenced by blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::trim::calculate_depth(), blender::ed::sculpt_paint::paint_cursor_sculpt_session_update_and_init(), blender::ed::sculpt_paint::paint_cursor_update_object_space_radius(), blender::ed::sculpt_paint::paint_cursor_update_unprojected_radius(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::sculpt_calc_radius(), SCULPT_cursor_geometry_info_update(), 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 1091 of file brush.cc.
References BRUSH_SIZE_PRESSURE, and Brush::flag.
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_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 1160 of file brush.cc.
References UnifiedPaintSettings::flag, UNIFIED_PAINT_WEIGHT, Brush::weight, and UnifiedPaintSettings::weight.
Referenced by blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), paint_weight_gradient_exec(), weight_paint_set_exec(), and wpaint_paint_leaves().
Definition at line 1167 of file brush.cc.
References BKE_brush_tag_unsaved_changes(), UnifiedPaintSettings::flag, UNIFIED_PAINT_WEIGHT, Brush::weight, and UnifiedPaintSettings::weight.
Referenced by blender::ed::greasepencil::weight_sample_invoke(), and weight_sample_invoke().
|
static |
Definition at line 388 of file brush.cc.
References BKE_asset_metadata_idprop_ensure(), BKE_paint_get_brush_type_from_obmode(), BLI_assert, BLI_assert_unreachable, GS, Brush::id, ID_BR, ID::name, Brush::ob_mode, OB_MODE_EDIT, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_SCULPT, OB_MODE_SCULPT_CURVES, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_GREASE_PENCIL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_GREASE_PENCIL, and OB_MODE_WEIGHT_PAINT.
|
static |
Definition at line 371 of file brush.cc.
References BrushGpencilSettings::flag, GP_BRUSH_MATERIAL_PINNED, Brush::gpencil_settings, and BrushGpencilSettings::material.
|
static |
Definition at line 281 of file brush.cc.
References Brush::automasking_cavity_curve, BKE_brush_curve_preset(), BKE_curvemapping_blend_read(), BKE_previewimg_blend_read(), BKE_sculpt_default_cavity_curve(), BLO_read_struct, Brush::curve, BrushGpencilSettings::curve_jitter, BrushCurvesSculptSettings::curve_parameter_falloff, CURVE_PRESET_SHARP, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, Brush::curves_sculpt_settings, Brush::gpencil_settings, Brush::gradient, Brush::has_unsaved_changes, Brush::icon_imbuf, and Brush::preview.
|
static |
Definition at line 224 of file brush.cc.
References Brush::automasking_cavity_curve, BKE_curvemapping_blend_write(), BKE_id_blend_write(), BKE_previewimg_blend_write(), BLO_write_id_struct, BLO_write_struct, Brush::curve, BrushGpencilSettings::curve_jitter, BrushCurvesSculptSettings::curve_parameter_falloff, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, Brush::curves_sculpt_settings, Brush::gpencil_settings, Brush::gradient, Brush::id, and Brush::preview.
|
static |
Definition at line 65 of file brush.cc.
References Brush::automasking_cavity_curve, BKE_curvemapping_copy(), BKE_previewimg_id_copy(), Brush::curve, BrushGpencilSettings::curve_jitter, BrushCurvesSculptSettings::curve_parameter_falloff, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, Brush::curves_sculpt_settings, flag, Brush::gpencil_settings, Brush::icon_imbuf, Brush::id, id_fake_user_set(), IMB_dupImBuf(), LIB_ID_COPY_NO_PREVIEW, and Brush::preview.
|
static |
Definition at line 485 of file brush.cc.
References blend, DNA_struct_default_get, flag, FROM_DEFAULT, FROM_DEFAULT_PTR, and overlay_flags.
Referenced by BKE_brush_debug_print_state().
|
static |
Definition at line 199 of file brush.cc.
References BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_texture_mtex_foreach_id(), Brush::clone, Brush::gpencil_settings, IDWALK_CB_NOP, IDWALK_CB_USER, BrushClone::image, Brush::mask_mtex, BrushGpencilSettings::material, BrushGpencilSettings::material_alt, Brush::mtex, Brush::paint_curve, and Brush::toggle_brush.
|
static |
Definition at line 215 of file brush.cc.
References BKE_bpath_foreach_path_fixed_process(), and Brush::icon_filepath.
|
static |
Definition at line 121 of file brush.cc.
References Brush::automasking_cavity_curve, BKE_curvemapping_free(), BKE_previewimg_free(), Brush::curve, BrushGpencilSettings::curve_jitter, BrushCurvesSculptSettings::curve_parameter_falloff, BrushGpencilSettings::curve_rand_hue, BrushGpencilSettings::curve_rand_pressure, BrushGpencilSettings::curve_rand_saturation, BrushGpencilSettings::curve_rand_strength, BrushGpencilSettings::curve_rand_uv, BrushGpencilSettings::curve_rand_value, BrushGpencilSettings::curve_sensitivity, BrushGpencilSettings::curve_strength, Brush::curves_sculpt_settings, Brush::gpencil_settings, Brush::gradient, Brush::icon_imbuf, IMB_freeImBuf(), MEM_freeN(), MEM_SAFE_FREE, and Brush::preview.
|
static |
Definition at line 1454 of file brush.cc.
References Brush::mask_mtex, Brush::mtex, RE_texture_evaluate(), MTex::tex, x, and y.
Referenced by BKE_brush_gen_radial_control_imbuf().
|
static |
Definition at line 51 of file brush.cc.
References BKE_brush_curve_preset(), BLI_assert, CURVE_PRESET_SMOOTH, DNA_struct_default_get, Brush::id, id_fake_user_set(), MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
Definition at line 154 of file brush.cc.
References BKE_id_copy(), BKE_lib_id_clear_library_data(), BKE_lib_id_expand_local(), BKE_lib_id_make_local(), BKE_lib_id_make_local_generic_action_define(), BKE_libblock_remap(), BLI_assert, Brush::clone, Brush::id, Image::id, id_fake_user_set(), ID_IS_LINKED, ID_NEW_SET, ID_REMAP_SKIP_INDIRECT_USAGE, BrushClone::image, LIB_ID_MAKELOCAL_ASSET_DATA_CLEAR, LIB_ID_MAKELOCAL_FULL_LIBRARY, ID::newid, and ID::us.
|
static |
|
static |
Definition at line 468 of file brush.cc.
Referenced by BKE_brush_jitter_pos(), BKE_brush_randomize_texture_coords(), BKE_brush_system_exit(), and BKE_brush_system_init().
| IDTypeInfo IDType_ID_BR |