|
Blender V4.3
|
#include <cstdlib>#include <cstring>#include <optional>#include "DNA_object_enums.h"#include "MEM_guardedalloc.h"#include "DNA_asset_types.h"#include "DNA_brush_types.h"#include "DNA_defaults.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_key_types.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_modifier_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "DNA_view3d_types.h"#include "DNA_workspace_types.h"#include "BLI_bitmap.h"#include "BLI_hash.h"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_matrix.h"#include "BLI_math_matrix.hh"#include "BLI_math_vector.h"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "BLT_translation.hh"#include "BKE_asset.hh"#include "BKE_asset_edit.hh"#include "BKE_attribute.hh"#include "BKE_brush.hh"#include "BKE_ccg.hh"#include "BKE_colortools.hh"#include "BKE_context.hh"#include "BKE_crazyspace.hh"#include "BKE_deform.hh"#include "BKE_gpencil_legacy.h"#include "BKE_idtype.hh"#include "BKE_image.hh"#include "BKE_key.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_main.hh"#include "BKE_material.h"#include "BKE_mesh.hh"#include "BKE_mesh_mapping.hh"#include "BKE_mesh_runtime.hh"#include "BKE_modifier.hh"#include "BKE_multires.hh"#include "BKE_object.hh"#include "BKE_object_types.hh"#include "BKE_paint.hh"#include "BKE_pbvh_api.hh"#include "BKE_scene.hh"#include "BKE_subdiv_ccg.hh"#include "BKE_subsurf.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "RNA_enum_types.hh"#include "BLO_read_write.hh"#include "bmesh.hh"Go to the source code of this file.
Namespaces | |
| namespace | blender |
| namespace | blender::bke |
| namespace | blender::bke::object |
Macros | |
| #define | GOLDEN_RATIO_CONJUGATE 0.618033988749895f |
Variables | |
| IDTypeInfo | IDType_ID_PAL |
| IDTypeInfo | IDType_ID_PC |
| const uchar | PAINT_CURSOR_SCULPT [3] = {255, 100, 100} |
| const uchar | PAINT_CURSOR_VERTEX_PAINT [3] = {255, 255, 255} |
| const uchar | PAINT_CURSOR_WEIGHT_PAINT [3] = {200, 200, 255} |
| const uchar | PAINT_CURSOR_TEXTURE_PAINT [3] = {255, 255, 255} |
| const uchar | PAINT_CURSOR_SCULPT_CURVES [3] = {255, 100, 100} |
| const uchar | PAINT_CURSOR_PAINT_GREASE_PENCIL [3] = {255, 100, 100} |
| const uchar | PAINT_CURSOR_SCULPT_GREASE_PENCIL [3] = {255, 100, 100} |
| static ePaintOverlayControlFlags | overlay_flags = (ePaintOverlayControlFlags)0 |
| #define GOLDEN_RATIO_CONJUGATE 0.618033988749895f |
Definition at line 2885 of file paint.cc.
Referenced by BKE_paint_face_set_overlay_color_get().
|
static |
Definition at line 667 of file paint.cc.
References blender::bke::asset_edit_weak_reference_from_id(), and Brush::id.
Referenced by BKE_paint_brush_set().
| bool BKE_object_sculpt_use_dyntopo | ( | const Object * | object | ) |
| bool BKE_paint_always_hide_test | ( | const Object * | ob | ) |
Checks if face/vertex hiding is always applied in the current mode. Returns true in vertex/weight paint.
Definition at line 1638 of file paint.cc.
References Object::data, Object::mode, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by face_vert_reveal_poll().
| void BKE_paint_blend_read_data | ( | BlendDataReader * | reader, |
| const Scene * | scene, | ||
| Paint * | paint ) |
Definition at line 1894 of file paint.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BKE_asset_weak_reference_read(), BKE_curvemapping_blend_read(), BKE_paint_cavity_curve_preset(), BLO_read_string(), BLO_read_struct, BLO_read_struct_list, Paint::brush_asset_reference, Paint::cavity_curve, CURVE_PRESET_LINE, Paint::eraser_brush_asset_reference, LISTBASE_FOREACH, ToolSystemBrushBindings::main_brush_asset_reference, Paint::paint_cursor, paint_runtime_init(), and Paint::tool_brush_bindings.
Referenced by direct_link_paint_helper(), and scene_blend_read_data().
| void BKE_paint_blend_write | ( | BlendWriter * | writer, |
| Paint * | paint ) |
Definition at line 1862 of file paint.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BKE_asset_weak_reference_write(), BKE_curvemapping_blend_write(), BLO_write_string(), BLO_write_struct_list, Paint::brush_asset_reference, Paint::cavity_curve, Paint::eraser_brush_asset_reference, LISTBASE_FOREACH, ToolSystemBrushBindings::main_brush_asset_reference, and Paint::tool_brush_bindings.
Referenced by scene_blend_write().
Definition at line 649 of file paint.cc.
References BKE_paint_brush_for_read().
Referenced by BKE_paint_brushes_validate(), BKE_paint_invalidate_cursor_overlay(), BKE_paint_invalidate_overlay_tex(), blender::ed::sculpt_paint::brush_asset_delete_exec(), blender::ed::sculpt_paint::brush_asset_delete_invoke(), blender::ed::sculpt_paint::brush_asset_delete_poll(), blender::ed::sculpt_paint::brush_asset_edit_metadata_exec(), blender::ed::sculpt_paint::brush_asset_edit_metadata_poll(), blender::ed::sculpt_paint::brush_asset_load_preview_exec(), blender::ed::sculpt_paint::brush_asset_revert_exec(), blender::ed::sculpt_paint::brush_asset_revert_poll(), blender::ed::sculpt_paint::brush_asset_save_as_exec(), blender::ed::sculpt_paint::brush_asset_save_as_poll(), blender::ed::sculpt_paint::brush_asset_save_exec(), blender::ed::sculpt_paint::brush_asset_save_poll(), brush_colors_flip_exec(), brush_curve_preset_exec(), brush_curve_preset_poll(), blender::ed::sculpt_paint::brush_exit_tex(), brush_scale_size_exec(), brush_sculpt_curves_falloff_preset_exec(), brush_sculpt_curves_falloff_preset_poll(), blender::ed::sculpt_paint::brush_tool_get(), buttons_context_path_brush(), buttons_texture_users_from_context(), blender::ed::sculpt_paint::trim::calculate_depth(), calculateCenterActive(), createTransPaintCurveVerts(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke(), ED_paint_proj_mesh_data_check(), ED_space_image_paint_curve(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), blender::ui::greasepencil::eyedropper_set_brush_color(), flushTransPaintCurve(), blender::ed::sculpt_paint::GreasePencilFillOpData::from_context(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), blender::ed::sculpt_paint::greasepencil::get_drawings_for_painting(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::sculpt_paint::grease_pencil_fill_init(), blender::ed::sculpt_paint::grease_pencil_fill_invoke(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), image_paint_brush(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_stroke(), initTransInfo(), is_brush_related_tool(), blender::ed::greasepencil::keymap_grease_pencil_brush_stroke_poll(), blender::ed::greasepencil::keymap_grease_pencil_fill_tool_poll(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::ed::sculpt_paint::new_selection_paint_operation(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::GrabOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_done(), blender::ed::sculpt_paint::greasepencil::PinchOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::PushOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::StrengthOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::ThicknessOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::TwistOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), over_mesh(), OVERLAY_edit_uv_cache_init(), OVERLAY_edit_uv_init(), paint_2d_new_stroke(), blender::ed::sculpt_paint::paint_cursor_context_init(), blender::ed::sculpt_paint::paint_cursor_update_pixel_radius(), paint_curve_poll(), blender::ed::sculpt_paint::paint_draw_smooth_cursor(), blender::ed::sculpt_paint::paint_line_strokes_spacing(), paint_proj_new_stroke(), paint_sample_color(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), blender::ed::sculpt_paint::paint_stroke_modal(), blender::ed::sculpt_paint::paint_stroke_new(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), paint_weight_gradient_exec(), paintcurve_delete_point_exec(), paintcurve_new_exec(), paintcurve_point_add(), paintcurve_point_select(), paintcurve_slide_invoke(), paintcurve_undosys_poll(), paintcurve_undosys_step_encode(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::PaintOperationExecutor(), project_state_init(), sample_color_exec(), blender::ed::sculpt_paint::sample_color_invoke(), sample_color_invoke(), sample_color_modal(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), SCULPT_stroke_get_location(), SCULPT_stroke_get_location_ex(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::ed::sculpt_paint::sculpt_update_cache_variants(), 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(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), blender::ed::sculpt_paint::stroke_done(), blender::ed::sculpt_paint::stroke_test_start(), blender::ed::greasepencil::stroke_trim_execute(), texture_get_from_context(), blender::ed::sculpt_paint::image::ops::paint::texture_paint_init(), blender::ed::greasepencil::toggle_weight_tool_direction(), blender::ed::greasepencil::toggle_weight_tool_direction_poll(), ui_do_but_COLOR(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), blender::ed::sculpt_paint::vwpaint::update_cache_variants(), vertex_paint_poll_ex(), vpaint_stroke_test_start(), vpaint_stroke_update_step(), weight_paint_poll_ex(), weight_paint_set_exec(), blender::ed::greasepencil::weight_sample_invoke(), weight_sample_invoke(), wpaint_do_symmetrical_brush_actions(), wpaint_stroke_test_start(), and wpaint_stroke_update_step().
Definition at line 654 of file paint.cc.
References Paint::brush.
Referenced by blender::draw::overlay::MeshUVs::begin_sync(), BKE_paint_brush(), brush_init_tex(), brush_strength(), brush_stroke_init(), blender::ed::sculpt_paint::vwpaint::brush_use_accumulate(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::sculpt_paint::expand::cache_initial_config_set(), blender::ed::sculpt_paint::calc_sculpt_normal(), blender::ed::sculpt_paint::cloth::cloth_brush_apply_brush_foces(), blender::ed::sculpt_paint::do_bmesh_topology_rake_brush(), blender::ed::sculpt_paint::boundary::do_boundary_brush(), blender::ed::sculpt_paint::do_clay_brush(), blender::ed::sculpt_paint::do_clay_strips_brush(), blender::ed::sculpt_paint::do_clay_thumb_brush(), blender::ed::sculpt_paint::cloth::do_cloth_brush(), blender::ed::sculpt_paint::do_displacement_eraser_brush(), blender::ed::sculpt_paint::do_displacement_smear_brush(), blender::ed::sculpt_paint::do_draw_brush(), blender::ed::sculpt_paint::do_draw_face_sets_brush(), blender::ed::sculpt_paint::do_draw_sharp_brush(), blender::ed::sculpt_paint::do_draw_vector_displacement_brush(), blender::ed::sculpt_paint::do_elastic_deform_brush(), blender::ed::sculpt_paint::do_enhance_details_brush(), blender::ed::sculpt_paint::do_grab_brush(), blender::ed::sculpt_paint::do_inflate_brush(), blender::ed::sculpt_paint::do_layer_brush(), blender::ed::sculpt_paint::do_mask_brush(), blender::ed::sculpt_paint::do_multiplane_scrape_brush(), blender::ed::sculpt_paint::color::do_paint_brush(), blender::ed::sculpt_paint::do_pinch_brush(), blender::ed::sculpt_paint::pose::do_pose_brush(), blender::ed::sculpt_paint::do_relax_face_sets_brush(), blender::ed::sculpt_paint::do_rotate_brush(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::ed::sculpt_paint::color::do_smear_brush(), blender::ed::sculpt_paint::do_smooth_brush(), blender::ed::sculpt_paint::do_smooth_mask_brush(), blender::ed::sculpt_paint::do_snake_hook_brush(), blender::ed::sculpt_paint::do_surface_smooth_brush(), blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::ed::sculpt_paint::do_thumb_brush(), blender::ed::sculpt_paint::do_topology_relax_brush(), blender::ed::sculpt_paint::do_topology_slide_brush(), blender::draw::overlay::MeshUVs::end_sync(), blender::ed::sculpt_paint::cloth::ensure_nodes_constraints(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::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::auto_mask::fill_topology_automasking_factors_bmesh(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_grids(), blender::ed::sculpt_paint::auto_mask::fill_topology_automasking_factors_mesh(), blender::ed::sculpt_paint::get_stroke_operation(), blender::ed::sculpt_paint::grease_pencil_brush_stroke_invoke(), blender::ed::greasepencil::grease_pencil_draw_operator_invoke(), blender::ed::sculpt_paint::grease_pencil_sculpt_paint_invoke(), blender::ed::sculpt_paint::grease_pencil_vertex_brush_stroke_invoke(), blender::ed::sculpt_paint::grease_pencil_weight_brush_stroke_invoke(), image_paint_brush_uses_canvas(), blender::ed::sculpt_paint::auto_mask::init_face_sets_masking(), is_cursor_visible(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_poll(), blender::ed::sculpt_paint::new_grow_shrink_operation(), blender::ed::sculpt_paint::new_pinch_operation(), blender::ed::sculpt_paint::offset_positions(), paint_and_tex_color_alpha_intern(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::image::ops::paint::paint_exec(), blender::ed::sculpt_paint::paint_space_stroke(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), palette_color_add_exec(), blender::ed::sculpt_paint::undo::restore_from_undo_step(), restore_from_undo_step_if_necessary(), blender::ed::sculpt_paint::dyntopo::sample_detail_dyntopo(), SCULPT_brush_plane_offset_get(), blender::ed::sculpt_paint::sculpt_brush_stroke_cancel(), sculpt_brush_type_name(), blender::ed::sculpt_paint::cloth::sculpt_cloth_ensure_constraints_in_simulation_area(), SCULPT_cursor_geometry_info_update(), blender::ed::sculpt_paint::sculpt_curves_stroke_invoke(), SCULPT_do_paint_brush_image(), blender::ed::sculpt_paint::sculpt_fix_noise_tear(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::ed::sculpt_paint::start_brush_operation(), stroke_undo_begin(), blender::ed::sculpt_paint::stroke_update_step(), update_brush_local_mat(), blender::ed::sculpt_paint::update_modal_transform(), blender::ed::sculpt_paint::update_sculpt_normal(), blender::ed::sculpt_paint::use_add_density_mode(), blender::ed::sculpt_paint::vwpaint::use_normal(), vpaint_blend(), vpaint_do_symmetrical_brush_actions(), vpaint_get_current_col(), wpaint_blend(), and wpaint_stroke_test_start().
| Brush * BKE_paint_brush_from_essentials | ( | Main * | bmain, |
| const eObjectMode | ob_mode, | ||
| const char * | name ) |
Definition at line 789 of file paint.cc.
References blender::bke::asset_edit_id_from_weak_reference(), ID_BR, and paint_brush_asset_reference_from_essentials().
Check if brush brush may be set/activated for paint. Passing null for brush will return true.
Definition at line 659 of file paint.cc.
References Brush::ob_mode, Paint_Runtime::ob_mode, and Paint::runtime.
Referenced by BKE_paint_brush_set(), BKE_paint_brush_set(), and WM_toolsystem_activate_brush_and_tool().
| bool BKE_paint_brush_set | ( | Main * | bmain, |
| Paint * | paint, | ||
| const AssetWeakReference * | brush_asset_reference ) |
Version of BKE_paint_brush_set() that takes an asset reference instead of a brush, importing the brush if necessary.
Definition at line 678 of file paint.cc.
References blender::bke::asset_edit_id_from_weak_reference(), blender::bke::asset_edit_id_is_editable(), blender::bke::asset_edit_weak_reference_from_id(), BKE_paint_brush_poll(), BLI_assert, Paint::brush, Paint::brush_asset_reference, Brush::id, ID_BR, ID_IS_LINKED, and Main::is_locked_for_linking.
Referenced by BKE_paint_brushes_validate().
Activates brush for painting, and updates Paint.brush_asset_reference so the brush can be restored after file read. No change is done if BKE_paint_brush_poll() returns false.
Definition at line 714 of file paint.cc.
References asset_reference_create_from_brush(), BKE_paint_brush_poll(), Paint::brush, and Paint::brush_asset_reference.
Referenced by blender::ed::sculpt_paint::brush_asset_revert_exec(), 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(), toolsystem_brush_activate_from_toolref_for_object_paint(), and WM_toolsystem_activate_brush_and_tool().
Definition at line 1096 of file paint.cc.
References paint_brush_set_default_reference(), and paint_brush_update_from_asset_reference().
Referenced by BKE_paint_brushes_ensure(), BKE_paint_brushes_validate(), blender::ed::sculpt_paint::brush_asset_delete_exec(), and blender::ed::sculpt_paint::brush_asset_revert_exec().
Definition at line 1102 of file paint.cc.
References paint_brush_set_essentials_reference(), and paint_brush_update_from_asset_reference().
Referenced by blender::ed::sculpt_paint::smooth_brush_toggle_on(), and blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_on().
| std::optional< AssetWeakReference > BKE_paint_brush_type_default_reference | ( | eObjectMode | ob_mode, |
| std::optional< int > | brush_type ) |
Definition at line 1030 of file paint.cc.
References paint_brush_asset_reference_from_essentials(), and paint_brush_default_essentials_name_get().
Referenced by toolsystem_brush_activate_from_toolref_for_object_paint().
Make sure the active brush asset is available as active brush, importing it if necessary. If there is no user set active brush, the default one is used/imported from the essentials asset library.
It's good to avoid this until the user actually shows intentions to use brushes, to avoid unused brushes in files. E.g. use this when entering a paint mode, but not for versioning.
Also handles the active eraser brush asset.
Definition at line 1762 of file paint.cc.
References BKE_paint_brush_set_default(), BKE_paint_eraser_brush_set_default(), Paint::brush, Paint::brush_asset_reference, Paint::eraser_brush, Paint::eraser_brush_asset_reference, paint_brush_update_from_asset_reference(), and paint_eraser_brush_set_from_asset_reference().
Referenced by BKE_paint_init(), BKE_sculpt_toolsettings_data_ensure(), blender::ed::sculpt_paint::curves_sculptmode_enter(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), and blender::ed::greasepencil::vertexmode_toggle_exec().
| void BKE_paint_brushes_set_default_references | ( | ToolSettings * | ts | ) |
Definition at line 1067 of file paint.cc.
References ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, CurvesSculpt::paint, GpPaint::paint, GpSculptPaint::paint, GpVertexPaint::paint, GpWeightPaint::paint, ImagePaintSettings::paint, Sculpt::paint, VPaint::paint, paint_brush_set_default_reference(), ToolSettings::sculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by update_paint_modes_for_brush_assets().
Definition at line 1108 of file paint.cc.
References BKE_paint_brush(), BKE_paint_brush_set(), BKE_paint_brush_set_default(), BKE_paint_eraser_brush(), BKE_paint_eraser_brush_set(), BKE_paint_eraser_brush_set_default(), Brush::ob_mode, Paint_Runtime::ob_mode, and Paint::runtime.
Referenced by ED_object_texture_paint_mode_enter_ex(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::sculpt_paint::sculpt_mode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), blender::ed::greasepencil::vertexmode_toggle_exec(), vpaint_mode_toggle_exec(), blender::ed::greasepencil::weightmode_toggle_exec(), and wpaint_mode_toggle_exec().
Definition at line 1644 of file paint.cc.
References BKE_curvemap_reset(), BKE_curvemapping_add(), BKE_curvemapping_changed(), Paint::cavity_curve, CurveMapping::clipr, CurveMapping::cm, CURVEMAP_SLOPE_POSITIVE, CurveMapping::flag, and CurveMapping::preset.
Referenced by BKE_paint_blend_read_data(), and BKE_paint_init().
Called when copying scene settings, so even if 'src' and 'tar' are the same still do a id_us_plus(), rather than if we were copying between 2 existing scenes where a matching value should decrease the existing user count as with #paint_brush_set()
Definition at line 1818 of file paint.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BKE_curvemapping_copy(), BLI_duplicatelist(), BLI_strdup(), Paint::brush, Paint::brush_asset_reference, Paint::cavity_curve, Paint::eraser_brush_asset_reference, flag, id_us_plus(), LIB_ID_CREATE_NO_USER_REFCOUNT, LISTBASE_FOREACH, ToolSystemBrushBindings::main_brush_asset_reference, Paint::palette, and Paint::tool_brush_bindings.
Referenced by BKE_toolsettings_copy().
| PaintCurve * BKE_paint_curve_add | ( | Main * | bmain, |
| const char * | name ) |
Definition at line 1339 of file paint.cc.
References BKE_id_new(), and ID_PC.
Referenced by paintcurve_for_brush_add().
| void BKE_paint_curve_clamp_endpoint_add_index | ( | PaintCurve * | pc, |
| const int | add_index ) |
Definition at line 1359 of file paint.cc.
References PaintCurve::add_index, and PaintCurve::tot_points.
Referenced by paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), and paintcurve_slide_invoke().
| bool BKE_paint_ensure | ( | ToolSettings * | ts, |
| Paint ** | r_paint ) |
Call when entering each respective paint mode.
Definition at line 1685 of file paint.cc.
References BLI_assert, ToolSettings::curves_sculpt, DNA_struct_default_get, ELEM, Paint::flags, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, Paint_Runtime::ob_mode, ImagePaintSettings::paint, paint_runtime_init(), PAINT_SHOW_BRUSH, Paint::runtime, ToolSettings::sculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_ensure_from_paintmode(), BKE_sculpt_toolsettings_data_ensure(), blender::ed::sculpt_paint::curves_sculptmode_enter(), blender::ed::sculpt_paint::vwpaint::mode_enter_generic(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), blender::ed::greasepencil::vertexmode_toggle_exec(), and blender::ed::greasepencil::weightmode_toggle_exec().
Definition at line 320 of file paint.cc.
References BKE_paint_ensure(), ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, GPencil, ToolSettings::imapaint, Invalid, Sculpt, ToolSettings::sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, Texture2D, Texture3D, Scene::toolsettings, Vertex, VertexGPencil, ToolSettings::vpaint, Weight, WeightGPencil, and ToolSettings::wpaint.
Referenced by BKE_paint_init(), BLO_update_defaults_startup_blend(), do_versions_after_linking_280(), and toolsystem_brush_activate_from_toolref_for_object_paint().
Definition at line 1155 of file paint.cc.
References BKE_paint_eraser_brush_for_read().
Referenced by BKE_paint_brushes_validate(), blender::ed::sculpt_paint::greasepencil::EraseOperationExecutor::execute(), and blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_begin().
Definition at line 1160 of file paint.cc.
References Paint::eraser_brush.
Referenced by BKE_paint_eraser_brush().
| Brush * BKE_paint_eraser_brush_from_essentials | ( | Main * | bmain, |
| eObjectMode | ob_mode, | ||
| const char * | name ) |
Definition at line 1190 of file paint.cc.
References blender::bke::asset_edit_id_from_weak_reference(), ID_BR, and paint_brush_asset_reference_from_essentials().
Definition at line 1165 of file paint.cc.
References blender::bke::asset_edit_weak_reference_from_id(), Paint::eraser_brush, Paint::eraser_brush_asset_reference, Brush::id, Brush::ob_mode, Paint_Runtime::ob_mode, and Paint::runtime.
Referenced by BKE_paint_brushes_validate().
Definition at line 1202 of file paint.cc.
References paint_brush_set_default_reference(), and paint_eraser_brush_set_from_asset_reference().
Referenced by BKE_paint_brushes_ensure(), and BKE_paint_brushes_validate().
Definition at line 1208 of file paint.cc.
References paint_eraser_brush_set_essentials_reference(), and paint_eraser_brush_set_from_asset_reference().
| void BKE_paint_free | ( | Paint * | paint | ) |
Definition at line 1801 of file paint.cc.
References ToolSystemBrushBindings::active_brush_per_brush_type, BKE_curvemapping_free(), Paint::brush_asset_reference, Paint::cavity_curve, Paint::eraser_brush_asset_reference, LISTBASE_FOREACH_MUTABLE, ToolSystemBrushBindings::main_brush_asset_reference, and Paint::tool_brush_bindings.
Referenced by BKE_toolsettings_free().
Definition at line 438 of file paint.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, Object::mode, 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, OB_MODE_WEIGHT_PAINT, CurvesSculpt::paint, GpPaint::paint, GpSculptPaint::paint, GpVertexPaint::paint, GpWeightPaint::paint, ImagePaintSettings::paint, Sculpt::paint, VPaint::paint, ToolSettings::sculpt, Scene::toolsettings, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_get_active_from_context(), BKE_paint_invalidate_cursor_overlay(), BKE_paint_invalidate_overlay_tex(), buttons_context_path_brush(), calculateCenterActive(), and is_cursor_visible().
Definition at line 477 of file paint.cc.
References BKE_paint_get_active(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), ToolSettings::imapaint, Object::mode, SpaceImage::mode, OB_MODE_EDIT, ImagePaintSettings::paint, SI_MODE_PAINT, and Scene::toolsettings.
Referenced by blender::ed::sculpt_paint::brush_asset_activate_exec(), blender::ed::sculpt_paint::brush_asset_delete_exec(), blender::ed::sculpt_paint::brush_asset_delete_invoke(), blender::ed::sculpt_paint::brush_asset_delete_poll(), blender::ed::sculpt_paint::brush_asset_edit_metadata_exec(), blender::ed::sculpt_paint::brush_asset_edit_metadata_invoke(), blender::ed::sculpt_paint::brush_asset_edit_metadata_poll(), blender::ed::sculpt_paint::brush_asset_load_preview_exec(), blender::ed::sculpt_paint::brush_asset_revert_exec(), blender::ed::sculpt_paint::brush_asset_revert_poll(), blender::ed::sculpt_paint::brush_asset_save_as_exec(), blender::ed::sculpt_paint::brush_asset_save_as_invoke(), blender::ed::sculpt_paint::brush_asset_save_as_poll(), blender::ed::sculpt_paint::brush_asset_save_exec(), blender::ed::sculpt_paint::brush_asset_save_poll(), brush_colors_flip_exec(), brush_curve_preset_exec(), brush_curve_preset_poll(), brush_scale_size_exec(), brush_sculpt_curves_falloff_preset_exec(), brush_sculpt_curves_falloff_preset_poll(), blender::ed::sculpt_paint::brush_tool_get(), buttons_texture_users_from_context(), blender::ed::sculpt_paint::expand::cache_initial_config_set(), createTransPaintCurveVerts(), drw_sculpt_generate_calls(), flushTransPaintCurve(), blender::ed::sculpt_paint::greasepencil::WeightPaintOperation::get_brush_settings(), blender::ed::sculpt_paint::greasepencil::get_drawings_for_painting(), blender::ed::sculpt_paint::get_stroke_operation(), blender::ed::sculpt_paint::grease_pencil_brush_stroke_invoke(), blender::ed::greasepencil::grease_pencil_draw_operator_invoke(), blender::ed::sculpt_paint::grease_pencil_sculpt_paint_invoke(), blender::ed::sculpt_paint::grease_pencil_vertex_brush_stroke_invoke(), blender::ed::greasepencil::grease_pencil_vertex_paint_set_exec(), blender::ed::sculpt_paint::grease_pencil_weight_brush_stroke_invoke(), image_paint_brush_uses_canvas(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_stroke(), initTransInfo(), is_brush_related_tool(), blender::ed::sculpt_paint::greasepencil::EraseOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::GrabOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::TintOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PinchOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::PushOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::StrengthOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::ThicknessOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::TwistOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended(), paint_2d_new_stroke(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::paint_cursor_context_init(), paint_curve_poll(), blender::ed::sculpt_paint::paint_draw_line_cursor(), blender::ed::sculpt_paint::paint_draw_smooth_cursor(), blender::ed::sculpt_paint::image::ops::paint::paint_exec(), blender::ed::sculpt_paint::paint_line_strokes_spacing(), paint_sample_color(), blender::ed::sculpt_paint::paint_space_stroke(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), blender::ed::sculpt_paint::paint_stroke_modal(), blender::ed::sculpt_paint::paint_stroke_new(), paintcurve_delete_point_exec(), paintcurve_new_exec(), paintcurve_point_add(), paintcurve_point_select(), paintcurve_slide_invoke(), paintcurve_undosys_poll(), paintcurve_undosys_step_encode(), palette_color_add_exec(), palette_color_delete_exec(), palette_color_move_exec(), palette_join_exec(), palette_new_exec(), palette_poll(), palette_sort_exec(), project_state_init(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), blender::draw::sculpt_batches_get_ex(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location(), SCULPT_stroke_get_location_ex(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), blender::ed::greasepencil::stroke_trim_execute(), blender::ed::greasepencil::toggle_weight_tool_direction(), blender::ed::greasepencil::toggle_weight_tool_direction_poll(), ui_do_but_COLOR(), and blender::ed::sculpt_paint::visit_active_library_catalogs_catalog_for_search_fn().
Definition at line 371 of file paint.cc.
References ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, GPencil, ToolSettings::imapaint, Invalid, CurvesSculpt::paint, GpPaint::paint, GpSculptPaint::paint, GpVertexPaint::paint, GpWeightPaint::paint, ImagePaintSettings::paint, Sculpt::paint, VPaint::paint, Sculpt, ToolSettings::sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, Texture2D, Texture3D, Scene::toolsettings, Vertex, VertexGPencil, ToolSettings::vpaint, Weight, WeightGPencil, and ToolSettings::wpaint.
Referenced by BKE_paint_init(), blender::ed::sculpt_paint::curves_sculptmode_enter(), blender::ed::sculpt_paint::vwpaint::mode_enter_generic(), blender::ed::sculpt_paint::object_sculpt_mode_enter(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::sculpt_paint::sculpt_curves_stroke_invoke(), blender::ed::greasepencil::sculptmode_toggle_exec(), toolsystem_brush_activate_from_toolref_for_object_paint(), blender::ed::greasepencil::vertexmode_toggle_exec(), and blender::ed::greasepencil::weightmode_toggle_exec().
| std::optional< int > BKE_paint_get_brush_type_from_obmode | ( | const Brush * | brush, |
| const eObjectMode | ob_mode ) |
Definition at line 1280 of file paint.cc.
References Brush::curves_sculpt_brush_type, Brush::gpencil_brush_type, Brush::gpencil_sculpt_brush_type, Brush::gpencil_vertex_brush_type, Brush::gpencil_weight_brush_type, Brush::image_brush_type, 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, OB_MODE_WEIGHT_PAINT, Brush::sculpt_brush_type, Brush::vertex_brush_type, and Brush::weight_brush_type.
Referenced by brush_asset_metadata_ensure().
| std::optional< int > BKE_paint_get_brush_type_from_paintmode | ( | const Brush * | brush, |
| const PaintMode | mode ) |
Definition at line 1308 of file paint.cc.
References Brush::curves_sculpt_brush_type, GPencil, Brush::gpencil_brush_type, Brush::gpencil_sculpt_brush_type, Brush::gpencil_vertex_brush_type, Brush::gpencil_weight_brush_type, Brush::image_brush_type, Invalid, Sculpt, Brush::sculpt_brush_type, SculptCurves, SculptGPencil, SculptGreasePencil, Texture2D, Texture3D, Vertex, Brush::vertex_brush_type, VertexGPencil, Weight, Brush::weight_brush_type, and WeightGPencil.
Referenced by WM_toolsystem_activate_brush_and_tool().
Definition at line 1250 of file paint.cc.
References GPencil, Invalid, offsetof, Sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, Texture2D, Texture3D, Vertex, VertexGPencil, Weight, and WeightGPencil.
| ePaintOverlayControlFlags BKE_paint_get_overlay_flags | ( | ) |
Definition at line 292 of file paint.cc.
References overlay_flags.
Referenced by blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), and blender::ed::sculpt_paint::paint_draw_alpha_overlay().
| const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode | ( | const PaintMode | mode | ) |
Definition at line 408 of file paint.cc.
References GPencil, Invalid, rna_enum_brush_curves_sculpt_brush_type_items, rna_enum_brush_gpencil_sculpt_types_items, rna_enum_brush_gpencil_types_items, rna_enum_brush_gpencil_vertex_types_items, rna_enum_brush_gpencil_weight_types_items, rna_enum_brush_image_brush_type_items, rna_enum_brush_sculpt_brush_type_items, rna_enum_brush_vertex_brush_type_items, rna_enum_brush_weight_brush_type_items, Sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, Texture2D, Texture3D, Vertex, VertexGPencil, Weight, and WeightGPencil.
Referenced by brush_type_identifier_get().
| void BKE_paint_init | ( | Main * | bmain, |
| Scene * | sce, | ||
| PaintMode | mode, | ||
| const uchar | col[3], | ||
| bool | ensure_brushes = true ) |
| ensure_brushes | Call BKE_paint_brushes_ensure(). |
Definition at line 1779 of file paint.cc.
References UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_paint_brushes_ensure(), BKE_paint_cavity_curve_preset(), BKE_paint_ensure_from_paintmode(), BKE_paint_get_active_from_paintmode(), Paint::cavity_curve, col, copy_v3_v3_uchar(), CURVE_PRESET_LINE, UnifiedPaintSettings::last_stroke_valid, Paint::paint_cursor_col, Scene::toolsettings, ToolSettings::unified_paint_settings, and zero_v3().
Referenced by ED_object_texture_paint_mode_enter_ex(), ED_space_image_paint_update(), blender::ed::sculpt_paint::vwpaint::mode_enter_generic(), blender::ed::sculpt_paint::object_sculpt_mode_enter(), blender::ed::greasepencil::paintmode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), and blender::ed::greasepencil::weightmode_toggle_exec().
| void BKE_paint_invalidate_cursor_overlay | ( | Scene * | scene, |
| ViewLayer * | view_layer, | ||
| CurveMapping * | curve ) |
Definition at line 273 of file paint.cc.
References BKE_paint_brush(), BKE_paint_get_active(), Brush::curve, overlay_flags, and PAINT_OVERLAY_INVALID_CURVE.
Referenced by brush_curve_preset_exec(), and ui_do_but_CURVE().
| void BKE_paint_invalidate_overlay_all | ( | ) |
Definition at line 286 of file paint.cc.
References overlay_flags, PAINT_OVERLAY_INVALID_CURVE, PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY, and PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY.
Referenced by ED_paint_cursor_start(), and paint_cursor_delete_textures().
Definition at line 253 of file paint.cc.
References BKE_paint_brush(), BKE_paint_get_active(), Brush::mask_mtex, Brush::mtex, overlay_flags, PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY, PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY, MTex::tex, and tex.
Referenced by texture_changed().
| eObjectMode BKE_paint_object_mode_from_paintmode | ( | const PaintMode | mode | ) |
Definition at line 1661 of file paint.cc.
References GPencil, Invalid, OB_MODE_OBJECT, OB_MODE_PAINT_GREASE_PENCIL, OB_MODE_SCULPT, OB_MODE_SCULPT_CURVES, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Sculpt, SculptCurves, SculptGreasePencil, Texture2D, Texture3D, Vertex, and Weight.
Definition at line 1345 of file paint.cc.
References Paint::palette.
Referenced by paint_sample_color().
Definition at line 1350 of file paint.cc.
References id_us_min(), id_us_plus(), and Paint::palette.
Referenced by BKE_gpencil_palette_ensure(), blender::ui::greasepencil::eyedropper_add_palette_color(), paint_sample_color(), and palette_new_exec().
| void BKE_paint_reset_overlay_invalid | ( | ePaintOverlayControlFlags | flag | ) |
Definition at line 315 of file paint.cc.
References flag, and overlay_flags.
Referenced by blender::ed::sculpt_paint::load_tex(), and blender::ed::sculpt_paint::load_tex_cursor().
| bool BKE_paint_select_elem_test | ( | const Object * | ob | ) |
used to check if selection is possible (when we don't care if its face or vert)
Definition at line 1632 of file paint.cc.
References BKE_paint_select_face_test(), BKE_paint_select_grease_pencil_test(), and BKE_paint_select_vert_test().
Referenced by face_vert_reveal_poll(), mask_paint_poll(), view3d_circle_select_exec(), view3d_select_exec(), and view3d_selectable_data().
| bool BKE_paint_select_face_test | ( | const Object * | ob | ) |
Return true when in vertex/weight/texture paint + face-select mode?
Definition at line 1607 of file paint.cc.
References Object::data, ME_EDIT_PAINT_FACE_SEL, Object::mode, OB_MESH, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by BKE_paint_select_elem_test(), facemask_paint_poll(), blender::bke::object_get_datamask(), validate_object_select_id(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), view3d_select_exec(), and viewselected_exec().
| bool BKE_paint_select_grease_pencil_test | ( | const Object * | ob | ) |
Return true when in grease pencil sculpt mode.
Definition at line 1621 of file paint.cc.
References Object::data, Object::mode, OB_GREASE_PENCIL, OB_MODE_SCULPT_GREASE_PENCIL, OB_MODE_VERTEX_GREASE_PENCIL, and Object::type.
Referenced by BKE_paint_select_elem_test(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), and view3d_select_exec().
| bool BKE_paint_select_vert_test | ( | const Object * | ob | ) |
Return true when in vertex/weight paint + vertex-select mode?
Definition at line 1614 of file paint.cc.
References Object::data, ME_EDIT_PAINT_VERT_SEL, Object::mode, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by BKE_paint_select_elem_test(), face_vert_reveal_exec(), vert_paint_poll(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), and view3d_select_exec().
| void BKE_paint_set_overlay_override | ( | eOverlayFlags | flags | ) |
Definition at line 297 of file paint.cc.
References BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_OVERRIDE_MASK, BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE, overlay_flags, PAINT_OVERLAY_OVERRIDE_CURSOR, PAINT_OVERLAY_OVERRIDE_PRIMARY, PAINT_OVERLAY_OVERRIDE_SECONDARY, and PAINT_OVERRIDE_MASK.
Referenced by blender::ed::sculpt_paint::paint_stroke_free(), and blender::ed::sculpt_paint::paint_stroke_new().
Definition at line 1850 of file paint.cc.
References UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, copy_v3_v3(), UnifiedPaintSettings::last_stroke_valid, and mul_v3_v3fl().
Referenced by view3d_orbit_calc_center(), and viewselected_exec().
| bool BKE_paint_use_unified_color | ( | const ToolSettings * | tool_settings, |
| const Paint * | paint ) |
Definition at line 605 of file paint.cc.
References UnifiedPaintSettings::flag, Paint_Runtime::ob_mode, OB_MODE_PAINT_GREASE_PENCIL, Paint::runtime, UNIFIED_PAINT_COLOR, and ToolSettings::unified_paint_settings.
Referenced by BKE_brush_color_get(), BKE_brush_color_set(), BKE_brush_secondary_color_get(), and brush_colors_flip_exec().
Definition at line 506 of file paint.cc.
References BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), GPencil, Invalid, Object::mode, SpaceImage::mode, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL, 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, OB_MODE_WEIGHT_PAINT, Sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, SI_MODE_PAINT, Texture2D, Texture3D, Object::type, Vertex, VertexGPencil, Weight, and WeightGPencil.
Referenced by brush_type_matches_active_tool(), blender::ed::sculpt_paint::get_stroke_operation(), blender::ed::sculpt_paint::grease_pencil_brush_stroke_invoke(), image_undosys_step_encode(), blender::ed::sculpt_paint::paint_brush_stroke_add_step(), blender::ed::sculpt_paint::paint_cursor_context_init(), blender::ed::sculpt_paint::image::ops::paint::paint_exec(), blender::ed::sculpt_paint::paint_line_strokes_spacing(), blender::ed::sculpt_paint::paint_space_stroke(), blender::ed::sculpt_paint::paint_space_stroke_spacing(), blender::ed::sculpt_paint::paint_stroke_curve_end(), blender::ed::sculpt_paint::paint_stroke_modal(), blender::ed::sculpt_paint::paint_stroke_new(), paintcurve_cursor_invoke(), paintcurve_draw_exec(), palette_color_add_exec(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), stencil_control_poll(), ui_apply_but_undo(), blender::ed::sculpt_paint::undo::use_multires_mesh(), and WM_toolsystem_activate_brush_and_tool().
Definition at line 565 of file paint.cc.
References CTX_MODE_PAINT_GPENCIL_LEGACY, CTX_MODE_PAINT_GREASE_PENCIL, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT, CTX_MODE_SCULPT, CTX_MODE_SCULPT_CURVES, CTX_MODE_SCULPT_GPENCIL_LEGACY, CTX_MODE_SCULPT_GREASE_PENCIL, CTX_MODE_VERTEX_GPENCIL_LEGACY, CTX_MODE_VERTEX_GREASE_PENCIL, CTX_MODE_WEIGHT_GPENCIL_LEGACY, CTX_MODE_WEIGHT_GREASE_PENCIL, GPencil, Invalid, bToolRef::mode, Sculpt, SculptCurves, SculptGPencil, SculptGreasePencil, SI_MODE_PAINT, SPACE_IMAGE, bToolRef::space_type, SPACE_VIEW3D, Texture2D, Texture3D, Vertex, VertexGPencil, Weight, and WeightGPencil.
Referenced by brush_type_matches_active_tool(), and toolsystem_brush_activate_from_toolref_for_object_paint().
Definition at line 1386 of file paint.cc.
References BKE_id_new(), and ID_PAL.
Referenced by BKE_gpencil_palette_ensure(), BKE_palette_from_hash(), blender::ui::greasepencil::eyedropper_add_palette_color(), paint_sample_color(), and palette_new_exec().
| void BKE_palette_clear | ( | Palette * | palette | ) |
Definition at line 1380 of file paint.cc.
References Palette::active_color, BLI_freelistN(), and Palette::colors.
| PaletteColor * BKE_palette_color_add | ( | Palette * | palette | ) |
Definition at line 1392 of file paint.cc.
References BLI_addtail(), color, and Palette::colors.
Referenced by BKE_gpencil_palette_ensure(), BKE_palette_from_hash(), blender::ui::greasepencil::eyedropper_add_palette_color(), paint_sample_color(), palette_color_add_exec(), palette_join_exec(), and palette_sort_exec().
| void BKE_palette_color_remove | ( | Palette * | palette, |
| PaletteColor * | color ) |
Remove color from palette. Must be certain color is inside the palette!
Definition at line 1364 of file paint.cc.
References Palette::active_color, BLI_listbase_count_at_most(), BLI_listbase_is_empty(), BLI_remlink(), Palette::colors, and MEM_freeN().
Referenced by palette_color_delete_exec(), palette_join_exec(), palette_sort_exec(), and ui_do_but_COLOR().
| bool BKE_palette_from_hash | ( | Main * | bmain, |
| GHash * | color_table, | ||
| const char * | name, | ||
| const bool | linear ) |
Definition at line 1544 of file paint.cc.
References b, BKE_palette_add(), BKE_palette_color_add(), BKE_palette_sort_hsv(), BLI_ghash_len(), BLI_ghashIterator_getValue(), col, copy_v3_v3(), cpack_to_rgb(), GHASH_ITER, tPaletteColorHSV::h, linearrgb_to_srgb_v3_v3(), MEM_calloc_arrayN, MEM_SAFE_FREE, POINTER_AS_INT, PaletteColor::rgb, tPaletteColorHSV::rgb, rgb_to_hsv(), tPaletteColorHSV::s, tPaletteColorHSV::v, and v.
Referenced by palette_extract_img_exec().
| bool BKE_palette_is_empty | ( | const Palette * | palette | ) |
Definition at line 1399 of file paint.cc.
References BLI_listbase_is_empty(), and Palette::colors.
| void BKE_palette_sort_hsv | ( | tPaletteColorHSV * | color_array, |
| const int | totcol ) |
Definition at line 1520 of file paint.cc.
References palettecolor_compare_hsv().
Referenced by BKE_palette_from_hash(), and palette_sort_exec().
| void BKE_palette_sort_luminance | ( | tPaletteColorHSV * | color_array, |
| const int | totcol ) |
Definition at line 1538 of file paint.cc.
References palettecolor_compare_luminance().
Referenced by palette_sort_exec().
| void BKE_palette_sort_svh | ( | tPaletteColorHSV * | color_array, |
| const int | totcol ) |
Definition at line 1526 of file paint.cc.
References palettecolor_compare_svh().
Referenced by palette_sort_exec().
| void BKE_palette_sort_vhs | ( | tPaletteColorHSV * | color_array, |
| const int | totcol ) |
Definition at line 1532 of file paint.cc.
References palettecolor_compare_vhs().
Referenced by palette_sort_exec().
| void BKE_sculpt_color_layer_create_if_needed | ( | Object * | object | ) |
Create new color layer on object if it doesn't have one and if experimental feature set has sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise.
Definition at line 2577 of file paint.cc.
References Mesh::active_color_attribute, BKE_attribute_calc_unique_name(), BKE_color_attribute_supported(), BKE_id_attributes_active_color_set(), BKE_id_attributes_default_color_set(), BKE_mesh_tessface_clear(), BKE_object_get_original_mesh(), CD_PROP_COLOR, DEG_id_tag_update(), AttributeOwner::from_id(), Mesh::id, ID_RECALC_GEOMETRY_ALL_MODES, and unique_name().
Referenced by brush_stroke_init(), blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), and blender::ed::sculpt_paint::expand::sculpt_expand_invoke().
| void BKE_sculpt_mask_layers_ensure | ( | Depsgraph * | depsgraph, |
| Main * | bmain, | ||
| Object * | ob, | ||
| MultiresModifierData * | mmd ) |
Ensures a mask layer exists. If depsgraph and bmain are non-null, a mask doesn't exist and the object has a multi-resolution modifier then the scene depsgraph will be evaluated to update the runtime subdivision data.
Definition at line 2610 of file paint.cc.
References BKE_ccg_gridsize(), BKE_scene_graph_evaluated_ensure(), CD_GRID_PAINT_MASK, CD_SET_DEFAULT, CustomData_add_layer(), CustomData_has_layer(), GridPaintMask::data, Object::data, DEG_id_tag_update(), depsgraph, float, Object::id, ID_RECALC_GEOMETRY, GridPaintMask::level, max_ii(), MEM_callocN, next, MultiresModifierData::sculptlvl, and blender::Span< T >::slice().
Referenced by blender::ed::sculpt_paint::mask::fill_mask_grids(), geometry_extract_apply(), blender::ed::sculpt_paint::mask::init_mask_grids(), blender::ed::sculpt_paint::mask::init_operation(), blender::ed::sculpt_paint::mask::invert_mask_grids(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::object::modifier_add(), blender::ed::object::multires_subdivide_exec(), paint_mask_slice_exec(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), and blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec().
| MultiresModifierData * BKE_sculpt_multires_active | ( | const Scene * | scene, |
| Object * | ob ) |
Sculpt mode handles multi-res differently from regular meshes, but only if it's the last modifier on the stack and it is not on the first level.
Definition at line 2316 of file paint.cc.
References sculpt_multires_modifier_get().
Referenced by blender::ed::sculpt_paint::mask::fill_mask_grids(), blender::ed::sculpt_paint::mask::init_mask_grids(), blender::ed::sculpt_paint::mask::init_operation(), blender::ed::sculpt_paint::mask::invert_mask_grids(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::bke::mesh_calc_modifiers(), blender::ed::sculpt_paint::object_sculpt_mode_enter(), blender::ed::sculpt_paint::object_sculpt_mode_exit(), blender::ed::sculpt_paint::undo::restore_list(), blender::ed::sculpt_paint::sculpt_brush_stroke_invoke(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), and sculpt_modifiers_active().
Definition at line 2747 of file paint.cc.
References BKE_subdiv_ccg_grid_hidden_ensure(), BKE_subdiv_ccg_grid_hidden_free(), blender::VArrayCommon< T >::get_internal_single(), and blender::VArrayCommon< T >::is_single().
Referenced by blender::bke::build_pbvh_from_ccg(), and blender::ed::sculpt_paint::hide::sync_all_from_faces().
Definition at line 2678 of file paint.cc.
References Sculpt::automasking_cavity_curve, Sculpt::automasking_cavity_curve_op, Sculpt::automasking_start_normal_falloff, Sculpt::automasking_start_normal_limit, Sculpt::automasking_view_normal_falloff, Sculpt::automasking_view_normal_limit, BKE_paint_brushes_ensure(), BKE_paint_ensure(), BKE_sculpt_check_cavity_curves(), Sculpt::constant_detail, Sculpt::detail_percent, Sculpt::detail_size, DNA_struct_default_get, Sculpt::paint, and Paint::tile_offset.
Referenced by blender::ed::sculpt_paint::init_sculpt_mode_session(), and blender::ed::sculpt_paint::vwpaint::init_session().
| void BKE_sculpt_update_object_after_eval | ( | Depsgraph * | depsgraph, |
| Object * | ob_eval ) |
Definition at line 2568 of file paint.cc.
References DEG_get_original_object(), depsgraph, and sculpt_update_object().
Referenced by blender::bke::mesh_build_data().
| void BKE_sculpt_update_object_before_eval | ( | Object * | ob_eval | ) |
Definition at line 2509 of file paint.cc.
References BKE_pbvh_node_mark_update(), BKE_sculptsession_free_deformMats(), BKE_sculptsession_free_pbvh(), BKE_sculptsession_free_vwpaint_data(), SculptSession::building_vp_handle, SculptSession::cache, DEG_get_original_object(), SculptSession::expand_cache, SculptSession::filter_cache, blender::bke::pbvh::Grids, blender::bke::pbvh::Tree::nodes(), Object::sculpt, blender::bke::pbvh::Tree::tag_positions_changed(), blender::bke::pbvh::Tree::type(), and blender::bke::pbvh::update_normals_from_eval().
Referenced by blender::bke::mesh_data_update().
| void BKE_sculpt_update_object_for_edit | ( | Depsgraph * | depsgraph, |
| Object * | ob_orig, | ||
| bool | is_paint_tool ) |
Definition at line 2601 of file paint.cc.
References BLI_assert, DEG_get_evaluated_object(), DEG_get_original_object(), depsgraph, and sculpt_update_object().
Referenced by blender::ed::sculpt_paint::undo::bmesh_restore(), brush_stroke_init(), blender::ed::sculpt_paint::face_set::change_visibility_exec(), blender::ed::sculpt_paint::face_set::create_op_exec(), blender::ed::sculpt_paint::face_set::edit_op_init(), blender::ed::sculpt_paint::face_set::edit_op_invoke(), blender::ed::sculpt_paint::geometry_preview_lines_update(), blender::ed::sculpt_paint::face_set::gesture_begin(), blender::ed::sculpt_paint::mask::gesture_begin(), blender::ed::sculpt_paint::project::gesture_begin(), blender::ed::sculpt_paint::trim::gesture_begin(), blender::ed::sculpt_paint::face_set::init_op_exec(), blender::ed::sculpt_paint::init_sculpt_mode_session(), blender::ed::sculpt_paint::vwpaint::init_session(), blender::ed::sculpt_paint::vwpaint::init_stroke(), blender::ed::sculpt_paint::init_transform(), blender::ed::sculpt_paint::mask::mask_by_color_invoke(), blender::ed::sculpt_paint::mask::mask_flood_fill_exec(), blender::ed::sculpt_paint::mask::mask_from_boundary_exec(), blender::ed::sculpt_paint::mask::mask_from_cavity_exec(), blender::ed::sculpt_paint::paint_cursor_draw_3d_view_brush_cursor_inactive(), blender::ed::sculpt_paint::paint_cursor_preview_boundary_data_update(), blender::ed::sculpt_paint::undo::restore_active_shape_key(), blender::ed::sculpt_paint::undo::restore_list(), blender::ed::sculpt_paint::sample_color_invoke(), blender::ed::sculpt_paint::dyntopo::sample_detail_voxel(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_invoke(), blender::ed::sculpt_paint::cloth::sculpt_cloth_filter_modal(), blender::ed::sculpt_paint::color::sculpt_color_filter_init(), blender::ed::sculpt_paint::expand::sculpt_expand_invoke(), blender::ed::sculpt_paint::expand::sculpt_expand_modal(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::mask::sculpt_mask_init_exec(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_modal(), blender::ed::sculpt_paint::filter::sculpt_mesh_filter_start(), SCULPT_stroke_modifiers_check(), blender::ed::sculpt_paint::set_persistent_base_exec(), blender::ed::sculpt_paint::set_pivot_position_exec(), transform_active_color(), blender::ed::sculpt_paint::update_modal_transform(), vertex_color_set_exec(), and blender::ed::object::voxel_remesh_exec().
| void BKE_sculptsession_bm_to_me | ( | Object * | ob, |
| bool | reorder ) |
Definition at line 2088 of file paint.cc.
References DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, Object::sculpt, and sculptsession_bm_to_me_update_data_only().
Referenced by BKE_sculptsession_free(), blender::ed::sculpt_paint::dyntopo::disable(), and ED_editors_flush_edits_for_object_ex().
| void BKE_sculptsession_bm_to_me_for_render | ( | Object * | object | ) |
Definition at line 2123 of file paint.cc.
References BKE_object_free_derived_caches(), and sculptsession_bm_to_me_update_data_only().
Referenced by ED_editors_flush_edits_for_object_ex().
| void BKE_sculptsession_free | ( | Object * | ob | ) |
Definition at line 2145 of file paint.cc.
References BKE_sculptsession_bm_to_me(), BKE_sculptsession_free_pbvh(), SculptSession::bm, BM_mesh_free(), and Object::sculpt.
Referenced by blender::ed::sculpt_paint::init_sculpt_mode_session(), blender::ed::sculpt_paint::vwpaint::mode_enter_generic(), blender::ed::sculpt_paint::vwpaint::mode_exit_generic(), object_free_data(), and blender::ed::sculpt_paint::object_sculpt_mode_exit().
| void BKE_sculptsession_free_deformMats | ( | SculptSession * | ss | ) |
Definition at line 2049 of file paint.cc.
References SculptSession::deform_cos, SculptSession::deform_imats, SculptSession::face_normals_deform, and SculptSession::vert_normals_deform.
Referenced by BKE_sculpt_update_object_before_eval(), blender::ed::sculpt_paint::undo::restore_list(), and sculpt_update_object().
| void BKE_sculptsession_free_pbvh | ( | Object & | object | ) |
Definition at line 2099 of file paint.cc.
References SculptVertexInfo::boundary, SculptSession::clear_active_vert(), blender::bits::BitVector< InlineBufferCapacity, Allocator >::clear_and_shrink(), SculptSession::edge_to_face_indices, SculptSession::edge_to_face_map, SculptSession::edge_to_face_offsets, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, SculptSession::pbvh, SculptSession::preview_verts, SculptSession::topology_island_cache, SculptSession::vert_to_edge_indices, SculptSession::vert_to_edge_map, SculptSession::vert_to_edge_offsets, and SculptSession::vertex_info.
Referenced by BKE_sculpt_update_object_before_eval(), BKE_sculptsession_free(), blender::ed::sculpt_paint::undo::bmesh_enable(), blender::ed::sculpt_paint::undo::bmesh_restore_generic(), blender::ed::sculpt_paint::dyntopo::disable(), blender::ed::sculpt_paint::face_set::edit_modify_geometry(), blender::ed::sculpt_paint::dyntopo::enable_ex(), blender::ed::sculpt_paint::trim::gesture_end(), multires_force_sculpt_rebuild(), blender::ed::sculpt_paint::optimize_exec(), paint_mask_slice_exec(), blender::ed::object::quadriflow_start_job(), blender::ed::sculpt_paint::undo::restore_geometry(), blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec(), blender::ed::geometry::store_result_geometry(), blender::ed::sculpt_paint::symmetrize_exec(), and blender::ed::object::voxel_remesh_exec().
| void BKE_sculptsession_free_vwpaint_data | ( | SculptSession * | ss | ) |
Definition at line 2057 of file paint.cc.
References SculptSession::alpha_weight, BKE_defvert_array_free_elems(), blender::Array< T, InlineBufferCapacity, Allocator >::data(), SculptSession::dvert_prev, blender::Array< T, InlineBufferCapacity, Allocator >::is_empty(), MEM_SAFE_FREE, SculptSession::mode, SculptSession::mode_type, OB_MODE_WEIGHT_PAINT, blender::Array< T, InlineBufferCapacity, Allocator >::size(), and SculptSession::wpaint.
Referenced by BKE_sculpt_update_object_before_eval(), and SculptSession::~SculptSession().
| bool BKE_sculptsession_use_pbvh_draw | ( | const Object * | ob, |
| const RegionView3D * | rv3d ) |
Test if blender::bke::pbvh::Tree can be used directly for drawing, which is faster than drawing the mesh and all updates that come with it.
Definition at line 2862 of file paint.cc.
References SculptSession::deform_modifiers_active, blender::bke::pbvh::Mesh, SculptSession::mode_type, OB_MODE_SCULPT, blender::bke::object::pbvh_get(), Object::sculpt, SculptSession::shapekey_active, blender::bke::pbvh::Tree::type(), and RegionView3D::view_render.
Referenced by basic_cache_populate(), blender::ed::sculpt_paint::flush_update_done(), blender::ed::sculpt_paint::flush_update_step(), blender::draw::overlay::Sculpts::mesh_sync(), blender::draw::overlay::Facing::object_sync(), blender::draw::overlay::Fade::object_sync(), blender::draw::overlay::ModeTransfer::object_sync(), blender::draw::overlay::Prepass::object_sync(), blender::workbench::ObjectState::ObjectState(), OVERLAY_facing_cache_populate(), OVERLAY_fade_cache_populate(), OVERLAY_mode_transfer_cache_populate(), OVERLAY_sculpt_cache_populate(), OVERLAY_wireframe_cache_populate(), blender::ed::sculpt_paint::undo::restore_list(), SCULPT_stroke_modifiers_check(), SCULPT_tag_update_overlays(), blender::eevee::SyncModule::sync_sculpt(), and blender::ed::sculpt_paint::hide::tag_update_visibility().
|
static |
Definition at line 2725 of file paint.cc.
References OB_SHAPE_LOCK.
Referenced by blender::bke::build_pbvh_from_regular_mesh().
|
static |
Definition at line 773 of file paint.cc.
References AssetWeakReference::asset_library_identifier, AssetWeakReference::asset_library_type, BLI_sprintfN(), paint_brush_essentials_asset_file_name_from_obmode(), and AssetWeakReference::relative_asset_identifier.
Referenced by BKE_paint_brush_from_essentials(), BKE_paint_brush_type_default_reference(), and BKE_paint_eraser_brush_from_essentials().
|
static |
Definition at line 757 of file paint.cc.
References AssetWeakReference::asset_library_identifier, AssetWeakReference::asset_library_type, BLI_sprintfN(), paint_brush_essentials_asset_file_name_from_obmode(), and AssetWeakReference::relative_asset_identifier.
Referenced by paint_brush_set_essentials_reference(), and paint_eraser_brush_set_essentials_reference().
|
static |
Definition at line 823 of file paint.cc.
References BLI_assert_unreachable, CURVES_SCULPT_BRUSH_TYPE_ADD, CURVES_SCULPT_BRUSH_TYPE_DELETE, CURVES_SCULPT_BRUSH_TYPE_DENSITY, CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT, GPAINT_BRUSH_TYPE_DRAW, GPAINT_BRUSH_TYPE_ERASE, GPAINT_BRUSH_TYPE_FILL, GPAINT_BRUSH_TYPE_TINT, GPSCULPT_BRUSH_TYPE_CLONE, GPVERTEX_BRUSH_TYPE_AVERAGE, GPVERTEX_BRUSH_TYPE_BLUR, GPVERTEX_BRUSH_TYPE_DRAW, GPVERTEX_BRUSH_TYPE_REPLACE, GPVERTEX_BRUSH_TYPE_SMEAR, GPVERTEX_BRUSH_TYPE_TINT, GPWEIGHT_BRUSH_TYPE_AVERAGE, GPWEIGHT_BRUSH_TYPE_BLUR, GPWEIGHT_BRUSH_TYPE_DRAW, GPWEIGHT_BRUSH_TYPE_SMEAR, IMAGE_PAINT_BRUSH_TYPE_CLONE, IMAGE_PAINT_BRUSH_TYPE_DRAW, IMAGE_PAINT_BRUSH_TYPE_FILL, IMAGE_PAINT_BRUSH_TYPE_MASK, IMAGE_PAINT_BRUSH_TYPE_SMEAR, IMAGE_PAINT_BRUSH_TYPE_SOFTEN, 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, OB_MODE_WEIGHT_PAINT, SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER, SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR, SCULPT_BRUSH_TYPE_DRAW_FACE_SETS, SCULPT_BRUSH_TYPE_MASK, SCULPT_BRUSH_TYPE_PAINT, SCULPT_BRUSH_TYPE_SIMPLIFY, VPAINT_BRUSH_TYPE_AVERAGE, VPAINT_BRUSH_TYPE_BLUR, VPAINT_BRUSH_TYPE_DRAW, VPAINT_BRUSH_TYPE_SMEAR, WPAINT_BRUSH_TYPE_AVERAGE, WPAINT_BRUSH_TYPE_BLUR, WPAINT_BRUSH_TYPE_DRAW, and WPAINT_BRUSH_TYPE_SMEAR.
Referenced by BKE_paint_brush_type_default_reference(), and paint_brush_set_default_reference().
|
static |
Definition at line 731 of file paint.cc.
References 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.
Referenced by paint_brush_asset_reference_from_essentials(), and paint_brush_asset_reference_ptr_from_essentials().
|
static |
Definition at line 1043 of file paint.cc.
References blender::StringRefNull::c_str(), Paint_Runtime::initialized, blender::StringRefBase::is_empty(), Paint_Runtime::ob_mode, paint_brush_default_essentials_name_get(), paint_brush_set_essentials_reference(), paint_eraser_brush_set_essentials_reference(), and Paint::runtime.
Referenced by BKE_paint_brush_set_default(), BKE_paint_brushes_set_default_references(), and BKE_paint_eraser_brush_set_default().
|
static |
Definition at line 801 of file paint.cc.
References BLI_assert, Paint::brush, Paint::brush_asset_reference, Paint_Runtime::initialized, Paint_Runtime::ob_mode, paint_brush_asset_reference_ptr_from_essentials(), and Paint::runtime.
Referenced by BKE_paint_brush_set_essentials(), and paint_brush_set_default_reference().
After changing Paint.brush_asset_reference, call this to activate the matching brush, importing it if necessary. Has no effect if Paint.brush is set already.
Definition at line 619 of file paint.cc.
References blender::bke::asset_edit_id_from_weak_reference(), blender::bke::asset_edit_id_is_editable(), BLI_assert, Paint::brush, Paint::brush_asset_reference, Brush::id, ID_BR, Main::is_locked_for_linking, Brush::ob_mode, Paint_Runtime::ob_mode, and Paint::runtime.
Referenced by BKE_paint_brush_set_default(), BKE_paint_brush_set_essentials(), and BKE_paint_brushes_ensure().
| bool paint_calculate_rake_rotation | ( | UnifiedPaintSettings & | ups, |
| const Brush & | brush, | ||
| const float | mouse_pos[2], | ||
| const PaintMode | paint_mode, | ||
| bool | stroke_has_started ) |
Definition at line 2005 of file paint.cc.
References atan2f, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, copy_v2_v2(), float, UnifiedPaintSettings::last_rake, UnifiedPaintSettings::last_rake_angle, len_squared_v2(), M_PI, min_ff(), paint_rake_rotation_active(), paint_rake_rotation_spacing(), paint_update_brush_rake_rotation(), and sub_v2_v2v2().
Referenced by blender::ed::sculpt_paint::paint_brush_update(), blender::ed::sculpt_paint::paint_cursor_update_rake_rotation(), and blender::ed::sculpt_paint::paint_stroke_modal().
|
static |
Definition at line 207 of file paint.cc.
References BLO_read_struct_array, PaintCurve::points, and PaintCurve::tot_points.
|
static |
Definition at line 197 of file paint.cc.
References BKE_id_blend_write(), BLO_write_id_struct, BLO_write_struct_array, PaintCurve::id, PaintCurve::points, and PaintCurve::tot_points.
|
static |
Definition at line 174 of file paint.cc.
References MEM_dupallocN, PaintCurve::points, and PaintCurve::tot_points.
|
static |
Definition at line 189 of file paint.cc.
References MEM_SAFE_FREE, PaintCurve::points, and PaintCurve::tot_points.
|
static |
Definition at line 812 of file paint.cc.
References BLI_assert, Paint::eraser_brush, Paint::eraser_brush_asset_reference, Paint_Runtime::initialized, Paint_Runtime::ob_mode, paint_brush_asset_reference_ptr_from_essentials(), and Paint::runtime.
Referenced by BKE_paint_eraser_brush_set_essentials(), and paint_brush_set_default_reference().
Definition at line 1125 of file paint.cc.
References blender::bke::asset_edit_id_from_weak_reference(), blender::bke::asset_edit_id_is_editable(), BLI_assert, Paint::eraser_brush, Paint::eraser_brush_asset_reference, Brush::id, ID_BR, Main::is_locked_for_linking, Brush::ob_mode, Paint_Runtime::ob_mode, and Paint::runtime.
Referenced by BKE_paint_brushes_ensure(), BKE_paint_eraser_brush_set_default(), and BKE_paint_eraser_brush_set_essentials().
| float paint_grid_paint_mask | ( | const GridPaintMask * | gpm, |
| uint | level, | ||
| uint | x, | ||
| uint | y ) |
Definition at line 1966 of file paint.cc.
References BKE_ccg_factor(), BKE_ccg_gridsize(), GridPaintMask::data, and GridPaintMask::level.
Referenced by multires_disp_run_cb(), and multires_grid_paint_mask_downsample().
| bool paint_is_bmesh_face_hidden | ( | const BMFace * | f | ) |
Return true if all vertices in the face are visible, false otherwise.
Definition at line 1951 of file paint.cc.
References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_FACE_FIRST_LOOP, BMLoop::next, and BMLoop::v.
Referenced by blender::ed::sculpt_paint::hide::partialvis_update_bmesh_faces().
| bool paint_is_grid_face_hidden | ( | blender::BoundedBitSpan | grid_hidden, |
| int | gridsize, | ||
| int | x, | ||
| int | y ) |
Returns whether any of the corners of the grid face whose inner corner is at (x, y) are hidden.
Definition at line 1940 of file paint.cc.
References CCG_grid_xy_to_index().
Referenced by blender::bke::pbvh::count_grid_quads(), blender::draw::pbvh::create_lines_index_grids(), blender::draw::pbvh::create_lines_index_grids_flat_layout(), blender::draw::pbvh::create_tri_index_grids(), blender::draw::pbvh::create_tri_index_grids_flat_layout(), blender::bke::pbvh::node_raycast_grids(), and blender::bke::pbvh::pbvh_grids_node_nearest_to_ray().
Definition at line 1999 of file paint.cc.
References BKE_brush_has_cube_tip(), Brush::mask_mtex, Brush::mtex, and paint_rake_rotation_active().
|
static |
Definition at line 1994 of file paint.cc.
References MTex::brush_angle_mode, MTEX_ANGLE_RAKE, and MTex::tex.
Referenced by paint_calculate_rake_rotation(), and paint_rake_rotation_active().
|
static |
Definition at line 1975 of file paint.cc.
References Brush::sculpt_brush_type, and SCULPT_BRUSH_TYPE_CLAY_STRIPS.
Referenced by paint_calculate_rake_rotation().
|
static |
Definition at line 1214 of file paint.cc.
References BLI_assert_unreachable, ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, Paint_Runtime::initialized, Paint_Runtime::ob_mode, 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, OB_MODE_WEIGHT_PAINT, CurvesSculpt::paint, GpPaint::paint, GpSculptPaint::paint, GpVertexPaint::paint, GpWeightPaint::paint, ImagePaintSettings::paint, Sculpt::paint, VPaint::paint, Paint::runtime, ToolSettings::sculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_blend_read_data(), and BKE_paint_ensure().
| void paint_update_brush_rake_rotation | ( | UnifiedPaintSettings & | ups, |
| const Brush & | brush, | ||
| float | rotation ) |
Definition at line 1980 of file paint.cc.
References MTex::brush_angle_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, Brush::mask_mtex, and MTEX_ANGLE_RAKE.
Referenced by paint_calculate_rake_rotation(), and blender::ed::sculpt_paint::paint_stroke_curve_end().
|
static |
Definition at line 128 of file paint.cc.
References BLO_read_struct_list, and Palette::colors.
|
static |
Definition at line 118 of file paint.cc.
References BKE_id_blend_write(), BLO_write_id_struct, BLO_write_struct_list, Palette::colors, and Palette::id.
|
static |
Definition at line 99 of file paint.cc.
References BLI_duplicatelist(), and Palette::colors.
|
static |
Definition at line 111 of file paint.cc.
References BLI_freelistN(), and Palette::colors.
|
static |
Definition at line 89 of file paint.cc.
References BLI_assert, Palette::id, id_fake_user_set(), and MEMCMP_STRUCT_AFTER_IS_ZERO.
|
static |
Definition at line 134 of file paint.cc.
References BKE_lib_id_swap(), and ID::properties.
|
static |
Definition at line 1405 of file paint.cc.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_hsv().
|
static |
Definition at line 1502 of file paint.cc.
References tPaletteColorHSV::rgb.
Referenced by BKE_palette_sort_luminance().
|
static |
Definition at line 1438 of file paint.cc.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_svh().
|
static |
Definition at line 1470 of file paint.cc.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_vhs().
Definition at line 2322 of file paint.cc.
References BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), BKE_sculpt_multires_active(), SculptSession::bm, Object::data, eModifierMode_Realtime, eModifierType_Multires, eModifierType_ShapeKey, eMultiresModifierFlag_UseSculptBaseMesh, MultiresModifierData::flags, Sculpt::flags, Object::mode, ModifierData::next, OB_MODE_SCULPT, OB_SHAPE_LOCK, OnlyDeform, Object::sculpt, SCULPT_ONLY_DEFORM, Object::shapeflag, Object::shapenr, ModifierData::type, and ModifierTypeInfo::type.
Referenced by sculpt_update_object().
|
static |
Definition at line 2263 of file paint.cc.
References BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), SculptSession::bm, CD_MDISPS, CD_SET_DEFAULT, CustomData_add_layer(), CustomData_get_layer(), Object::data, eModifierMode_Realtime, eModifierType_Multires, eMultiresModifierFlag_UseSculptBaseMesh, MultiresModifierData::flags, Object::mode, ModifierData::next, OB_MODE_SCULPT, Object::sculpt, MultiresModifierData::sculptlvl, and ModifierData::type.
Referenced by BKE_sculpt_multires_active(), and sculpt_update_object().
|
static |
Definition at line 2366 of file paint.cc.
References SculptSession::active, BKE_crazyspace_build_sculpt(), BKE_keyblock_from_object(), BKE_object_get_evaluated_mesh_unchecked(), BKE_object_get_mesh_deform_eval(), BKE_object_get_original_mesh(), BKE_paint_canvas_key_get(), BKE_pbvh_mark_rebuild_pixels(), BKE_pbvh_vert_coords_apply(), BKE_sculptsession_free_deformMats(), BKE_texpaint_slots_refresh_object(), BLI_assert, SculptSession::building_vp_handle, Mesh::corners_num, blender::Span< T >::data(), KeyBlock::data, SculptSession::deform_cos, SculptSession::deform_imats, SculptSession::deform_modifiers_active, DEG_get_input_scene(), depsgraph, Mesh::faces_num, blender::math::invert(), SculptSession::last_paint_canvas_key, SculptSession::level, MEM_freeN(), MEM_SAFE_FREE, Object::mode, SculptSession::modifier, SculptSession::multires, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Mesh::runtime, Object::sculpt, sculpt_modifiers_active(), sculpt_multires_modifier_get(), MultiresModifierData::sculptlvl, SculptSession::shapekey_active, STREQ, SculptSession::subdiv_ccg, and Mesh::verts_num.
Referenced by BKE_sculpt_update_object_after_eval(), and BKE_sculpt_update_object_for_edit().
|
static |
Write out the sculpt dynamic-topology BMesh to the Mesh.
Definition at line 2072 of file paint.cc.
References SculptSession::bm, SculptSession::bm_log, BM_log_mesh_elems_reorder(), BM_mesh_bm_to_me(), Object::data, params, and Object::sculpt.
Referenced by BKE_sculptsession_bm_to_me(), and BKE_sculptsession_bm_to_me_for_render().
| IDTypeInfo IDType_ID_PAL |
| IDTypeInfo IDType_ID_PC |
|
static |
Definition at line 251 of file paint.cc.
Referenced by BKE_paint_get_overlay_flags(), BKE_paint_invalidate_cursor_overlay(), BKE_paint_invalidate_overlay_all(), BKE_paint_invalidate_overlay_tex(), BKE_paint_reset_overlay_invalid(), BKE_paint_set_overlay_override(), brush_defaults(), blender::ed::sculpt_paint::load_tex(), and blender::ed::sculpt_paint::load_tex_cursor().
| const uchar PAINT_CURSOR_PAINT_GREASE_PENCIL[3] = {255, 100, 100} |
Definition at line 248 of file paint.cc.
Referenced by blender::ed::greasepencil::paintmode_toggle_exec(), and blender::ed::greasepencil::weightmode_toggle_exec().
| const uchar PAINT_CURSOR_SCULPT[3] = {255, 100, 100} |
Definition at line 243 of file paint.cc.
Referenced by blender::ed::sculpt_paint::object_sculpt_mode_enter().
| const uchar PAINT_CURSOR_SCULPT_CURVES[3] = {255, 100, 100} |
Definition at line 247 of file paint.cc.
Referenced by blender::ed::sculpt_paint::curves_sculptmode_enter().
| const uchar PAINT_CURSOR_SCULPT_GREASE_PENCIL[3] = {255, 100, 100} |
Definition at line 249 of file paint.cc.
Referenced by blender::ed::greasepencil::sculptmode_toggle_exec().
| const uchar PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255} |
Definition at line 246 of file paint.cc.
Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_space_image_paint_update().
| const uchar PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255} |
Definition at line 244 of file paint.cc.
Referenced by blender::ed::sculpt_paint::vwpaint::mode_enter_generic().
| const uchar PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255} |
Definition at line 245 of file paint.cc.
Referenced by blender::ed::sculpt_paint::vwpaint::mode_enter_generic().