100 std::optional<Library *> ,
175 std::optional<Library *> ,
276 if (paint ==
nullptr) {
281 if (br && br->
curve == curve) {
323 Paint **paint_ptr =
nullptr;
326 Paint *paint_tmp =
nullptr;
341 paint_ptr = &paint_tmp;
440 if (sce && view_layer) {
446 switch (actob->
mode) {
483 if (sce && view_layer) {
512 if (sce && view_layer) {
527 switch (obact->
mode) {
568 switch (tref->
mode) {
596 switch (tref->
mode) {
626 if (paint->
brush !=
nullptr) {
645 paint->
brush = brush;
656 return paint ? paint->
brush :
nullptr;
661 if (paint ==
nullptr) {
672 return MEM_new<AssetWeakReference>(__func__, *weak_ref);
699 paint->
brush = brush;
704 if (brush !=
nullptr) {
706 *brush_asset_reference);
720 paint->
brush = brush;
724 if (brush !=
nullptr) {
735 return "essentials_brushes-mesh_sculpt.blend";
737 return "essentials_brushes-mesh_vertex.blend";
739 return "essentials_brushes-mesh_weight.blend";
741 return "essentials_brushes-mesh_texture.blend";
743 return "essentials_brushes-gp_draw.blend";
745 return "essentials_brushes-gp_sculpt.blend";
747 return "essentials_brushes-gp_weight.blend";
749 return "essentials_brushes-gp_vertex.blend";
751 return "essentials_brushes-curve_sculpt.blend";
761 if (!essentials_file_name) {
769 "brushes/%s/Brush/%s", essentials_file_name, name);
777 if (!essentials_file_name) {
785 "brushes/%s/Brush/%s", essentials_file_name, name);
797 return reinterpret_cast<Brush *
>(
809 paint->
brush =
nullptr;
825 std::optional<int> brush_type,
829 const char *name =
"";
830 const char *eraser_name =
"";
841 name =
"Face Set Paint";
850 name =
"Erase Multires Displacement";
853 name =
"Smear Multires Displacement";
949 name =
"Eraser Hard";
960 eraser_name =
"Eraser Soft";
1025 if (r_eraser_name) {
1026 *r_eraser_name = eraser_name;
1031 eObjectMode ob_mode, std::optional<int> brush_type)
1036 if (name.is_empty()) {
1044 const bool do_regular =
true,
1045 const bool do_eraser =
true)
1059 if (do_regular && !name.is_empty()) {
1062 if (do_eraser && !eraser_name.
is_empty()) {
1167 if (paint ==
nullptr || paint->
eraser_brush == brush) {
1179 if (brush !=
nullptr) {
1182 if (weak_ref.has_value()) {
1198 return reinterpret_cast<Brush *
>(
1347 return paint ? paint->
palette :
nullptr;
1394 PaletteColor *color = MEM_cnew<PaletteColor>(__func__);
1411 if (ps1->
h > ps2->
h) {
1414 if (ps1->
h < ps2->
h) {
1419 if (ps1->
s > ps2->
s) {
1422 if (ps1->
s < ps2->
s) {
1427 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1430 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1444 if (ps1->
s > ps2->
s) {
1447 if (ps1->
s < ps2->
s) {
1452 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1455 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1460 if (ps1->
h > ps2->
h) {
1463 if (ps1->
h < ps2->
h) {
1476 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1479 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1484 if (ps1->
h > ps2->
h) {
1487 if (ps1->
h < ps2->
h) {
1492 if (ps1->
s > ps2->
s) {
1495 if (ps1->
s < ps2->
s) {
1507 float lumi1 = (ps1->
rgb[0] + ps1->
rgb[1] + ps1->
rgb[2]) / 3.0f;
1508 float lumi2 = (ps2->
rgb[0] + ps2->
rgb[1] + ps2->
rgb[2]) / 3.0f;
1510 if (lumi1 > lumi2) {
1513 if (lumi1 < lumi2) {
1565 col_elm = &color_array[t];
1566 col_elm->
rgb[0] = r;
1567 col_elm->
rgb[1] = g;
1568 col_elm->
rgb[2] =
b;
1583 for (
int i = 0; i < totpal; i++) {
1584 col_elm = &color_array[i];
1609 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1616 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1623 if (ob ==
nullptr || ob->
data ==
nullptr) {
1640 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1653 cumap->
flag &= ~CUMA_EXTEND_EXTRAPOLATE;
1687 Paint *paint =
nullptr;
1689 if (!(*r_paint)->runtime.initialized) {
1708 Paint paint_test = **r_paint;
1711 std::swap(**r_paint, paint_test);
1719 VPaint *data = MEM_cnew<VPaint>(__func__);
1720 paint = &data->paint;
1723 Sculpt *data = MEM_cnew<Sculpt>(__func__);
1727 paint = &data->paint;
1730 GpPaint *data = MEM_cnew<GpPaint>(__func__);
1731 paint = &data->paint;
1735 paint = &data->paint;
1739 paint = &data->paint;
1743 paint = &data->paint;
1747 paint = &data->paint;
1771 if (!paint->
brush) {
1787 if (ensure_brushes) {
1812 MEM_delete(brush_ref->name);
1813 MEM_delete(brush_ref->brush_asset_reference);
1814 MEM_delete(brush_ref);
1840 brush_ref->name =
BLI_strdup(brush_ref->name);
1841 brush_ref->brush_asset_reference = MEM_new<AssetWeakReference>(
1842 __func__, *brush_ref->brush_asset_reference);
1858 copy_v3_v3(stroke, ob->object_to_world().location());
1887 if (brush_ref->brush_asset_reference) {
1930 if (brush_ref->brush_asset_reference) {
1961 }
while ((l_iter = l_iter->
next) != l_first);
1971 return gpm->
data[(y * factor) * gridsize + (x * factor)];
2007 const float mouse_pos[2],
2009 bool stroke_has_started)
2017 if (!stroke_has_started) {
2082 params.calc_object_remap =
false;
2125 if (
object && object->sculpt) {
2126 if (object->sculpt->bm) {
2182 return active_vert_;
2187 return active_vert_;
2192 if (std::holds_alternative<int>(active_vert_)) {
2193 return std::get<int>(active_vert_);
2195 if (std::holds_alternative<SubdivCCGCoord>(active_vert_)) {
2196 const SubdivCCGCoord coord = std::get<SubdivCCGCoord>(active_vert_);
2199 if (std::holds_alternative<BMVert *>(active_vert_)) {
2200 BMVert *bm_vert = std::get<BMVert *>(active_vert_);
2209 if (std::holds_alternative<int>(last_active_vert_)) {
2210 return std::get<int>(last_active_vert_);
2212 if (std::holds_alternative<SubdivCCGCoord>(last_active_vert_)) {
2213 const SubdivCCGCoord coord = std::get<SubdivCCGCoord>(last_active_vert_);
2216 if (std::holds_alternative<BMVert *>(last_active_vert_)) {
2217 BMVert *bm_vert = std::get<BMVert *>(last_active_vert_);
2225 const Object &
object)
const
2227 if (std::holds_alternative<int>(active_vert_)) {
2229 return positions[std::get<int>(active_vert_)];
2231 if (std::holds_alternative<SubdivCCGCoord>(active_vert_)) {
2233 const SubdivCCGCoord coord = std::get<SubdivCCGCoord>(active_vert_);
2236 if (std::holds_alternative<BMVert *>(active_vert_)) {
2237 BMVert *bm_vert = std::get<BMVert *>(active_vert_);
2242 return float3(std::numeric_limits<float>::infinity());
2247 if (persist_last_active) {
2248 if (!std::holds_alternative<std::monostate>(active_vert_)) {
2249 last_active_vert_ = active_vert_;
2253 last_active_vert_ = {};
2260 active_vert_ = vert;
2265 const bool auto_create_mdisps)
2276 bool need_mdisps =
false;
2279 if (!auto_create_mdisps) {
2340 for (; md; md = md->
next) {
2374 Sculpt *sd = scene->toolsettings->sculpt;
2387 if (mesh_eval ==
nullptr) {
2416 bool used_me_eval =
false;
2435 used_me_eval =
true;
2442 if (ss.
deform_cos.is_empty() && !used_me_eval) {
2468 if (key_data.
data() !=
nullptr) {
2477 if (is_paint_tool) {
2482 if (
U.experimental.use_sculpt_texture_paint) {
2498 if (use_paint_slots) {
2506 bke::pbvh::update_normals(*
depsgraph, *ob, pbvh);
2545 IndexMaskMemory memory;
2546 const IndexMask node_mask = bke::pbvh::all_leaf_nodes(*pbvh, memory);
2548 switch (pbvh->
type()) {
2549 case bke::pbvh::Type::Mesh: {
2554 case bke::pbvh::Type::Grids: {
2559 case bke::pbvh::Type::BMesh: {
2589 if (!orig_me->attributes_for_write().add(
2618 const OffsetIndices faces = mesh->faces();
2619 const Span<int> corner_verts = mesh->corner_verts();
2627 int gridarea = gridsize * gridsize;
2632 for (
int i = 0; i < mesh->corners_num; i++) {
2636 gpm->
data =
static_cast<float *
>(
2637 MEM_callocN(
sizeof(
float) * gridarea,
"GridPaintMask.data"));
2641 if (
const VArray<float> mask = *attributes.lookup<
float>(
".sculpt_mask", AttrDomain::Point)) {
2643 for (
const int i : faces.index_range()) {
2648 for (
const int vert : corner_verts.
slice(face)) {
2649 avg += mask_span[vert];
2651 avg /=
float(face.size());
2654 for (
const int corner : face) {
2656 const int vert = corner_verts[corner];
2657 const int prev = corner_verts[mesh::face_corner_prev(face, corner)];
2658 const int next = corner_verts[mesh::face_corner_next(face, corner)];
2661 gpm->
data[1] = (mask_span[vert] + mask_span[
next]) * 0.5f;
2662 gpm->
data[2] = (mask_span[vert] + mask_span[prev]) * 0.5f;
2663 gpm->
data[3] = mask_span[vert];
2683 Sculpt *sd = scene->toolsettings->sculpt;
2727 bool deformed =
false;
2732 deformed |=
object->sculpt->deform_modifiers_active;
2734 if (for_construction) {
2735 deformed |=
object->sculpt->shapekey_active !=
nullptr;
2741 deformed |=
object->sculpt->shapekey_active && (
object->shapeflag &
OB_SHAPE_LOCK) == 0;
2753 const VArray<bool> hide_poly = *attributes.lookup_or_default<
bool>(
2754 ".hide_poly", AttrDomain::Face,
false);
2760 const OffsetIndices<int> faces = mesh.faces();
2764 threading::parallel_for(faces.index_range(), 1024, [&](
const IndexRange range) {
2765 for (const int i : range) {
2766 const bool face_hidden = hide_poly_span[i];
2767 for (const int corner : faces[i]) {
2768 grid_hidden[corner].set_all(face_hidden);
2786 const Mesh *me_eval_deform)
2792 if (is_deformed && me_eval_deform !=
nullptr) {
2819 if (ss.
bm !=
nullptr) {
2825 Mesh *mesh_eval =
static_cast<Mesh *
>(object_eval->
data);
2826 if (mesh_eval->
runtime->subdiv_ccg !=
nullptr) {
2840 if (!
object.sculpt) {
2843 return object.sculpt->pbvh.get();
2849 if (!
object.sculpt) {
2852 return object.sculpt->pbvh.get();
2859 return object->sculpt &&
object->sculpt->bm;
2876 const bool external_engine = rv3d && rv3d->
view_render !=
nullptr;
2885#define GOLDEN_RATIO_CONJUGATE 0.618033988749895f
2890 random_mod_hue = random_mod_hue -
floorf(random_mod_hue);
2894 0.6f + (random_mod_sat * 0.25f),
2895 1.0f - (random_mod_val * 0.35f),
void BKE_asset_weak_reference_read(BlendDataReader *reader, AssetWeakReference *weak_ref)
void BKE_asset_weak_reference_write(BlendWriter *writer, const AssetWeakReference *weak_ref)
void BKE_id_attributes_default_color_set(struct ID *id, const char *name)
void BKE_id_attributes_active_color_set(struct ID *id, const char *name)
std::string BKE_attribute_calc_unique_name(const AttributeOwner &owner, const blender::StringRef name)
bool BKE_color_attribute_supported(const struct Mesh &mesh, const blender::StringRef name)
bool BKE_brush_has_cube_tip(const Brush *brush, PaintMode paint_mode)
int CCG_grid_xy_to_index(const int grid_size, const int x, const int y)
SpaceImage * CTX_wm_space_image(const bContext *C)
@ CTX_MODE_VERTEX_GPENCIL_LEGACY
@ CTX_MODE_WEIGHT_GPENCIL_LEGACY
@ CTX_MODE_SCULPT_GPENCIL_LEGACY
@ CTX_MODE_PAINT_GREASE_PENCIL
@ CTX_MODE_PAINT_GPENCIL_LEGACY
@ CTX_MODE_SCULPT_GREASE_PENCIL
@ CTX_MODE_WEIGHT_GREASE_PENCIL
@ CTX_MODE_VERTEX_GREASE_PENCIL
Scene * CTX_data_scene(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_crazyspace_build_sculpt(Depsgraph *depsgraph, Scene *scene, Object *ob, blender::Array< blender::float3x3, 0 > &deformmats, blender::Array< blender::float3, 0 > &deformcos)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
@ IDTYPE_FLAGS_NO_ANIMDATA
void BKE_image_pool_free(ImagePool *pool)
KeyBlock * BKE_keyblock_from_object(Object *ob)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_fake_user_set(ID *id)
void BKE_lib_id_swap(Main *bmain, ID *id_a, ID *id_b, const bool do_self_remap, const int self_remap_flags)
void * BKE_id_new(Main *bmain, short type, const char *name)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
General operations, lookup, etc. for materials.
void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob)
void BKE_mesh_tessface_clear(Mesh *mesh)
Mesh * BKE_mesh_from_object(Object *ob)
bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_mode)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
const Mesh * BKE_object_get_mesh_deform_eval(const Object *object)
Mesh * BKE_object_get_evaluated_mesh_unchecked(const Object *object)
Mesh * BKE_object_get_original_mesh(const Object *object)
void BKE_object_free_derived_caches(Object *ob)
void BKE_sculpt_sync_face_visibility_to_grids(const Mesh &mesh, SubdivCCG &subdiv_ccg)
std::variant< std::monostate, int, SubdivCCGCoord, BMVert * > ActiveVert
void BKE_sculptsession_free_vwpaint_data(SculptSession *ss)
ePaintOverlayControlFlags
@ PAINT_OVERLAY_INVALID_CURVE
@ PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY
@ PAINT_OVERLAY_OVERRIDE_CURSOR
@ PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY
@ PAINT_OVERLAY_OVERRIDE_SECONDARY
@ PAINT_OVERLAY_OVERRIDE_PRIMARY
#define PAINT_OVERRIDE_MASK
void BKE_sculpt_check_cavity_curves(Sculpt *sd)
char * BKE_paint_canvas_key_get(PaintModeSettings *settings, Object *ob)
A BVH for high poly meshes.
void BKE_pbvh_mark_rebuild_pixels(blender::bke::pbvh::Tree &pbvh)
void BKE_pbvh_node_mark_update(blender::bke::pbvh::Node &node)
void BKE_pbvh_vert_coords_apply(blender::bke::pbvh::Tree &pbvh, blender::Span< blender::float3 > vert_positions)
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
CCGKey BKE_subdiv_ccg_key_top_level(const SubdivCCG &subdiv_ccg)
blender::BitGroupVector & BKE_subdiv_ccg_grid_hidden_ensure(SubdivCCG &subdiv_ccg)
void BKE_subdiv_ccg_grid_hidden_free(SubdivCCG &subdiv_ccg)
int BKE_ccg_gridsize(int level)
int BKE_ccg_factor(int low_level, int high_level)
#define BLI_assert_unreachable()
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
#define GHASH_ITER(gh_iter_, ghash_)
unsigned int BLI_ghash_len(const GHash *gh) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_hash_int_01(unsigned int k)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
int BLI_listbase_count_at_most(const struct ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
void rgb_to_hsv(float r, float g, float b, float *r_h, float *r_s, float *r_v)
void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3])
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b)
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
void cpack_to_rgb(unsigned int col, float *r_r, float *r_g, float *r_b)
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_v3_uchar(unsigned char r[3], const unsigned char a[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define POINTER_AS_INT(i)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
#define BLO_write_struct_list(writer, struct_name, list_ptr)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_PALETTE
#define BLT_I18NCONTEXT_ID_PAINTCURVE
void DEG_id_tag_update(ID *id, unsigned int flags)
Scene * DEG_get_input_scene(const Depsgraph *graph)
Object * DEG_get_original_object(Object *object)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ ID_RECALC_GEOMETRY_ALL_MODES
#define ID_IS_LINKED(_id)
@ GPVERTEX_BRUSH_TYPE_BLUR
@ GPVERTEX_BRUSH_TYPE_DRAW
@ GPVERTEX_BRUSH_TYPE_TINT
@ GPVERTEX_BRUSH_TYPE_REPLACE
@ GPVERTEX_BRUSH_TYPE_AVERAGE
@ GPVERTEX_BRUSH_TYPE_SMEAR
@ GPAINT_BRUSH_TYPE_ERASE
@ WPAINT_BRUSH_TYPE_AVERAGE
@ WPAINT_BRUSH_TYPE_SMEAR
@ SCULPT_BRUSH_TYPE_DISPLACEMENT_SMEAR
@ SCULPT_BRUSH_TYPE_DRAW_FACE_SETS
@ SCULPT_BRUSH_TYPE_SIMPLIFY
@ SCULPT_BRUSH_TYPE_PAINT
@ SCULPT_BRUSH_TYPE_DISPLACEMENT_ERASER
@ SCULPT_BRUSH_TYPE_CLAY_STRIPS
@ IMAGE_PAINT_BRUSH_TYPE_MASK
@ IMAGE_PAINT_BRUSH_TYPE_FILL
@ IMAGE_PAINT_BRUSH_TYPE_DRAW
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
@ IMAGE_PAINT_BRUSH_TYPE_SOFTEN
@ IMAGE_PAINT_BRUSH_TYPE_SMEAR
@ VPAINT_BRUSH_TYPE_AVERAGE
@ VPAINT_BRUSH_TYPE_SMEAR
@ BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE
@ BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE
#define BRUSH_OVERLAY_OVERRIDE_MASK
@ GPWEIGHT_BRUSH_TYPE_AVERAGE
@ GPWEIGHT_BRUSH_TYPE_DRAW
@ GPWEIGHT_BRUSH_TYPE_SMEAR
@ GPWEIGHT_BRUSH_TYPE_BLUR
@ GPSCULPT_BRUSH_TYPE_CLONE
@ CURVES_SCULPT_BRUSH_TYPE_ADD
@ CURVES_SCULPT_BRUSH_TYPE_DENSITY
@ CURVES_SCULPT_BRUSH_TYPE_DELETE
@ CURVES_SCULPT_BRUSH_TYPE_SELECTION_PAINT
struct PaintCurve PaintCurve
#define DNA_struct_default_get(struct_name)
@ eMultiresModifierFlag_UseSculptBaseMesh
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_PAINT_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
@ OB_MODE_WEIGHT_GREASE_PENCIL
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_test(ele, hflag)
void BM_data_layer_ensure_named(BMesh *bm, CustomData *data, int type, const char *name)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_log_free(BMLog *log)
void BM_log_mesh_elems_reorder(BMesh *bm, BMLog *log)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned long seed
static AttributeOwner from_id(ID *id)
constexpr Span slice(int64_t start, int64_t size) const
constexpr const T * data() const
constexpr bool is_empty() const
constexpr const char * c_str() const
T get_internal_single() const
void tag_positions_changed(const IndexMask &node_mask)
static Tree from_bmesh(BMesh &bm)
Span< NodeT > nodes() const
static Tree from_grids(const Mesh &base_mesh, const SubdivCCG &subdiv_ccg)
static Tree from_mesh(const Mesh &mesh)
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
draw_view in_light_buf[] float
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
pbvh::Tree & pbvh_ensure(Depsgraph &depsgraph, Object &object)
pbvh::Tree * pbvh_get(Object &object)
void update_normals_from_eval(Object &object_eval, Tree &pbvh)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
ID * asset_edit_id_from_weak_reference(Main &global_main, ID_Type id_type, const AssetWeakReference &weak_ref)
static std::unique_ptr< pbvh::Tree > build_pbvh_from_regular_mesh(Object *ob, const Mesh *me_eval_deform)
std::optional< AssetWeakReference > asset_edit_weak_reference_from_id(const ID &id)
static std::unique_ptr< pbvh::Tree > build_pbvh_from_ccg(Object *ob, SubdivCCG &subdiv_ccg)
static std::unique_ptr< pbvh::Tree > build_pbvh_for_dynamic_topology(Object *ob)
bool asset_edit_id_is_editable(const ID &id)
CartesianBasis invert(const CartesianBasis &basis)
static void unique_name(bNode *node)
void BKE_palette_sort_vhs(tPaletteColorHSV *color_array, const int totcol)
Brush * BKE_paint_brush_from_essentials(Main *bmain, const eObjectMode ob_mode, const char *name)
void BKE_sculpt_update_object_after_eval(Depsgraph *depsgraph, Object *ob_eval)
PaletteColor * BKE_palette_color_add(Palette *palette)
bool BKE_paint_eraser_brush_set_default(Main *bmain, Paint *paint)
bool BKE_paint_select_grease_pencil_test(const Object *ob)
void BKE_paint_cavity_curve_preset(Paint *paint, int preset)
void BKE_paint_set_overlay_override(eOverlayFlags flags)
Brush * BKE_paint_eraser_brush(Paint *paint)
const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(const PaintMode mode)
static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
static bool paint_brush_update_from_asset_reference(Main *bmain, Paint *paint)
const uchar PAINT_CURSOR_SCULPT_GREASE_PENCIL[3]
void BKE_paint_invalidate_cursor_overlay(Scene *scene, ViewLayer *view_layer, CurveMapping *curve)
float paint_grid_paint_mask(const GridPaintMask *gpm, uint level, uint x, uint y)
bool BKE_paint_brush_set_essentials(Main *bmain, Paint *paint, const char *name)
void BKE_sculpt_sync_face_visibility_to_grids(const Mesh &mesh, SubdivCCG &subdiv_ccg)
void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const Tex *tex)
static void sculptsession_bm_to_me_update_data_only(Object *ob, bool reorder)
void BKE_paint_copy(const Paint *src, Paint *dst, const int flag)
static bool paint_rake_rotation_active(const MTex &mtex)
void BKE_sculptsession_bm_to_me(Object *ob, bool reorder)
bool paint_calculate_rake_rotation(UnifiedPaintSettings &ups, const Brush &brush, const float mouse_pos[2], const PaintMode paint_mode, bool stroke_has_started)
static MultiresModifierData * sculpt_multires_modifier_get(const Scene *scene, Object *ob, const bool auto_create_mdisps)
bool BKE_paint_always_hide_test(const Object *ob)
PaintCurve * BKE_paint_curve_add(Main *bmain, const char *name)
std::optional< int > BKE_paint_get_brush_type_from_obmode(const Brush *brush, const eObjectMode ob_mode)
static bool check_sculpt_object_deformed(Object *object, const bool for_construction)
bool BKE_palette_from_hash(Main *bmain, GHash *color_table, const char *name, const bool linear)
bool BKE_sculptsession_use_pbvh_draw(const Object *ob, const RegionView3D *rv3d)
void BKE_paint_brushes_ensure(Main *bmain, Paint *paint)
static AssetWeakReference * asset_reference_create_from_brush(Brush *brush)
const uchar PAINT_CURSOR_PAINT_GREASE_PENCIL[3]
static int palettecolor_compare_luminance(const void *a1, const void *a2)
void BKE_sculptsession_free(Object *ob)
bool BKE_paint_use_unified_color(const ToolSettings *tool_settings, const Paint *paint)
bool BKE_paint_brush_set(Main *bmain, Paint *paint, const AssetWeakReference *brush_asset_reference)
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 void palette_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
const uchar PAINT_CURSOR_WEIGHT_PAINT[3]
void BKE_sculptsession_free_deformMats(SculptSession *ss)
bool BKE_paint_select_elem_test(const Object *ob)
Paint * BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
ePaintOverlayControlFlags BKE_paint_get_overlay_flags()
static bool paint_eraser_brush_set_from_asset_reference(Main *bmain, Paint *paint)
bool BKE_paint_select_vert_test(const Object *ob)
static float paint_rake_rotation_spacing(const UnifiedPaintSettings &, const Brush &brush)
void BKE_palette_color_remove(Palette *palette, PaletteColor *color)
void BKE_sculptsession_free_vwpaint_data(SculptSession *ss)
bool paint_is_grid_face_hidden(const blender::BoundedBitSpan grid_hidden, const int gridsize, const int x, const int y)
static const char * paint_brush_essentials_asset_file_name_from_obmode(const eObjectMode ob_mode)
uint BKE_paint_get_brush_type_offset_from_paintmode(const PaintMode mode)
void BKE_paint_stroke_get_average(const Scene *scene, const Object *ob, float stroke[3])
const Brush * BKE_paint_eraser_brush_for_read(const Paint *paint)
void BKE_sculpt_update_object_before_eval(Object *ob_eval)
void BKE_palette_sort_hsv(tPaletteColorHSV *color_array, const int totcol)
static int palettecolor_compare_svh(const void *a1, const void *a2)
void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag)
void BKE_palette_sort_svh(tPaletteColorHSV *color_array, const int totcol)
static void paint_curve_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
static void paint_runtime_init(const ToolSettings *ts, Paint *paint)
void BKE_paint_free(Paint *paint)
void paint_update_brush_rake_rotation(UnifiedPaintSettings &ups, const Brush &brush, float rotation)
static AssetWeakReference * paint_brush_asset_reference_ptr_from_essentials(const char *name, const eObjectMode ob_mode)
void BKE_palette_sort_luminance(tPaletteColorHSV *color_array, const int totcol)
const Brush * BKE_paint_brush_for_read(const Paint *paint)
bool BKE_paint_eraser_brush_set(Paint *paint, Brush *brush)
static void palette_free_data(ID *id)
static void palette_undo_preserve(BlendLibReader *, ID *id_new, ID *id_old)
static void paint_curve_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Paint * BKE_paint_get_active_from_paintmode(Scene *sce, PaintMode mode)
eObjectMode BKE_paint_object_mode_from_paintmode(const PaintMode mode)
MultiresModifierData * BKE_sculpt_multires_active(const Scene *scene, Object *ob)
void BKE_paint_init(Main *bmain, Scene *sce, PaintMode mode, const uchar col[3], const bool ensure_brushes)
static void paint_curve_free_data(ID *id)
Brush * BKE_paint_eraser_brush_from_essentials(Main *bmain, eObjectMode ob_mode, const char *name)
void BKE_sculpt_update_object_for_edit(Depsgraph *depsgraph, Object *ob_orig, bool is_paint_tool)
#define GOLDEN_RATIO_CONJUGATE
void BKE_sculpt_color_layer_create_if_needed(Object *object)
void BKE_palette_clear(Palette *palette)
Paint * BKE_paint_get_active_from_context(const bContext *C)
bool paint_is_bmesh_face_hidden(const BMFace *f)
void BKE_sculptsession_bm_to_me_for_render(Object *object)
static std::optional< AssetWeakReference > paint_brush_asset_reference_from_essentials(const char *name, const eObjectMode ob_mode)
bool BKE_paint_ensure(ToolSettings *ts, Paint **r_paint)
static ePaintOverlayControlFlags overlay_flags
std::optional< AssetWeakReference > BKE_paint_brush_type_default_reference(eObjectMode ob_mode, std::optional< int > brush_type)
bool BKE_paint_brush_set_default(Main *bmain, Paint *paint)
Palette * BKE_palette_add(Main *bmain, const char *name)
const uchar PAINT_CURSOR_SCULPT[3]
static void sculpt_update_object(Depsgraph *depsgraph, Object *ob, Object *ob_eval, bool is_paint_tool)
static void palette_blend_write(BlendWriter *writer, ID *id, const void *id_address)
bool BKE_paint_eraser_brush_set_essentials(Main *bmain, Paint *paint, const char *name)
const uchar PAINT_CURSOR_TEXTURE_PAINT[3]
static void paint_curve_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_sculptsession_free_pbvh(Object &object)
static int palettecolor_compare_vhs(const void *a1, const void *a2)
static void palette_init_data(ID *id)
static int palettecolor_compare_hsv(const void *a1, const void *a2)
static void paint_eraser_brush_set_essentials_reference(Paint *paint, const char *name)
void BKE_paint_blend_read_data(BlendDataReader *reader, const Scene *scene, Paint *paint)
static void paint_brush_set_default_reference(Paint *paint, const bool do_regular=true, const bool do_eraser=true)
void BKE_paint_face_set_overlay_color_get(const int face_set, const int seed, uchar r_color[4])
static void paint_brush_set_essentials_reference(Paint *paint, const char *name)
std::optional< int > BKE_paint_get_brush_type_from_paintmode(const Brush *brush, const PaintMode mode)
Brush * BKE_paint_brush(Paint *paint)
void BKE_sculpt_toolsettings_data_ensure(Main *bmain, Scene *scene)
Palette * BKE_paint_palette(Paint *paint)
void BKE_paint_palette_set(Paint *paint, Palette *palette)
const uchar PAINT_CURSOR_SCULPT_CURVES[3]
void BKE_paint_curve_clamp_endpoint_add_index(PaintCurve *pc, const int add_index)
bool BKE_palette_is_empty(const Palette *palette)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
const uchar PAINT_CURSOR_VERTEX_PAINT[3]
static void palette_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_sculpt_mask_layers_ensure(Depsgraph *depsgraph, Main *bmain, Object *ob, MultiresModifierData *mmd)
bool BKE_paint_brush_poll(const Paint *paint, const Brush *brush)
bool BKE_object_sculpt_use_dyntopo(const Object *object)
void BKE_paint_brushes_set_default_references(ToolSettings *ts)
bool BKE_paint_select_face_test(const Object *ob)
PaintMode BKE_paintmode_get_from_tool(const bToolRef *tref)
void BKE_paint_brushes_validate(Main *bmain, Paint *paint)
void BKE_paint_invalidate_overlay_all()
void BKE_paint_blend_write(BlendWriter *writer, Paint *paint)
bool BKE_paint_ensure_from_paintmode(Scene *sce, PaintMode mode)
const EnumPropertyItem rna_enum_brush_weight_brush_type_items[]
const EnumPropertyItem rna_enum_brush_gpencil_sculpt_types_items[]
const EnumPropertyItem rna_enum_brush_image_brush_type_items[]
const EnumPropertyItem rna_enum_brush_sculpt_brush_type_items[]
const EnumPropertyItem rna_enum_brush_gpencil_vertex_types_items[]
const EnumPropertyItem rna_enum_brush_gpencil_weight_types_items[]
const EnumPropertyItem rna_enum_brush_vertex_brush_type_items[]
const EnumPropertyItem rna_enum_brush_gpencil_types_items[]
const EnumPropertyItem rna_enum_brush_curves_sculpt_brush_type_items[]
const char * relative_asset_identifier
const char * asset_library_identifier
char gpencil_sculpt_brush_type
struct CurveMapping * curve
char gpencil_weight_brush_type
char gpencil_vertex_brush_type
char curves_sculpt_brush_type
bool is_locked_for_linking
MeshRuntimeHandle * runtime
char * active_color_attribute
struct ModifierData * next
struct SculptSession * sculpt
struct Paint_Runtime runtime
struct Brush * eraser_brush
unsigned char paint_cursor_col[4]
struct CurveMapping * cavity_curve
struct AssetWeakReference * eraser_brush_asset_reference
struct AssetWeakReference * brush_asset_reference
ToolSystemBrushBindings tool_brush_bindings
struct ViewRender * view_render
struct ToolSettings * toolsettings
blender::Array< int > fake_neighbor_index
blender::ed::sculpt_paint::StrokeCache * cache
void clear_active_vert(bool persist_last_active)
blender::ed::sculpt_paint::filter::Cache * filter_cache
KeyBlock * shapekey_active
blender::Array< int > vert_to_edge_indices
SculptVertexInfo vertex_info
blender::SharedCache< blender::Vector< blender::float3 > > face_normals_deform
blender::GroupedSpan< int > vert_to_edge_map
blender::Array< MDeformVert > dvert_prev
blender::Array< int > preview_verts
ActiveVert active_vert() const
blender::Array< int > edge_to_face_offsets
blender::Array< blender::float3, 0 > deform_cos
blender::float3 active_vert_position(const Depsgraph &depsgraph, const Object &object) const
int last_active_vert_index() const
struct SculptSession::@49 mode
std::unique_ptr< blender::bke::pbvh::Tree > pbvh
std::unique_ptr< SculptTopologyIslandCache > topology_island_cache
char * last_paint_canvas_key
blender::Array< int > vert_to_edge_offsets
blender::GroupedSpan< int > edge_to_face_map
blender::SharedCache< blender::Vector< blender::float3 > > vert_normals_deform
blender::ed::sculpt_paint::expand::Cache * expand_cache
int active_vert_index() const
struct SculptSession::@49::@50 wpaint
ActiveVert last_active_vert() const
blender::Array< int > edge_to_face_indices
blender::Array< blender::float3x3, 0 > deform_imats
struct SculptSession::@48 multires
MultiresModifierData * modifier
SculptFakeNeighbors fake_neighbors
bool deform_modifiers_active
void set_active_vert(ActiveVert vert)
blender::BitVector boundary
float automasking_start_normal_falloff
float automasking_view_normal_limit
struct CurveMapping * automasking_cavity_curve_op
float automasking_start_normal_limit
struct CurveMapping * automasking_cavity_curve
float automasking_view_normal_falloff
int to_index(const CCGKey &key) const
blender::Array< blender::float3 > positions
float average_stroke_accum[3]
int average_stroke_counter