Blender V4.3
paint.cc File Reference
#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
 

Functions

static void palette_init_data (ID *id)
 
static void palette_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
 
static void palette_free_data (ID *id)
 
static void palette_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void palette_blend_read_data (BlendDataReader *reader, ID *id)
 
static void palette_undo_preserve (BlendLibReader *, ID *id_new, ID *id_old)
 
static void paint_curve_copy_data (Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
 
static void paint_curve_free_data (ID *id)
 
static void paint_curve_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void paint_curve_blend_read_data (BlendDataReader *reader, ID *id)
 
void BKE_paint_invalidate_overlay_tex (Scene *scene, ViewLayer *view_layer, const Tex *tex)
 
void BKE_paint_invalidate_cursor_overlay (Scene *scene, ViewLayer *view_layer, CurveMapping *curve)
 
void BKE_paint_invalidate_overlay_all ()
 
ePaintOverlayControlFlags BKE_paint_get_overlay_flags ()
 
void BKE_paint_set_overlay_override (eOverlayFlags flags)
 
void BKE_paint_reset_overlay_invalid (ePaintOverlayControlFlags flag)
 
bool BKE_paint_ensure_from_paintmode (Scene *sce, PaintMode mode)
 
PaintBKE_paint_get_active_from_paintmode (Scene *sce, PaintMode mode)
 
const EnumPropertyItemBKE_paint_get_tool_enum_from_paintmode (const PaintMode mode)
 
PaintBKE_paint_get_active (Scene *sce, ViewLayer *view_layer)
 
PaintBKE_paint_get_active_from_context (const bContext *C)
 
PaintMode BKE_paintmode_get_active_from_context (const bContext *C)
 
PaintMode BKE_paintmode_get_from_tool (const bToolRef *tref)
 
bool BKE_paint_use_unified_color (const ToolSettings *tool_settings, const Paint *paint)
 
static bool paint_brush_update_from_asset_reference (Main *bmain, Paint *paint)
 
BrushBKE_paint_brush (Paint *paint)
 
const BrushBKE_paint_brush_for_read (const Paint *paint)
 
bool BKE_paint_brush_poll (const Paint *paint, const Brush *brush)
 
static AssetWeakReferenceasset_reference_create_from_brush (Brush *brush)
 
bool BKE_paint_brush_set (Main *bmain, Paint *paint, const AssetWeakReference *brush_asset_reference)
 
bool BKE_paint_brush_set (Paint *paint, Brush *brush)
 
static const char * paint_brush_essentials_asset_file_name_from_obmode (const eObjectMode ob_mode)
 
static AssetWeakReferencepaint_brush_asset_reference_ptr_from_essentials (const char *name, const eObjectMode ob_mode)
 
static std::optional< AssetWeakReferencepaint_brush_asset_reference_from_essentials (const char *name, const eObjectMode ob_mode)
 
BrushBKE_paint_brush_from_essentials (Main *bmain, const eObjectMode ob_mode, const char *name)
 
static void paint_brush_set_essentials_reference (Paint *paint, const char *name)
 
static void paint_eraser_brush_set_essentials_reference (Paint *paint, const char *name)
 
static void paint_brush_default_essentials_name_get (eObjectMode ob_mode, std::optional< int > brush_type, blender::StringRefNull *r_name, blender::StringRefNull *r_eraser_name=nullptr)
 
std::optional< AssetWeakReferenceBKE_paint_brush_type_default_reference (eObjectMode ob_mode, std::optional< int > brush_type)
 
static void paint_brush_set_default_reference (Paint *paint, const bool do_regular=true, const bool do_eraser=true)
 
void BKE_paint_brushes_set_default_references (ToolSettings *ts)
 
bool BKE_paint_brush_set_default (Main *bmain, Paint *paint)
 
bool BKE_paint_brush_set_essentials (Main *bmain, Paint *paint, const char *name)
 
void BKE_paint_brushes_validate (Main *bmain, Paint *paint)
 
static bool paint_eraser_brush_set_from_asset_reference (Main *bmain, Paint *paint)
 
BrushBKE_paint_eraser_brush (Paint *paint)
 
const BrushBKE_paint_eraser_brush_for_read (const Paint *paint)
 
bool BKE_paint_eraser_brush_set (Paint *paint, Brush *brush)
 
BrushBKE_paint_eraser_brush_from_essentials (Main *bmain, eObjectMode ob_mode, const char *name)
 
bool BKE_paint_eraser_brush_set_default (Main *bmain, Paint *paint)
 
bool BKE_paint_eraser_brush_set_essentials (Main *bmain, Paint *paint, const char *name)
 
static void paint_runtime_init (const ToolSettings *ts, Paint *paint)
 
uint BKE_paint_get_brush_type_offset_from_paintmode (const PaintMode mode)
 
std::optional< intBKE_paint_get_brush_type_from_obmode (const Brush *brush, const eObjectMode ob_mode)
 
std::optional< intBKE_paint_get_brush_type_from_paintmode (const Brush *brush, const PaintMode mode)
 
PaintCurveBKE_paint_curve_add (Main *bmain, const char *name)
 
PaletteBKE_paint_palette (Paint *paint)
 
void BKE_paint_palette_set (Paint *paint, Palette *palette)
 
void BKE_paint_curve_clamp_endpoint_add_index (PaintCurve *pc, const int add_index)
 
void BKE_palette_color_remove (Palette *palette, PaletteColor *color)
 
void BKE_palette_clear (Palette *palette)
 
PaletteBKE_palette_add (Main *bmain, const char *name)
 
PaletteColorBKE_palette_color_add (Palette *palette)
 
bool BKE_palette_is_empty (const Palette *palette)
 
static int palettecolor_compare_hsv (const void *a1, const void *a2)
 
static int palettecolor_compare_svh (const void *a1, const void *a2)
 
static int palettecolor_compare_vhs (const void *a1, const void *a2)
 
static int palettecolor_compare_luminance (const void *a1, const void *a2)
 
void BKE_palette_sort_hsv (tPaletteColorHSV *color_array, const int totcol)
 
void BKE_palette_sort_svh (tPaletteColorHSV *color_array, const int totcol)
 
void BKE_palette_sort_vhs (tPaletteColorHSV *color_array, const int totcol)
 
void BKE_palette_sort_luminance (tPaletteColorHSV *color_array, const int totcol)
 
bool BKE_palette_from_hash (Main *bmain, GHash *color_table, const char *name, const bool linear)
 
bool BKE_paint_select_face_test (const Object *ob)
 
bool BKE_paint_select_vert_test (const Object *ob)
 
bool BKE_paint_select_grease_pencil_test (const Object *ob)
 
bool BKE_paint_select_elem_test (const Object *ob)
 
bool BKE_paint_always_hide_test (const Object *ob)
 
void BKE_paint_cavity_curve_preset (Paint *paint, int preset)
 
eObjectMode BKE_paint_object_mode_from_paintmode (const PaintMode mode)
 
bool BKE_paint_ensure (ToolSettings *ts, Paint **r_paint)
 
void BKE_paint_brushes_ensure (Main *bmain, Paint *paint)
 
void BKE_paint_init (Main *bmain, Scene *sce, PaintMode mode, const uchar col[3], const bool ensure_brushes)
 
void BKE_paint_free (Paint *paint)
 
void BKE_paint_copy (const Paint *src, Paint *dst, const int flag)
 
void BKE_paint_stroke_get_average (const Scene *scene, const Object *ob, float stroke[3])
 
void BKE_paint_blend_write (BlendWriter *writer, Paint *paint)
 
void BKE_paint_blend_read_data (BlendDataReader *reader, const Scene *scene, Paint *paint)
 
bool paint_is_grid_face_hidden (const blender::BoundedBitSpan grid_hidden, const int gridsize, const int x, const int y)
 
bool paint_is_bmesh_face_hidden (const BMFace *f)
 
float paint_grid_paint_mask (const GridPaintMask *gpm, uint level, uint x, uint y)
 
static float paint_rake_rotation_spacing (const UnifiedPaintSettings &, const Brush &brush)
 
void paint_update_brush_rake_rotation (UnifiedPaintSettings &ups, const Brush &brush, float rotation)
 
static bool paint_rake_rotation_active (const MTex &mtex)
 
static const bool paint_rake_rotation_active (const Brush &brush, PaintMode paint_mode)
 
bool paint_calculate_rake_rotation (UnifiedPaintSettings &ups, const Brush &brush, const float mouse_pos[2], const PaintMode paint_mode, bool stroke_has_started)
 
void BKE_sculptsession_free_deformMats (SculptSession *ss)
 
void BKE_sculptsession_free_vwpaint_data (SculptSession *ss)
 
static void sculptsession_bm_to_me_update_data_only (Object *ob, bool reorder)
 
void BKE_sculptsession_bm_to_me (Object *ob, bool reorder)
 
void BKE_sculptsession_free_pbvh (Object &object)
 
void BKE_sculptsession_bm_to_me_for_render (Object *object)
 
void BKE_sculptsession_free (Object *ob)
 
static MultiresModifierDatasculpt_multires_modifier_get (const Scene *scene, Object *ob, const bool auto_create_mdisps)
 
MultiresModifierDataBKE_sculpt_multires_active (const Scene *scene, Object *ob)
 
static bool sculpt_modifiers_active (Scene *scene, Sculpt *sd, Object *ob)
 
static void sculpt_update_object (Depsgraph *depsgraph, Object *ob, Object *ob_eval, bool is_paint_tool)
 
void BKE_sculpt_update_object_before_eval (Object *ob_eval)
 
void BKE_sculpt_update_object_after_eval (Depsgraph *depsgraph, Object *ob_eval)
 
void BKE_sculpt_color_layer_create_if_needed (Object *object)
 
void BKE_sculpt_update_object_for_edit (Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
 
void BKE_sculpt_mask_layers_ensure (Depsgraph *depsgraph, Main *bmain, Object *ob, MultiresModifierData *mmd)
 
void BKE_sculpt_toolsettings_data_ensure (Main *bmain, Scene *scene)
 
static bool check_sculpt_object_deformed (Object *object, const bool for_construction)
 
void BKE_sculpt_sync_face_visibility_to_grids (const Mesh &mesh, SubdivCCG &subdiv_ccg)
 
static std::unique_ptr< pbvh::Treeblender::bke::build_pbvh_for_dynamic_topology (Object *ob)
 
static std::unique_ptr< pbvh::Treeblender::bke::build_pbvh_from_regular_mesh (Object *ob, const Mesh *me_eval_deform)
 
static std::unique_ptr< pbvh::Treeblender::bke::build_pbvh_from_ccg (Object *ob, SubdivCCG &subdiv_ccg)
 
pbvh::Treeblender::bke::object::pbvh_ensure (Depsgraph &depsgraph, Object &object)
 
const pbvh::Treeblender::bke::object::pbvh_get (const Object &object)
 
pbvh::Treeblender::bke::object::pbvh_get (Object &object)
 
bool BKE_object_sculpt_use_dyntopo (const Object *object)
 
bool BKE_sculptsession_use_pbvh_draw (const Object *ob, const RegionView3D *rv3d)
 
void BKE_paint_face_set_overlay_color_get (const int face_set, const int seed, uchar r_color[4])
 

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
 

Macro Definition Documentation

◆ GOLDEN_RATIO_CONJUGATE

#define GOLDEN_RATIO_CONJUGATE   0.618033988749895f

Definition at line 2885 of file paint.cc.

Referenced by BKE_paint_face_set_overlay_color_get().

Function Documentation

◆ asset_reference_create_from_brush()

static AssetWeakReference * asset_reference_create_from_brush ( Brush * brush)
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().

◆ BKE_object_sculpt_use_dyntopo()

bool BKE_object_sculpt_use_dyntopo ( const Object * object)

Definition at line 2857 of file paint.cc.

◆ BKE_paint_always_hide_test()

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().

◆ BKE_paint_blend_read_data()

◆ BKE_paint_blend_write()

◆ BKE_paint_brush()

Brush * BKE_paint_brush ( Paint * paint)

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().

◆ BKE_paint_brush_for_read()

const Brush * BKE_paint_brush_for_read ( const Paint * paint)

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().

◆ BKE_paint_brush_from_essentials()

Brush * BKE_paint_brush_from_essentials ( Main * bmain,
const eObjectMode ob_mode,
const char * name )

◆ BKE_paint_brush_poll()

bool BKE_paint_brush_poll ( const Paint * paint,
const Brush * brush )

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().

◆ BKE_paint_brush_set() [1/2]

bool BKE_paint_brush_set ( Main * bmain,
Paint * paint,
const AssetWeakReference * brush_asset_reference )

◆ BKE_paint_brush_set() [2/2]

bool BKE_paint_brush_set ( Paint * paint,
Brush * brush )

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.

Returns
True on success. If brush is already active, this is considered a success (the brush asset reference will still be updated).
Note
WM_toolsystem_activate_brush_and_tool() might be the preferable way to change the active brush. It also lets the tool-system decide if the active tool should be changed given the type of brush, and it updates the "last used brush" for the previous tool. BKE_paint_brush_set() should only be called to force a brush to be active, circumventing the tool system.

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().

◆ BKE_paint_brush_set_default()

◆ BKE_paint_brush_set_essentials()

bool BKE_paint_brush_set_essentials ( Main * bmain,
Paint * paint,
const char * name )

◆ BKE_paint_brush_type_default_reference()

std::optional< AssetWeakReference > BKE_paint_brush_type_default_reference ( eObjectMode ob_mode,
std::optional< int > brush_type )

◆ BKE_paint_brushes_ensure()

void BKE_paint_brushes_ensure ( Main * bmain,
Paint * 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().

◆ BKE_paint_brushes_set_default_references()

◆ BKE_paint_brushes_validate()

◆ BKE_paint_cavity_curve_preset()

◆ BKE_paint_copy()

void BKE_paint_copy ( const Paint * src,
Paint * dst,
int flag )

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().

◆ BKE_paint_curve_add()

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().

◆ BKE_paint_curve_clamp_endpoint_add_index()

void BKE_paint_curve_clamp_endpoint_add_index ( PaintCurve * pc,
const int add_index )

◆ BKE_paint_ensure()

◆ BKE_paint_ensure_from_paintmode()

◆ BKE_paint_eraser_brush()

◆ BKE_paint_eraser_brush_for_read()

const Brush * BKE_paint_eraser_brush_for_read ( const Paint * paint)

Definition at line 1160 of file paint.cc.

References Paint::eraser_brush.

Referenced by BKE_paint_eraser_brush().

◆ BKE_paint_eraser_brush_from_essentials()

Brush * BKE_paint_eraser_brush_from_essentials ( Main * bmain,
eObjectMode ob_mode,
const char * name )

◆ BKE_paint_eraser_brush_set()

◆ BKE_paint_eraser_brush_set_default()

bool BKE_paint_eraser_brush_set_default ( Main * bmain,
Paint * paint )

◆ BKE_paint_eraser_brush_set_essentials()

bool BKE_paint_eraser_brush_set_essentials ( Main * bmain,
Paint * paint,
const char * name )

◆ BKE_paint_face_set_overlay_color_get()

void BKE_paint_face_set_overlay_color_get ( const int face_set,
const int seed,
uchar r_color[4] )

Definition at line 2886 of file paint.cc.

◆ BKE_paint_free()

◆ BKE_paint_get_active()

◆ BKE_paint_get_active_from_context()

Paint * BKE_paint_get_active_from_context ( const bContext * C)

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().

◆ BKE_paint_get_active_from_paintmode()

◆ BKE_paint_get_brush_type_from_obmode()

◆ BKE_paint_get_brush_type_from_paintmode()

◆ BKE_paint_get_brush_type_offset_from_paintmode()

uint BKE_paint_get_brush_type_offset_from_paintmode ( const PaintMode mode)

◆ BKE_paint_get_overlay_flags()

◆ BKE_paint_get_tool_enum_from_paintmode()

◆ BKE_paint_init()

◆ BKE_paint_invalidate_cursor_overlay()

void BKE_paint_invalidate_cursor_overlay ( Scene * scene,
ViewLayer * view_layer,
CurveMapping * curve )

◆ BKE_paint_invalidate_overlay_all()

◆ BKE_paint_invalidate_overlay_tex()

void BKE_paint_invalidate_overlay_tex ( Scene * scene,
ViewLayer * view_layer,
const Tex * tex )

◆ BKE_paint_object_mode_from_paintmode()

◆ BKE_paint_palette()

Palette * BKE_paint_palette ( Paint * paint)

Definition at line 1345 of file paint.cc.

References Paint::palette.

Referenced by paint_sample_color().

◆ BKE_paint_palette_set()

void BKE_paint_palette_set ( Paint * paint,
Palette * palette )

◆ BKE_paint_reset_overlay_invalid()

void BKE_paint_reset_overlay_invalid ( ePaintOverlayControlFlags flag)

◆ BKE_paint_select_elem_test()

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().

◆ BKE_paint_select_face_test()

◆ BKE_paint_select_grease_pencil_test()

bool BKE_paint_select_grease_pencil_test ( const Object * ob)

◆ BKE_paint_select_vert_test()

bool BKE_paint_select_vert_test ( const Object * ob)

◆ BKE_paint_set_overlay_override()

◆ BKE_paint_stroke_get_average()

void BKE_paint_stroke_get_average ( const Scene * scene,
const Object * ob,
float stroke[3] )

◆ BKE_paint_use_unified_color()

◆ BKE_paintmode_get_active_from_context()

PaintMode BKE_paintmode_get_active_from_context ( const bContext * C)

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().

◆ BKE_paintmode_get_from_tool()

◆ BKE_palette_add()

Palette * BKE_palette_add ( Main * bmain,
const char * name )

◆ BKE_palette_clear()

void BKE_palette_clear ( Palette * palette)

Definition at line 1380 of file paint.cc.

References Palette::active_color, BLI_freelistN(), and Palette::colors.

◆ BKE_palette_color_add()

◆ BKE_palette_color_remove()

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().

◆ BKE_palette_from_hash()

◆ BKE_palette_is_empty()

bool BKE_palette_is_empty ( const Palette * palette)

Definition at line 1399 of file paint.cc.

References BLI_listbase_is_empty(), and Palette::colors.

◆ BKE_palette_sort_hsv()

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().

◆ BKE_palette_sort_luminance()

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().

◆ BKE_palette_sort_svh()

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().

◆ BKE_palette_sort_vhs()

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().

◆ BKE_sculpt_color_layer_create_if_needed()

◆ BKE_sculpt_mask_layers_ensure()

◆ BKE_sculpt_multires_active()

◆ BKE_sculpt_sync_face_visibility_to_grids()

◆ BKE_sculpt_toolsettings_data_ensure()

◆ BKE_sculpt_update_object_after_eval()

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().

◆ BKE_sculpt_update_object_before_eval()

◆ BKE_sculpt_update_object_for_edit()

void BKE_sculpt_update_object_for_edit ( Depsgraph * depsgraph,
Object * ob_orig,
bool is_paint_tool )
Warning
Expects a fully evaluated depsgraph.

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().

◆ BKE_sculptsession_bm_to_me()

◆ BKE_sculptsession_bm_to_me_for_render()

void BKE_sculptsession_bm_to_me_for_render ( Object * object)

◆ BKE_sculptsession_free()

◆ BKE_sculptsession_free_deformMats()

◆ BKE_sculptsession_free_pbvh()

◆ BKE_sculptsession_free_vwpaint_data()

◆ BKE_sculptsession_use_pbvh_draw()

◆ check_sculpt_object_deformed()

static bool check_sculpt_object_deformed ( Object * object,
const bool for_construction )
static

Definition at line 2725 of file paint.cc.

References OB_SHAPE_LOCK.

Referenced by blender::bke::build_pbvh_from_regular_mesh().

◆ paint_brush_asset_reference_from_essentials()

◆ paint_brush_asset_reference_ptr_from_essentials()

◆ paint_brush_default_essentials_name_get()

static void paint_brush_default_essentials_name_get ( eObjectMode ob_mode,
std::optional< int > brush_type,
blender::StringRefNull * r_name,
blender::StringRefNull * r_eraser_name = nullptr )
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().

◆ paint_brush_essentials_asset_file_name_from_obmode()

◆ paint_brush_set_default_reference()

◆ paint_brush_set_essentials_reference()

static void paint_brush_set_essentials_reference ( Paint * paint,
const char * name )
static

◆ paint_brush_update_from_asset_reference()

static bool paint_brush_update_from_asset_reference ( Main * bmain,
Paint * paint )
static

◆ paint_calculate_rake_rotation()

◆ paint_curve_blend_read_data()

static void paint_curve_blend_read_data ( BlendDataReader * reader,
ID * id )
static

Definition at line 207 of file paint.cc.

References BLO_read_struct_array, PaintCurve::points, and PaintCurve::tot_points.

◆ paint_curve_blend_write()

static void paint_curve_blend_write ( BlendWriter * writer,
ID * id,
const void * id_address )
static

◆ paint_curve_copy_data()

static void paint_curve_copy_data ( Main * ,
std::optional< Library * > ,
ID * id_dst,
const ID * id_src,
const int  )
static

Definition at line 174 of file paint.cc.

References MEM_dupallocN, PaintCurve::points, and PaintCurve::tot_points.

◆ paint_curve_free_data()

static void paint_curve_free_data ( ID * id)
static

Definition at line 189 of file paint.cc.

References MEM_SAFE_FREE, PaintCurve::points, and PaintCurve::tot_points.

◆ paint_eraser_brush_set_essentials_reference()

static void paint_eraser_brush_set_essentials_reference ( Paint * paint,
const char * name )
static

◆ paint_eraser_brush_set_from_asset_reference()

◆ paint_grid_paint_mask()

float paint_grid_paint_mask ( const GridPaintMask * gpm,
uint level,
uint x,
uint y )

◆ paint_is_bmesh_face_hidden()

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().

◆ paint_is_grid_face_hidden()

◆ paint_rake_rotation_active() [1/2]

static const bool paint_rake_rotation_active ( const Brush & brush,
PaintMode paint_mode )
static

◆ paint_rake_rotation_active() [2/2]

static bool paint_rake_rotation_active ( const MTex & mtex)
static

◆ paint_rake_rotation_spacing()

static float paint_rake_rotation_spacing ( const UnifiedPaintSettings & ,
const Brush & brush )
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().

◆ paint_runtime_init()

◆ paint_update_brush_rake_rotation()

◆ palette_blend_read_data()

static void palette_blend_read_data ( BlendDataReader * reader,
ID * id )
static

Definition at line 128 of file paint.cc.

References BLO_read_struct_list, and Palette::colors.

◆ palette_blend_write()

static void palette_blend_write ( BlendWriter * writer,
ID * id,
const void * id_address )
static

◆ palette_copy_data()

static void palette_copy_data ( Main * ,
std::optional< Library * > ,
ID * id_dst,
const ID * id_src,
const int  )
static

Definition at line 99 of file paint.cc.

References BLI_duplicatelist(), and Palette::colors.

◆ palette_free_data()

static void palette_free_data ( ID * id)
static

Definition at line 111 of file paint.cc.

References BLI_freelistN(), and Palette::colors.

◆ palette_init_data()

static void palette_init_data ( ID * id)
static

Definition at line 89 of file paint.cc.

References BLI_assert, Palette::id, id_fake_user_set(), and MEMCMP_STRUCT_AFTER_IS_ZERO.

◆ palette_undo_preserve()

static void palette_undo_preserve ( BlendLibReader * ,
ID * id_new,
ID * id_old )
static

Definition at line 134 of file paint.cc.

References BKE_lib_id_swap(), and ID::properties.

◆ palettecolor_compare_hsv()

static int palettecolor_compare_hsv ( const void * a1,
const void * a2 )
static

Definition at line 1405 of file paint.cc.

References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.

Referenced by BKE_palette_sort_hsv().

◆ palettecolor_compare_luminance()

static int palettecolor_compare_luminance ( const void * a1,
const void * a2 )
static

Definition at line 1502 of file paint.cc.

References tPaletteColorHSV::rgb.

Referenced by BKE_palette_sort_luminance().

◆ palettecolor_compare_svh()

static int palettecolor_compare_svh ( const void * a1,
const void * a2 )
static

Definition at line 1438 of file paint.cc.

References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.

Referenced by BKE_palette_sort_svh().

◆ palettecolor_compare_vhs()

static int palettecolor_compare_vhs ( const void * a1,
const void * a2 )
static

Definition at line 1470 of file paint.cc.

References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.

Referenced by BKE_palette_sort_vhs().

◆ sculpt_modifiers_active()

◆ sculpt_multires_modifier_get()

◆ sculpt_update_object()

◆ sculptsession_bm_to_me_update_data_only()

static void sculptsession_bm_to_me_update_data_only ( Object * ob,
bool reorder )
static

Variable Documentation

◆ IDType_ID_PAL

IDTypeInfo IDType_ID_PAL
Initial value:
= {
0,
sizeof(Palette),
"Palette",
N_("palettes"),
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_NO_ANIMDATA
Definition BKE_idtype.hh:41
#define BLT_I18NCONTEXT_ID_PALETTE
@ INDEX_ID_PAL
Definition DNA_ID.h:1312
#define FILTER_ID_PAL
Definition DNA_ID.h:1182
@ ID_PAL
struct Palette Palette
static void palette_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
Definition paint.cc:99
static void palette_free_data(ID *id)
Definition paint.cc:111
static void palette_undo_preserve(BlendLibReader *, ID *id_new, ID *id_old)
Definition paint.cc:134
static void palette_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition paint.cc:118
static void palette_init_data(ID *id)
Definition paint.cc:89
static void palette_blend_read_data(BlendDataReader *reader, ID *id)
Definition paint.cc:128
#define N_(msgid)

Definition at line 144 of file paint.cc.

◆ IDType_ID_PC

IDTypeInfo IDType_ID_PC
Initial value:
= {
0,
sizeof(PaintCurve),
"PaintCurve",
N_("paint_curves"),
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
#define BLT_I18NCONTEXT_ID_PAINTCURVE
@ INDEX_ID_PC
Definition DNA_ID.h:1313
#define FILTER_ID_PC
Definition DNA_ID.h:1183
@ ID_PC
struct PaintCurve PaintCurve
static void paint_curve_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
Definition paint.cc:174
static void paint_curve_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition paint.cc:197
static void paint_curve_free_data(ID *id)
Definition paint.cc:189
static void paint_curve_blend_read_data(BlendDataReader *reader, ID *id)
Definition paint.cc:207

Definition at line 213 of file paint.cc.

◆ overlay_flags

◆ PAINT_CURSOR_PAINT_GREASE_PENCIL

const uchar PAINT_CURSOR_PAINT_GREASE_PENCIL[3] = {255, 100, 100}

◆ PAINT_CURSOR_SCULPT

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().

◆ PAINT_CURSOR_SCULPT_CURVES

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().

◆ PAINT_CURSOR_SCULPT_GREASE_PENCIL

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().

◆ PAINT_CURSOR_TEXTURE_PAINT

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().

◆ PAINT_CURSOR_VERTEX_PAINT

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().

◆ PAINT_CURSOR_WEIGHT_PAINT

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().