Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions | Variables
BKE_paint.h File Reference
#include "BLI_bitmap.h"
#include "BLI_utildefines.h"
#include "DNA_brush_enums.h"
#include "DNA_object_enums.h"
#include "BKE_attribute.h"

Go to the source code of this file.

Classes

struct  SculptVertexPaintGeomMap
 
struct  SculptPoseIKChainSegment
 
struct  SculptPoseIKChain
 
struct  SculptClothLengthConstraint
 
struct  SculptClothSimulation
 
struct  SculptPersistentBase
 
struct  SculptVertexInfo
 
struct  SculptBoundaryEditInfo
 
struct  SculptBoundaryPreviewEdge
 
struct  SculptBoundary
 
struct  SculptFakeNeighbors
 
struct  SculptSession
 

Macros

#define PAINT_MODE_HAS_BRUSH(mode)   !ELEM(mode, PAINT_MODE_SCULPT_UV)
 
#define PAINT_OVERRIDE_MASK
 
#define PAINT_SYMM_AREA_DEFAULT   0
 
#define PAINT_SYMM_AREAS   8
 
#define SCULPT_FACE_SET_NONE   0
 

Typedefs

typedef enum ePaintMode ePaintMode
 
typedef enum ePaintOverlayControlFlags ePaintOverlayControlFlags
 
typedef enum ePaintSymmetryAreas ePaintSymmetryAreas
 
typedef struct SculptPoseIKChainSegment SculptPoseIKChainSegment
 
typedef struct SculptPoseIKChain SculptPoseIKChain
 
typedef enum eSculptClothNodeSimState eSculptClothNodeSimState
 
typedef enum eSculptClothConstraintType eSculptClothConstraintType
 
typedef struct SculptClothLengthConstraint SculptClothLengthConstraint
 
typedef struct SculptClothSimulation SculptClothSimulation
 
typedef struct SculptPersistentBase SculptPersistentBase
 
typedef struct SculptVertexInfo SculptVertexInfo
 
typedef struct SculptBoundaryEditInfo SculptBoundaryEditInfo
 
typedef struct SculptBoundaryPreviewEdge SculptBoundaryPreviewEdge
 
typedef struct SculptBoundary SculptBoundary
 
typedef struct SculptFakeNeighbors SculptFakeNeighbors
 
typedef struct SculptSession SculptSession
 

Enumerations

enum  ePaintMode {
  PAINT_MODE_SCULPT = 0 , PAINT_MODE_VERTEX = 1 , PAINT_MODE_WEIGHT = 2 , PAINT_MODE_TEXTURE_3D = 3 ,
  PAINT_MODE_TEXTURE_2D = 4 , PAINT_MODE_SCULPT_UV = 5 , PAINT_MODE_GPENCIL = 6 , PAINT_MODE_VERTEX_GPENCIL = 7 ,
  PAINT_MODE_SCULPT_GPENCIL = 8 , PAINT_MODE_WEIGHT_GPENCIL = 9 , PAINT_MODE_SCULPT_CURVES = 10 , PAINT_MODE_INVALID = 11
}
 
enum  ePaintOverlayControlFlags {
  PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY = 1 , PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY = (1 << 2) , PAINT_OVERLAY_INVALID_CURVE = (1 << 3) , PAINT_OVERLAY_OVERRIDE_CURSOR = (1 << 4) ,
  PAINT_OVERLAY_OVERRIDE_PRIMARY = (1 << 5) , PAINT_OVERLAY_OVERRIDE_SECONDARY = (1 << 6)
}
 
enum  ePaintSymmetryAreas { PAINT_SYMM_AREA_X = (1 << 0) , PAINT_SYMM_AREA_Y = (1 << 1) , PAINT_SYMM_AREA_Z = (1 << 2) }
 
enum  eSculptClothNodeSimState { SCULPT_CLOTH_NODE_UNINITIALIZED , SCULPT_CLOTH_NODE_INACTIVE , SCULPT_CLOTH_NODE_ACTIVE }
 
enum  eSculptClothConstraintType { SCULPT_CLOTH_CONSTRAINT_STRUCTURAL = 0 , SCULPT_CLOTH_CONSTRAINT_DEFORMATION = 1 , SCULPT_CLOTH_CONSTRAINT_SOFTBODY = 2 , SCULPT_CLOTH_CONSTRAINT_PIN = 3 }
 
enum  { SCULPT_MASK_LAYER_CALC_VERT = (1 << 0) , SCULPT_MASK_LAYER_CALC_LOOP = (1 << 1) }
 

Functions

void BKE_paint_invalidate_overlay_tex (struct Scene *scene, struct ViewLayer *view_layer, const struct Tex *tex)
 
void BKE_paint_invalidate_cursor_overlay (struct Scene *scene, struct ViewLayer *view_layer, struct CurveMapping *curve)
 
void BKE_paint_invalidate_overlay_all (void)
 
ePaintOverlayControlFlags BKE_paint_get_overlay_flags (void)
 
void BKE_paint_reset_overlay_invalid (ePaintOverlayControlFlags flag)
 
void BKE_paint_set_overlay_override (enum eOverlayFlags flag)
 
struct PaletteBKE_palette_add (struct Main *bmain, const char *name)
 
struct PaletteColorBKE_palette_color_add (struct Palette *palette)
 
bool BKE_palette_is_empty (const struct Palette *palette)
 
void BKE_palette_color_remove (struct Palette *palette, struct PaletteColor *color)
 
void BKE_palette_clear (struct Palette *palette)
 
void BKE_palette_sort_hsv (struct tPaletteColorHSV *color_array, int totcol)
 
void BKE_palette_sort_svh (struct tPaletteColorHSV *color_array, int totcol)
 
void BKE_palette_sort_vhs (struct tPaletteColorHSV *color_array, int totcol)
 
void BKE_palette_sort_luminance (struct tPaletteColorHSV *color_array, int totcol)
 
bool BKE_palette_from_hash (struct Main *bmain, struct GHash *color_table, const char *name, bool linear)
 
struct PaintCurveBKE_paint_curve_add (struct Main *bmain, const char *name)
 
bool BKE_paint_ensure (struct ToolSettings *ts, struct Paint **r_paint)
 
void BKE_paint_init (struct Main *bmain, struct Scene *sce, ePaintMode mode, const char col[3])
 
void BKE_paint_free (struct Paint *p)
 
void BKE_paint_copy (struct Paint *src, struct Paint *tar, int flag)
 
void BKE_paint_runtime_init (const struct ToolSettings *ts, struct Paint *paint)
 
void BKE_paint_cavity_curve_preset (struct Paint *p, int preset)
 
eObjectMode BKE_paint_object_mode_from_paintmode (ePaintMode mode)
 
bool BKE_paint_ensure_from_paintmode (struct Scene *sce, ePaintMode mode)
 
struct PaintBKE_paint_get_active_from_paintmode (struct Scene *sce, ePaintMode mode)
 
const struct EnumPropertyItemBKE_paint_get_tool_enum_from_paintmode (ePaintMode mode)
 
const char * BKE_paint_get_tool_prop_id_from_paintmode (ePaintMode mode)
 
uint BKE_paint_get_brush_tool_offset_from_paintmode (ePaintMode mode)
 
struct PaintBKE_paint_get_active (struct Scene *sce, struct ViewLayer *view_layer)
 
struct PaintBKE_paint_get_active_from_context (const struct bContext *C)
 
ePaintMode BKE_paintmode_get_active_from_context (const struct bContext *C)
 
ePaintMode BKE_paintmode_get_from_tool (const struct bToolRef *tref)
 
struct BrushBKE_paint_brush (struct Paint *paint)
 
const struct BrushBKE_paint_brush_for_read (const struct Paint *p)
 
void BKE_paint_brush_set (struct Paint *paint, struct Brush *br)
 
struct PaletteBKE_paint_palette (struct Paint *paint)
 
void BKE_paint_palette_set (struct Paint *p, struct Palette *palette)
 
void BKE_paint_curve_set (struct Brush *br, struct PaintCurve *pc)
 
void BKE_paint_curve_clamp_endpoint_add_index (struct PaintCurve *pc, int add_index)
 
bool BKE_paint_select_face_test (struct Object *ob)
 
bool BKE_paint_select_vert_test (struct Object *ob)
 
bool BKE_paint_select_elem_test (struct Object *ob)
 
bool BKE_paint_always_hide_test (struct Object *ob)
 
bool paint_is_face_hidden (const struct MLoopTri *lt, const struct MVert *mvert, const struct MLoop *mloop)
 
bool paint_is_grid_face_hidden (const unsigned int *grid_hidden, int gridsize, int x, int y)
 
bool paint_is_bmesh_face_hidden (struct BMFace *f)
 
float paint_grid_paint_mask (const struct GridPaintMask *gpm, uint level, uint x, uint y)
 
void BKE_paint_face_set_overlay_color_get (int face_set, int seed, uchar r_color[4])
 
bool paint_calculate_rake_rotation (struct UnifiedPaintSettings *ups, struct Brush *brush, const float mouse_pos[2])
 
void paint_update_brush_rake_rotation (struct UnifiedPaintSettings *ups, struct Brush *brush, float rotation)
 
void BKE_paint_stroke_get_average (struct Scene *scene, struct Object *ob, float stroke[3])
 
void BKE_paint_toolslots_init_from_main (struct Main *bmain)
 
void BKE_paint_toolslots_len_ensure (struct Paint *paint, int len)
 
void BKE_paint_toolslots_brush_update_ex (struct Paint *paint, struct Brush *brush)
 
void BKE_paint_toolslots_brush_update (struct Paint *paint)
 
void BKE_paint_toolslots_brush_validate (struct Main *bmain, struct Paint *paint)
 
struct BrushBKE_paint_toolslots_brush_get (struct Paint *paint, int slot_index)
 
void BKE_paint_blend_write (struct BlendWriter *writer, struct Paint *paint)
 
void BKE_paint_blend_read_data (struct BlendDataReader *reader, const struct Scene *scene, struct Paint *paint)
 
void BKE_paint_blend_read_lib (struct BlendLibReader *reader, struct Scene *scene, struct Paint *paint)
 
void BKE_sculptsession_free (struct Object *ob)
 
void BKE_sculptsession_free_deformMats (struct SculptSession *ss)
 
void BKE_sculptsession_free_vwpaint_data (struct SculptSession *ss)
 
void BKE_sculptsession_bm_to_me (struct Object *ob, bool reorder)
 
void BKE_sculptsession_bm_to_me_for_render (struct Object *object)
 
void BKE_sculpt_color_layer_create_if_needed (struct Object *object)
 
void BKE_sculpt_update_object_for_edit (struct Depsgraph *depsgraph, struct Object *ob_orig, bool need_pmap, bool need_mask, bool is_paint_tool)
 
void BKE_sculpt_update_object_before_eval (const struct Scene *scene, struct Object *ob_eval)
 
void BKE_sculpt_update_object_after_eval (struct Depsgraph *depsgraph, struct Object *ob_eval)
 
struct MultiresModifierDataBKE_sculpt_multires_active (const struct Scene *scene, struct Object *ob)
 
int BKE_sculpt_mask_layers_ensure (struct Object *ob, struct MultiresModifierData *mmd)
 
void BKE_sculpt_toolsettings_data_ensure (struct Scene *scene)
 
struct PBVHBKE_sculpt_object_pbvh_ensure (struct Depsgraph *depsgraph, struct Object *ob)
 
void BKE_sculpt_bvh_update_from_ccg (struct PBVH *pbvh, struct SubdivCCG *subdiv_ccg)
 
void BKE_sculpt_sync_face_set_visibility (struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
 
void BKE_sculpt_sync_face_sets_visibility_to_base_mesh (struct Mesh *mesh)
 
void BKE_sculpt_sync_face_sets_visibility_to_grids (struct Mesh *mesh, struct SubdivCCG *subdiv_ccg)
 
void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility (struct Mesh *mesh)
 
void BKE_sculpt_ensure_orig_mesh_data (struct Scene *scene, struct Object *object)
 
bool BKE_sculptsession_use_pbvh_draw (const struct Object *ob, const struct RegionView3D *rv3d)
 
bool BKE_object_attributes_active_color_fill (struct Object *ob, const float fill_color[4], bool only_selected)
 
char * BKE_paint_canvas_key_get (struct PaintModeSettings *settings, struct Object *ob)
 
bool BKE_paint_canvas_image_get (struct PaintModeSettings *settings, struct Object *ob, struct Image **r_image, struct ImageUser **r_image_user)
 
int BKE_paint_canvas_uvmap_layer_index_get (const struct PaintModeSettings *settings, struct Object *ob)
 

Variables

const char PAINT_CURSOR_SCULPT [3]
 
const char PAINT_CURSOR_VERTEX_PAINT [3]
 
const char PAINT_CURSOR_WEIGHT_PAINT [3]
 
const char PAINT_CURSOR_TEXTURE_PAINT [3]
 

Macro Definition Documentation

◆ PAINT_MODE_HAS_BRUSH

#define PAINT_MODE_HAS_BRUSH (   mode)    !ELEM(mode, PAINT_MODE_SCULPT_UV)

Definition at line 89 of file BKE_paint.h.

◆ PAINT_OVERRIDE_MASK

#define PAINT_OVERRIDE_MASK
Value:
PAINT_OVERLAY_OVERRIDE_CURSOR)
@ PAINT_OVERLAY_OVERRIDE_SECONDARY
Definition: BKE_paint.h:98
@ PAINT_OVERLAY_OVERRIDE_PRIMARY
Definition: BKE_paint.h:97

Definition at line 101 of file BKE_paint.h.

◆ PAINT_SYMM_AREA_DEFAULT

#define PAINT_SYMM_AREA_DEFAULT   0

Defines 8 areas resulting of splitting the object space by the XYZ axis planes. This is used to flip or mirror transform values depending on where the vertex is and where the transform operation started to support XYZ symmetry on those operations in a predictable way.

Definition at line 110 of file BKE_paint.h.

◆ PAINT_SYMM_AREAS

#define PAINT_SYMM_AREAS   8

Definition at line 118 of file BKE_paint.h.

◆ SCULPT_FACE_SET_NONE

#define SCULPT_FACE_SET_NONE   0

Definition at line 267 of file BKE_paint.h.

Typedef Documentation

◆ ePaintMode

typedef enum ePaintMode ePaintMode

◆ ePaintOverlayControlFlags

◆ ePaintSymmetryAreas

◆ eSculptClothConstraintType

◆ eSculptClothNodeSimState

◆ SculptBoundary

◆ SculptBoundaryEditInfo

◆ SculptBoundaryPreviewEdge

◆ SculptClothLengthConstraint

◆ SculptClothSimulation

◆ SculptFakeNeighbors

◆ SculptPersistentBase

◆ SculptPoseIKChain

◆ SculptPoseIKChainSegment

Pose Brush IK Chain.

◆ SculptSession

typedef struct SculptSession SculptSession

◆ SculptVertexInfo

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCULPT_MASK_LAYER_CALC_VERT 
SCULPT_MASK_LAYER_CALC_LOOP 

Definition at line 737 of file BKE_paint.h.

◆ ePaintMode

enum ePaintMode
Enumerator
PAINT_MODE_SCULPT 
PAINT_MODE_VERTEX 

Vertex color.

PAINT_MODE_WEIGHT 
PAINT_MODE_TEXTURE_3D 

3D view (projection painting).

PAINT_MODE_TEXTURE_2D 

Image space (2D painting).

PAINT_MODE_SCULPT_UV 
PAINT_MODE_GPENCIL 
PAINT_MODE_VERTEX_GPENCIL 
PAINT_MODE_SCULPT_GPENCIL 
PAINT_MODE_WEIGHT_GPENCIL 
PAINT_MODE_SCULPT_CURVES 

Curves.

PAINT_MODE_INVALID 

Keep last.

Definition at line 67 of file BKE_paint.h.

◆ ePaintOverlayControlFlags

Enumerator
PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY 
PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY 
PAINT_OVERLAY_INVALID_CURVE 
PAINT_OVERLAY_OVERRIDE_CURSOR 
PAINT_OVERLAY_OVERRIDE_PRIMARY 
PAINT_OVERLAY_OVERRIDE_SECONDARY 

Definition at line 92 of file BKE_paint.h.

◆ ePaintSymmetryAreas

Enumerator
PAINT_SYMM_AREA_X 
PAINT_SYMM_AREA_Y 
PAINT_SYMM_AREA_Z 

Definition at line 112 of file BKE_paint.h.

◆ eSculptClothConstraintType

Enumerator
SCULPT_CLOTH_CONSTRAINT_STRUCTURAL 
SCULPT_CLOTH_CONSTRAINT_DEFORMATION 
SCULPT_CLOTH_CONSTRAINT_SOFTBODY 
SCULPT_CLOTH_CONSTRAINT_PIN 

Definition at line 316 of file BKE_paint.h.

◆ eSculptClothNodeSimState

Enumerator
SCULPT_CLOTH_NODE_UNINITIALIZED 
SCULPT_CLOTH_NODE_INACTIVE 
SCULPT_CLOTH_NODE_ACTIVE 

Definition at line 305 of file BKE_paint.h.

Function Documentation

◆ BKE_object_attributes_active_color_fill()

bool BKE_object_attributes_active_color_fill ( struct Object ob,
const float  fill_color[4],
bool  only_selected 
)

Fills the object's active color attribute layer with the fill color.

Parameters
[in]obThe object.
[in]fill_colorThe fill color.
[in]only_selectedLimit the fill to selected faces or vertices.
Returns
#true if successful.

Definition at line 4167 of file paint_vertex.cc.

References paint_object_attributes_active_color_fill_ex().

Referenced by blender::ed::geometry::geometry_color_attribute_add_exec(), and proj_paint_color_attribute_create().

◆ BKE_paint_always_hide_test()

bool BKE_paint_always_hide_test ( struct Object ob)

Checks if face/vertex hiding is always applied in the current mode. Returns true in vertex/weight paint.

Definition at line 999 of file paint.c.

References Object::data, Object::mode, NULL, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.

Referenced by face_vert_reveal_poll().

◆ BKE_paint_blend_read_data()

void BKE_paint_blend_read_data ( struct BlendDataReader reader,
const struct Scene scene,
struct Paint paint 
)

◆ BKE_paint_blend_read_lib()

void BKE_paint_blend_read_lib ( struct BlendLibReader reader,
struct Scene scene,
struct Paint paint 
)

◆ BKE_paint_blend_write()

void BKE_paint_blend_write ( struct BlendWriter writer,
struct Paint paint 
)

◆ BKE_paint_brush()

struct Brush* BKE_paint_brush ( struct Paint paint)

Definition at line 607 of file paint.c.

References BKE_paint_brush_for_read().

Referenced by BKE_paint_init(), brush_add_exec(), brush_add_gpencil_exec(), brush_colors_flip_exec(), brush_curve_preset_exec(), brush_curve_preset_poll(), brush_generic_tool_set(), brush_reset_exec(), brush_scale_size_exec(), brush_strength(), buttons_context_path_brush(), buttons_texture_users_from_context(), calc_sculpt_normal(), calc_sculpt_plane(), cloth_brush_apply_brush_foces(), do_gravity(), do_symmetrical_brush_actions(), dyntopo_detail_size_edit_invoke(), ED_paint_proj_mesh_data_check(), ED_sculpt_update_modal_transform(), gpencil_draw_init(), gpencil_fill_invoke(), gpencil_session_init_fill(), gpencil_stroke_from_buffer(), gpencil_stroke_paintmode_poll_with_tool(), gpencil_stroke_sculptmode_poll_with_tool(), gpencil_stroke_vertexmode_poll_with_tool(), gpencil_stroke_weightmode_poll_with_tool(), HC_relaxation_iteration_uv(), image_paint_brush(), laplacian_relaxation_iteration_uv(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::ed::sculpt_paint::new_selection_paint_operation(), OVERLAY_edit_uv_cache_init(), OVERLAY_edit_uv_init(), paint_2d_new_stroke(), paint_and_tex_color_alpha_intern(), paint_brush_stroke_add_step(), PAINT_brush_tool_poll(), paint_cursor_context_init(), paint_cursor_update_pixel_radius(), paint_draw_smooth_cursor(), paint_line_strokes_spacing(), paint_mesh_restore_co(), paint_proj_new_stroke(), paint_sample_color(), paint_space_stroke(), paint_space_stroke_spacing(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), paint_stroke_modal(), paint_stroke_new(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), paint_weight_gradient_exec(), project_state_init(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), sample_detail_dyntopo(), SCULPT_bmesh_topology_rake(), sculpt_brush_exit_tex(), sculpt_brush_init_tex(), SCULPT_brush_plane_offset_get(), sculpt_brush_stroke_cancel(), sculpt_brush_stroke_init(), sculpt_brush_stroke_invoke(), SCULPT_calc_area_center(), SCULPT_calc_area_normal(), SCULPT_calc_area_normal_and_center(), SCULPT_calc_brush_plane(), SCULPT_cloth_brush_do_simulation_step(), SCULPT_cloth_brush_ensure_nodes_constraints(), sculpt_cloth_ensure_constraints_in_simulation_area(), sculpt_combine_proxies(), SCULPT_cursor_geometry_info_update(), SCULPT_do_boundary_brush(), SCULPT_do_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_cloth_brush(), SCULPT_do_crease_brush(), SCULPT_do_displacement_eraser_brush(), SCULPT_do_displacement_smear_brush(), SCULPT_do_draw_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_draw_sharp_brush(), SCULPT_do_elastic_deform_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_grab_brush(), SCULPT_do_inflate_brush(), SCULPT_do_layer_brush(), SCULPT_do_mask_brush(), SCULPT_do_mask_brush_draw(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_nudge_brush(), SCULPT_do_paint_brush(), SCULPT_do_paint_brush_image(), SCULPT_do_pinch_brush(), SCULPT_do_pose_brush(), SCULPT_do_rotate_brush(), SCULPT_do_scrape_brush(), SCULPT_do_slide_relax_brush(), SCULPT_do_smear_brush(), SCULPT_do_snake_hook_brush(), SCULPT_do_surface_smooth_brush(), SCULPT_do_thumb_brush(), SCULPT_enhance_details_brush(), sculpt_expand_cache_initial_config_set(), sculpt_face_sets_automasking_init(), sculpt_fix_noise_tear(), SCULPT_flush_stroke_deform(), sculpt_gesture_trim_calculate_depth(), sculpt_restore_mesh(), sculpt_sample_color_invoke(), SCULPT_smooth(), sculpt_stroke_done(), SCULPT_stroke_get_location(), sculpt_stroke_test_start(), sculpt_stroke_update_step(), sculpt_tool_name(), SCULPT_topology_automasking_init(), sculpt_update_cache_invariants(), sculpt_update_cache_variants(), smooth_brush_toggle_off(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), texture_get_from_context(), blender::ed::sculpt_paint::image::ops::paint::texture_paint_init(), ui_do_but_COLOR(), update_brush_local_mat(), update_sculpt_normal(), uv_sculpt_stroke_apply(), uv_sculpt_stroke_init(), uv_sculpt_stroke_poll(), vertex_paint_poll_ex(), vpaint_do_symmetrical_brush_actions(), vpaint_stroke_test_start(), vwpaint_update_cache_variants(), weight_paint_poll_ex(), weight_paint_set_exec(), weight_sample_invoke(), wpaint_do_symmetrical_brush_actions(), and wpaint_stroke_update_step().

◆ BKE_paint_brush_for_read()

const struct Brush* BKE_paint_brush_for_read ( const struct Paint p)

◆ BKE_paint_brush_set()

void BKE_paint_brush_set ( struct Paint paint,
struct Brush br 
)

◆ BKE_paint_canvas_image_get()

bool BKE_paint_canvas_image_get ( struct PaintModeSettings settings,
struct Object ob,
struct Image **  r_image,
struct ImageUser **  r_image_user 
)

◆ BKE_paint_canvas_key_get()

char* BKE_paint_canvas_key_get ( struct PaintModeSettings settings,
struct Object ob 
)

Create a key that can be used to compare with previous ones to identify changes. The resulting 'string' is owned by the caller.

Definition at line 107 of file blenkernel/intern/paint_canvas.cc.

References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_paint_canvas_image_get(), BKE_paint_canvas_uvmap_layer_index_get(), BLI_strdup(), image(), LISTBASE_FOREACH, ImageUser::tile, ImBuf::x, and ImBuf::y.

Referenced by sculpt_update_object().

◆ BKE_paint_canvas_uvmap_layer_index_get()

int BKE_paint_canvas_uvmap_layer_index_get ( const struct PaintModeSettings settings,
struct Object ob 
)

◆ BKE_paint_cavity_curve_preset()

void BKE_paint_cavity_curve_preset ( struct Paint p,
int  preset 
)

◆ BKE_paint_copy()

void BKE_paint_copy ( struct Paint src,
struct Paint tar,
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 1167 of file paint.c.

References BKE_curvemapping_copy(), PaintToolSlot::brush, Paint::brush, Paint::cavity_curve, id_us_plus(), LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_dupallocN, NULL, Paint::palette, src, Paint::tool_slots, and Paint::tool_slots_len.

Referenced by BKE_toolsettings_copy().

◆ BKE_paint_curve_add()

struct PaintCurve* BKE_paint_curve_add ( struct Main bmain,
const char *  name 
)

Definition at line 705 of file paint.c.

References BKE_id_new(), and ID_PC.

Referenced by paintcurve_new_exec(), and paintcurve_point_add().

◆ BKE_paint_curve_clamp_endpoint_add_index()

void BKE_paint_curve_clamp_endpoint_add_index ( struct PaintCurve pc,
int  add_index 
)

◆ BKE_paint_curve_set()

void BKE_paint_curve_set ( struct Brush br,
struct PaintCurve pc 
)

Definition at line 728 of file paint.c.

References id_us_min(), id_us_plus(), and Brush::paint_curve.

◆ BKE_paint_ensure()

bool BKE_paint_ensure ( struct ToolSettings ts,
struct Paint **  r_paint 
)

◆ BKE_paint_ensure_from_paintmode()

bool BKE_paint_ensure_from_paintmode ( struct Scene sce,
ePaintMode  mode 
)

◆ BKE_paint_face_set_overlay_color_get()

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

◆ BKE_paint_free()

void BKE_paint_free ( struct Paint p)

◆ BKE_paint_get_active()

struct Paint* BKE_paint_get_active ( struct Scene sce,
struct ViewLayer view_layer 
)

◆ BKE_paint_get_active_from_context()

struct Paint* BKE_paint_get_active_from_context ( const struct bContext C)

◆ BKE_paint_get_active_from_paintmode()

struct Paint* BKE_paint_get_active_from_paintmode ( struct Scene sce,
ePaintMode  mode 
)

◆ BKE_paint_get_brush_tool_offset_from_paintmode()

uint BKE_paint_get_brush_tool_offset_from_paintmode ( ePaintMode  mode)

◆ BKE_paint_get_overlay_flags()

ePaintOverlayControlFlags BKE_paint_get_overlay_flags ( void  )

Definition at line 266 of file paint.c.

References overlay_flags.

Referenced by load_tex(), load_tex_cursor(), and paint_draw_alpha_overlay().

◆ BKE_paint_get_tool_enum_from_paintmode()

const struct EnumPropertyItem* BKE_paint_get_tool_enum_from_paintmode ( ePaintMode  mode)

◆ BKE_paint_get_tool_prop_id_from_paintmode()

const char* BKE_paint_get_tool_prop_id_from_paintmode ( ePaintMode  mode)

◆ BKE_paint_init()

void BKE_paint_init ( struct Main bmain,
struct Scene sce,
ePaintMode  mode,
const char  col[3] 
)

◆ BKE_paint_invalidate_cursor_overlay()

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

◆ BKE_paint_invalidate_overlay_all()

void BKE_paint_invalidate_overlay_all ( void  )

◆ BKE_paint_invalidate_overlay_tex()

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

Referenced by texture_changed().

◆ BKE_paint_object_mode_from_paintmode()

eObjectMode BKE_paint_object_mode_from_paintmode ( ePaintMode  mode)

◆ BKE_paint_palette()

struct Palette* BKE_paint_palette ( struct Paint paint)

Definition at line 714 of file paint.c.

References NULL, and Paint::palette.

Referenced by paint_sample_color().

◆ BKE_paint_palette_set()

void BKE_paint_palette_set ( struct Paint p,
struct Palette palette 
)

◆ BKE_paint_reset_overlay_invalid()

void BKE_paint_reset_overlay_invalid ( ePaintOverlayControlFlags  flag)

Definition at line 289 of file paint.c.

References overlay_flags.

Referenced by load_tex(), and load_tex_cursor().

◆ BKE_paint_runtime_init()

void BKE_paint_runtime_init ( const struct ToolSettings ts,
struct Paint paint 
)

◆ BKE_paint_select_elem_test()

bool BKE_paint_select_elem_test ( struct Object ob)

used to check if selection is possible (when we don't care if its face or vert)

Definition at line 994 of file paint.c.

References BKE_paint_select_face_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()

bool BKE_paint_select_face_test ( struct Object ob)

◆ BKE_paint_select_vert_test()

bool BKE_paint_select_vert_test ( struct Object ob)

◆ BKE_paint_set_overlay_override()

void BKE_paint_set_overlay_override ( enum eOverlayFlags  flag)

◆ BKE_paint_stroke_get_average()

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

◆ BKE_paint_toolslots_brush_get()

struct Brush* BKE_paint_toolslots_brush_get ( struct Paint paint,
int  slot_index 
)

◆ BKE_paint_toolslots_brush_update()

void BKE_paint_toolslots_brush_update ( struct Paint paint)

◆ BKE_paint_toolslots_brush_update_ex()

void BKE_paint_toolslots_brush_update_ex ( struct Paint paint,
struct Brush brush 
)

◆ BKE_paint_toolslots_brush_validate()

void BKE_paint_toolslots_brush_validate ( struct Main bmain,
struct Paint paint 
)

◆ BKE_paint_toolslots_init_from_main()

void BKE_paint_toolslots_init_from_main ( struct Main bmain)

◆ BKE_paint_toolslots_len_ensure()

void BKE_paint_toolslots_len_ensure ( struct Paint paint,
int  len 
)

◆ BKE_paintmode_get_active_from_context()

ePaintMode BKE_paintmode_get_active_from_context ( const struct bContext C)

◆ BKE_paintmode_get_from_tool()

ePaintMode BKE_paintmode_get_from_tool ( const struct bToolRef tref)

◆ BKE_palette_add()

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

◆ BKE_palette_clear()

void BKE_palette_clear ( struct Palette palette)

Definition at line 758 of file paint.c.

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

◆ BKE_palette_color_add()

struct PaletteColor* BKE_palette_color_add ( struct Palette palette)

◆ BKE_palette_color_remove()

void BKE_palette_color_remove ( struct Palette palette,
struct PaletteColor color 
)

Remove color from palette. Must be certain color is inside the palette!

Definition at line 742 of file paint.c.

References Palette::active_color, BLI_listbase_count_at_most(), BLI_listbase_is_empty(), BLI_remlink(), color, 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()

bool BKE_palette_from_hash ( struct Main bmain,
struct GHash color_table,
const char *  name,
bool  linear 
)

◆ BKE_palette_is_empty()

bool BKE_palette_is_empty ( const struct Palette palette)

Definition at line 777 of file paint.c.

References BLI_listbase_is_empty(), and Palette::colors.

◆ BKE_palette_sort_hsv()

void BKE_palette_sort_hsv ( struct tPaletteColorHSV color_array,
int  totcol 
)

Definition at line 894 of file paint.c.

References palettecolor_compare_hsv().

Referenced by BKE_palette_from_hash(), and palette_sort_exec().

◆ BKE_palette_sort_luminance()

void BKE_palette_sort_luminance ( struct tPaletteColorHSV color_array,
int  totcol 
)

Definition at line 912 of file paint.c.

References palettecolor_compare_luminance().

Referenced by palette_sort_exec().

◆ BKE_palette_sort_svh()

void BKE_palette_sort_svh ( struct tPaletteColorHSV color_array,
int  totcol 
)

Definition at line 900 of file paint.c.

References palettecolor_compare_svh().

Referenced by palette_sort_exec().

◆ BKE_palette_sort_vhs()

void BKE_palette_sort_vhs ( struct tPaletteColorHSV color_array,
int  totcol 
)

Definition at line 906 of file paint.c.

References palettecolor_compare_vhs().

Referenced by palette_sort_exec().

◆ BKE_sculpt_bvh_update_from_ccg()

void BKE_sculpt_bvh_update_from_ccg ( struct PBVH pbvh,
struct SubdivCCG subdiv_ccg 
)

◆ BKE_sculpt_color_layer_create_if_needed()

void BKE_sculpt_color_layer_create_if_needed ( struct Object object)

◆ BKE_sculpt_ensure_orig_mesh_data()

void BKE_sculpt_ensure_orig_mesh_data ( struct Scene scene,
struct Object object 
)

Ensures we do have expected mesh data in original mesh for the sculpt mode.

Note
IDs are expected to be original ones here, and calling code should ensure it updates its depsgraph properly after calling this function if it needs up-to-date evaluated data.

Definition at line 2144 of file paint.c.

References BKE_mesh_from_object(), BKE_mesh_tessface_clear(), BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_mask_layers_ensure(), BKE_sculpt_multires_active(), BLI_assert, CD_SCULPT_FACE_SETS, CustomData_get_layer(), DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, mesh, Object::mode, NULL, OB_MODE_SCULPT, Mesh::pdata, scene, and Object::sculpt.

Referenced by quadriflow_start_job(), sculpt_init_session(), and voxel_remesh_exec().

◆ BKE_sculpt_face_sets_ensure_from_base_mesh_visibility()

void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility ( struct Mesh mesh)

Ensures that a Face Set data-layers exists. If it does not, it creates one respecting the visibility stored in the vertices of the mesh. If it does, it copies the visibility from the mesh to the Face Sets.

Definition at line 2043 of file paint.c.

References blender::math::abs(), CD_CALLOC, CD_SCULPT_FACE_SETS, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), Mesh::face_sets_color_default, MPoly::flag, ME_HIDE, mesh, Mesh::mpoly, NULL, Mesh::pdata, and Mesh::totpoly.

Referenced by BKE_sculpt_ensure_orig_mesh_data(), and BKE_sculpt_sync_face_set_visibility().

◆ BKE_sculpt_mask_layers_ensure()

int BKE_sculpt_mask_layers_ensure ( struct Object ob,
struct MultiresModifierData mmd 
)

◆ BKE_sculpt_multires_active()

struct MultiresModifierData* BKE_sculpt_multires_active ( const struct Scene scene,
struct 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.

Referenced by ED_object_sculptmode_enter_ex(), ED_object_sculptmode_exit_ex(), mesh_calc_modifiers(), and sculpt_undo_restore_list().

◆ BKE_sculpt_object_pbvh_ensure()

struct PBVH* BKE_sculpt_object_pbvh_ensure ( struct Depsgraph depsgraph,
struct Object ob 
)

◆ BKE_sculpt_sync_face_set_visibility()

void BKE_sculpt_sync_face_set_visibility ( struct Mesh mesh,
struct SubdivCCG subdiv_ccg 
)

This ensure that all elements in the mesh (both vertices and grids) have their visibility updated according to the face sets.

Definition at line 2137 of file paint.c.

References BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_sync_face_sets_visibility_to_base_mesh(), BKE_sculpt_sync_face_sets_visibility_to_grids(), and mesh.

Referenced by build_pbvh_from_ccg(), and build_pbvh_from_regular_mesh().

◆ BKE_sculpt_sync_face_sets_visibility_to_base_mesh()

void BKE_sculpt_sync_face_sets_visibility_to_base_mesh ( struct Mesh mesh)

◆ BKE_sculpt_sync_face_sets_visibility_to_grids()

void BKE_sculpt_sync_face_sets_visibility_to_grids ( struct Mesh mesh,
struct SubdivCCG subdiv_ccg 
)

◆ BKE_sculpt_toolsettings_data_ensure()

void BKE_sculpt_toolsettings_data_ensure ( struct Scene scene)

◆ BKE_sculpt_update_object_after_eval()

void BKE_sculpt_update_object_after_eval ( struct Depsgraph depsgraph,
struct Object ob_eval 
)

◆ BKE_sculpt_update_object_before_eval()

void BKE_sculpt_update_object_before_eval ( const struct Scene scene,
struct Object ob_eval 
)

Referenced by makeDerivedMesh().

◆ BKE_sculpt_update_object_for_edit()

void BKE_sculpt_update_object_for_edit ( struct Depsgraph depsgraph,
struct Object ob_orig,
bool  need_pmap,
bool  need_mask,
bool  is_paint_tool 
)

◆ BKE_sculptsession_bm_to_me()

void BKE_sculptsession_bm_to_me ( struct Object ob,
bool  reorder 
)

◆ BKE_sculptsession_bm_to_me_for_render()

void BKE_sculptsession_bm_to_me_for_render ( struct Object object)

◆ BKE_sculptsession_free()

void BKE_sculptsession_free ( struct Object ob)

◆ BKE_sculptsession_free_deformMats()

void BKE_sculptsession_free_deformMats ( struct SculptSession ss)

◆ BKE_sculptsession_free_vwpaint_data()

void BKE_sculptsession_free_vwpaint_data ( struct SculptSession ss)

◆ BKE_sculptsession_use_pbvh_draw()

bool BKE_sculptsession_use_pbvh_draw ( const struct Object ob,
const struct RegionView3D rv3d 
)

◆ paint_calculate_rake_rotation()

bool paint_calculate_rake_rotation ( struct UnifiedPaintSettings ups,
struct Brush brush,
const float  mouse_pos[2] 
)

◆ paint_grid_paint_mask()

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

◆ paint_is_bmesh_face_hidden()

bool paint_is_bmesh_face_hidden ( struct BMFace f)

Return true if all vertices in the face are visible, false otherwise.

Definition at line 1262 of file paint.c.

References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_FACE_FIRST_LOOP, BMLoop::next, and BMLoop::v.

Referenced by partialvis_update_bmesh_faces().

◆ paint_is_face_hidden()

bool paint_is_face_hidden ( const struct MLoopTri lt,
const struct MVert mvert,
const struct MLoop mloop 
)

Returns non-zero if any of the face's vertices are hidden, zero otherwise.

Referenced by build_mesh_leaf_node(), gpu_pbvh_is_looptri_visible(), pbvh_faces_node_nearest_to_ray(), and pbvh_faces_node_raycast().

◆ paint_is_grid_face_hidden()

bool paint_is_grid_face_hidden ( const unsigned int *  grid_hidden,
int  gridsize,
int  x,
int  y 
)

Returns non-zero if any of the corners of the grid face whose inner corner is at (x, y) are hidden, zero otherwise.

Definition at line 1253 of file paint.c.

References BLI_BITMAP_TEST, x, and y.

Referenced by BKE_pbvh_count_grid_quads(), gpu_pbvh_grid_fill_index_buffers(), pbvh_grids_node_nearest_to_ray(), and pbvh_grids_node_raycast().

◆ paint_update_brush_rake_rotation()

void paint_update_brush_rake_rotation ( struct UnifiedPaintSettings ups,
struct Brush brush,
float  rotation 
)

Variable Documentation

◆ PAINT_CURSOR_SCULPT

const char PAINT_CURSOR_SCULPT[3]
extern

Definition at line 220 of file paint.c.

Referenced by ED_object_sculptmode_enter_ex().

◆ PAINT_CURSOR_TEXTURE_PAINT

const char PAINT_CURSOR_TEXTURE_PAINT[3]
extern

Definition at line 223 of file paint.c.

Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_space_image_paint_update().

◆ PAINT_CURSOR_VERTEX_PAINT

const char PAINT_CURSOR_VERTEX_PAINT[3]
extern

Definition at line 221 of file paint.c.

Referenced by ed_vwpaintmode_enter_generic().

◆ PAINT_CURSOR_WEIGHT_PAINT

const char PAINT_CURSOR_WEIGHT_PAINT[3]
extern

Definition at line 222 of file paint.c.

Referenced by ed_vwpaintmode_enter_generic().