10#define DNA_DEPRECATED_ALLOW
100 std::optional<Library *> ,
188 std::optional<Library *> ,
282 if (paint ==
nullptr) {
329 Paint **paint_ptr =
nullptr;
332 Paint *paint_tmp =
nullptr;
347 paint_ptr = &paint_tmp;
439 if (sce && view_layer) {
445 switch (actob->
mode) {
481 if (sce && view_layer) {
487 if (sima !=
nullptr) {
510 if (sce && view_layer) {
515 if (sima !=
nullptr) {
526 switch (obact->
mode) {
564 switch (tref->
mode) {
592 switch (tref->
mode) {
622 if (paint->
brush !=
nullptr) {
635 if (brush ==
nullptr || (paint->
runtime->ob_mode & brush->
ob_mode) == 0) {
641 paint->
brush = brush;
647 return paint ? paint->
brush :
nullptr;
652 return paint ? paint->
brush :
nullptr;
657 if (paint ==
nullptr) {
668 return MEM_new<AssetWeakReference>(__func__, *weak_ref);
695 paint->
brush = brush;
700 if (brush !=
nullptr) {
702 brush_asset_reference);
716 paint->
brush = brush;
720 if (brush !=
nullptr) {
732 switch (paint_mode) {
734 return "essentials_brushes-mesh_sculpt.blend";
736 return "essentials_brushes-mesh_vertex.blend";
738 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";
762 if (!essentials_file_name) {
770 "brushes/%s/Brush/%s", essentials_file_name,
name);
779 if (!essentials_file_name) {
787 "brushes/%s/Brush/%s", essentials_file_name,
name);
799 return reinterpret_cast<Brush *
>(
811 paint->
brush =
nullptr;
827 std::optional<int> brush_type,
831 const char *
name =
"";
832 const char *eraser_name =
"";
834 switch (paint_mode) {
843 name =
"Face Set Paint";
852 name =
"Erase Multires Displacement";
855 name =
"Smear Multires Displacement";
952 name =
"Eraser Hard";
963 eraser_name =
"Eraser Soft";
1028 if (r_eraser_name) {
1029 *r_eraser_name = eraser_name;
1034 const PaintMode paint_mode, std::optional<int> brush_type)
1039 if (
name.is_empty()) {
1047 const bool do_regular =
true,
1048 const bool do_eraser =
true)
1060 paint->
runtime->paint_mode, std::nullopt, &
name, &eraser_name);
1062 if (do_regular && !
name.is_empty()) {
1065 if (do_eraser && !eraser_name.
is_empty()) {
1114 if (!paint->
runtime->previous_active_brush_reference) {
1115 paint->
runtime->previous_active_brush_reference = MEM_new<AssetWeakReference>(__func__);
1117 *paint->
runtime->previous_active_brush_reference = asset_weak_reference;
1122 MEM_SAFE_DELETE(paint->
runtime->previous_active_brush_reference);
1136 if (eraser_brush && (paint->
runtime->ob_mode & eraser_brush->
ob_mode) == 0) {
1162 if (brush ==
nullptr || (paint->
runtime->ob_mode & brush->
ob_mode) == 0) {
1184 if (paint ==
nullptr || paint->
eraser_brush == brush) {
1196 if (brush !=
nullptr) {
1199 if (weak_ref.has_value()) {
1217 return reinterpret_cast<Brush *
>(
1236 paint->
runtime = MEM_new<blender::bke::PaintRuntime>(__func__);
1281 paint->
runtime->initialized =
true;
1377 return paint ? paint->
palette :
nullptr;
1451 if (ps1->
h > ps2->
h) {
1454 if (ps1->
h < ps2->
h) {
1459 if (ps1->
s > ps2->
s) {
1462 if (ps1->
s < ps2->
s) {
1467 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1470 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1488 if (ps1->
s > ps2->
s) {
1491 if (ps1->
s < ps2->
s) {
1496 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1499 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1504 if (ps1->
h > ps2->
h) {
1507 if (ps1->
h < ps2->
h) {
1525 if (1.0f - ps1->
v > 1.0f - ps2->
v) {
1528 if (1.0f - ps1->
v < 1.0f - ps2->
v) {
1533 if (ps1->
h > ps2->
h) {
1536 if (ps1->
h < ps2->
h) {
1541 if (ps1->
s > ps2->
s) {
1544 if (ps1->
s < ps2->
s) {
1561 float lumi1 = (ps1->
rgb[0] + ps1->
rgb[1] + ps1->
rgb[2]) / 3.0f;
1562 float lumi2 = (ps2->
rgb[0] + ps2->
rgb[1] + ps2->
rgb[2]) / 3.0f;
1564 if (lumi1 > lumi2) {
1567 if (lumi1 < lumi2) {
1600 col_elm = &color_array[t];
1601 col_elm->
rgb[0] = r;
1602 col_elm->
rgb[1] = g;
1603 col_elm->
rgb[2] =
b;
1618 for (
int i = 0;
i < totpal;
i++) {
1619 col_elm = &color_array[
i];
1642 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1649 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1656 if (ob ==
nullptr || ob->
data ==
nullptr) {
1673 return ((ob !=
nullptr) && (ob->
type ==
OB_MESH) && (ob->
data !=
nullptr) &&
1740 Paint *paint =
nullptr;
1742 if (!(*r_paint)->runtime) {
1743 (*r_paint)->runtime = MEM_new<blender::bke::PaintRuntime>(__func__);
1745 if (!(*r_paint)->runtime->initialized && *r_paint == (
Paint *)&ts->
imapaint) {
1761 Paint paint_test = blender::dna::shallow_copy(**r_paint);
1764 blender::dna::shallow_swap(**r_paint, paint_test);
1773 paint = &
data->paint;
1781 paint = &
data->paint;
1786 paint = &
data->paint;
1791 paint = &
data->paint;
1796 paint = &
data->paint;
1801 paint = &
data->paint;
1806 paint = &
data->paint;
1832 if (!paint->
brush) {
1846 if (ensure_brushes) {
1866 MEM_delete(brush_ref->name);
1867 MEM_delete(brush_ref->brush_asset_reference);
1868 MEM_delete(brush_ref);
1874 MEM_SAFE_DELETE(paint->
runtime);
1899 brush_ref->name =
BLI_strdup(brush_ref->name);
1900 brush_ref->brush_asset_reference = MEM_new<AssetWeakReference>(
1901 __func__, *brush_ref->brush_asset_reference);
1915 dst->
runtime = MEM_new<blender::bke::PaintRuntime>(__func__);
1919 dst->
runtime->initialized =
true;
1960 copy_v3_v3(stroke, ob->object_to_world().location());
1967 const float pressure,
1970 constexpr float noise_scale = 1 / 20.0f;
1973 initial_hsv_jitter[0] :
1975 distance * noise_scale, initial_hsv_jitter[0] * 100));
1978 initial_hsv_jitter[1] :
1980 distance * noise_scale, initial_hsv_jitter[1] * 100));
1983 initial_hsv_jitter[2] :
1985 distance * noise_scale, initial_hsv_jitter[2] * 100));
1987 float hue_jitter_scale = color_jitter.
hue;
1991 float sat_jitter_scale = color_jitter.
saturation;
1995 float val_jitter_scale = color_jitter.
value;
2005 if (hsv[0] > 1.0f) {
2008 else if (hsv[0] < 0.0f) {
2017 return random_color;
2045 if (brush_ref->brush_asset_reference) {
2100 if (brush_ref->brush_asset_reference) {
2124 paint->
runtime = MEM_new<blender::bke::PaintRuntime>(__func__);
2150 }
while ((l_iter = l_iter->
next) != l_first);
2160 return gpm->
data[(
y * factor) * gridsize + (
x * factor)];
2195 const float mouse_pos[2],
2197 bool stroke_has_started)
2207 if (!stroke_has_started) {
2269 params.calc_object_remap =
false;
2312 if (
object && object->
sculpt) {
2369 return active_vert_;
2374 return last_active_vert_;
2379 if (std::holds_alternative<int>(active_vert_)) {
2380 return std::get<int>(active_vert_);
2382 if (std::holds_alternative<BMVert *>(active_vert_)) {
2383 BMVert *bm_vert = std::get<BMVert *>(active_vert_);
2392 if (std::holds_alternative<int>(last_active_vert_)) {
2393 return std::get<int>(last_active_vert_);
2395 if (std::holds_alternative<BMVert *>(last_active_vert_)) {
2396 BMVert *bm_vert = std::get<BMVert *>(last_active_vert_);
2404 const Object &
object)
const
2406 if (std::holds_alternative<int>(active_vert_)) {
2408 return this->
subdiv_ccg->positions[std::get<int>(active_vert_)];
2411 return positions[std::get<int>(active_vert_)];
2413 if (std::holds_alternative<BMVert *>(active_vert_)) {
2414 BMVert *bm_vert = std::get<BMVert *>(active_vert_);
2419 return float3(std::numeric_limits<float>::infinity());
2424 if (persist_last_active) {
2425 if (!std::holds_alternative<std::monostate>(active_vert_)) {
2426 last_active_vert_ = active_vert_;
2430 last_active_vert_ = {};
2439 active_vert_ = vert;
2446 return std::nullopt;
2450 this->subdiv_ccg->grid_size !=
persistent.grid_size)
2452 return std::nullopt;
2462 const bool auto_create_mdisps)
2471 bool need_mdisps =
false;
2474 if (!auto_create_mdisps) {
2583 if (mesh_eval ==
nullptr) {
2612 bool used_me_eval =
false;
2631 used_me_eval =
true;
2638 if (ss.
deform_cos.is_empty() && !used_me_eval) {
2664 if (key_data.
data() !=
nullptr) {
2673 if (is_paint_tool) {
2694 if (use_paint_slots) {
2743 pbvh->tag_positions_changed(node_mask);
2744 switch (
pbvh->type()) {
2785 if (!orig_me->attributes_for_write().add(
2823 int gridarea = gridsize * gridsize;
2828 for (
int i = 0;
i <
mesh->corners_num;
i++) {
2838 for (
const int i :
faces.index_range()) {
2843 for (
const int vert : corner_verts.
slice(face)) {
2844 avg += mask_span[vert];
2849 for (
const int corner : face) {
2851 const int vert = corner_verts[corner];
2856 gpm->
data[1] = (mask_span[vert] + mask_span[
next]) * 0.5f;
2857 gpm->
data[2] = (mask_span[vert] + mask_span[prev]) * 0.5f;
2858 gpm->
data[3] = mask_span[vert];
2933 bool deformed =
false;
2938 deformed |=
object->sculpt->deform_modifiers_active;
2940 if (for_construction) {
2941 deformed |=
object->sculpt->shapekey_active !=
nullptr;
2947 deformed |=
object->sculpt->shapekey_active && (
object->shapeflag &
OB_SHAPE_LOCK) == 0;
2971 for (const int i : range) {
2972 const bool face_hidden = hide_poly_span[i];
2973 for (const int corner : faces[i]) {
2974 grid_hidden[corner].set_all(face_hidden);
2992 const Mesh *me_eval_deform)
2998 if (is_deformed && me_eval_deform !=
nullptr) {
3025 if (ss.
bm !=
nullptr) {
3031 Mesh *mesh_eval =
static_cast<Mesh *
>(object_eval->
data);
3032 if (mesh_eval->
runtime->subdiv_ccg !=
nullptr) {
3046 if (!
object.sculpt) {
3049 return object.sculpt->pbvh.get();
3055 if (!
object.sculpt) {
3058 return object.sculpt->pbvh.get();
3065 return object->sculpt &&
object->sculpt->bm;
3082 const bool external_engine = rv3d && rv3d->
view_render !=
nullptr;
3091#define GOLDEN_RATIO_CONJUGATE 0.618033988749895f
3096 random_mod_hue = random_mod_hue -
floorf(random_mod_hue);
3100 0.6f + (random_mod_sat * 0.25f),
3101 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, std::optional< blender::StringRef > name)
std::string BKE_attribute_calc_unique_name(const AttributeOwner &owner, blender::StringRef name)
bool BKE_color_attribute_supported(const struct Mesh &mesh, blender::StringRef name)
void BKE_id_attributes_active_color_set(struct ID *id, std::optional< blender::StringRef > name)
bool BKE_brush_has_cube_tip(const Brush *brush, PaintMode paint_mode)
int CCG_grid_factor(int low_level, int high_level)
int CCG_grid_xy_to_index(const int grid_size, const int x, const int y)
int CCG_grid_size(const int level)
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)
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)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void BKE_id_blend_write(BlendWriter *writer, ID *id)
General operations, lookup, etc. for materials.
void BKE_texpaint_slots_refresh_object(Scene *scene, 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)
std::variant< std::monostate, int, BMVert * > ActiveVert
void BKE_sculpt_sync_face_visibility_to_grids(const Mesh &mesh, SubdivCCG &subdiv_ccg)
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
CurveMapping * BKE_sculpt_default_cavity_curve()
CurveMapping * BKE_paint_default_curve()
#define PAINT_OVERRIDE_MASK
MultiresModifierData * BKE_sculpt_multires_active(const Scene *scene, Object *ob)
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)
blender::BitGroupVector & BKE_subdiv_ccg_grid_hidden_ensure(SubdivCCG &subdiv_ccg)
void BKE_subdiv_ccg_grid_hidden_free(SubdivCCG &subdiv_ccg)
#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)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
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)
MINLINE 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_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 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)
T * DEG_get_original(T *id)
Scene * DEG_get_input_scene(const Depsgraph *graph)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ 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
@ BRUSH_COLOR_JITTER_USE_VAL_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_HUE_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_AT_STROKE
@ BRUSH_COLOR_JITTER_USE_SAT_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_VAL_RAND_PRESS
@ BRUSH_COLOR_JITTER_USE_HUE_RAND_PRESS
@ 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
@ CUMA_EXTEND_EXTRAPOLATE
#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.
#define USER_EXPERIMENTAL_TEST(userdef, member)
BLI_INLINE void IMB_colormanagement_srgb_to_scene_linear_v3(float scene_linear[3], const float srgb[3])
Read Guarded memory(de)allocation.
#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 StringRef name)
BMesh const char void * data
void BM_log_free(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
BPy_StructRNA * depsgraph
static unsigned long seed
static AttributeOwner from_id(ID *id)
void foreach_index(Fn &&fn) const
constexpr int64_t size() const
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
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
GAttributeReader lookup(const StringRef attribute_id) const
bool add(const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
static Tree from_bmesh(BMesh &bm)
static Tree from_grids(const Mesh &base_mesh, const SubdivCCG &subdiv_ccg)
static Tree from_mesh(const Mesh &mesh)
float distance(VecOp< float, D >, VecOp< float, D >) RET
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
int face_corner_prev(const IndexRange face, const int corner)
int face_corner_next(const IndexRange face, const int corner)
pbvh::Tree & pbvh_ensure(Depsgraph &depsgraph, Object &object)
pbvh::Tree * pbvh_get(Object &object)
void update_normals(const Depsgraph &depsgraph, Object &object_orig, Tree &pbvh)
IndexMask all_leaf_nodes(const Tree &pbvh, IndexMaskMemory &memory)
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)
T interpolate(const T &a, const T &b, const FactorT &t)
float perlin(float position)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
static void unique_name(bNode *node)
void BKE_palette_sort_vhs(tPaletteColorHSV *color_array, const int totcol)
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)
static float paint_rake_rotation_spacing(const Paint &, const Brush &brush)
void BKE_paint_stroke_get_average(const Paint *paint, const Object *ob, float stroke[3])
Brush * BKE_paint_eraser_brush(Paint *paint)
const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(const PaintMode mode)
static bool paint_brush_update_from_asset_reference(Main *bmain, Paint *paint)
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)
static void palette_foreach_working_space_color(ID *id, const IDTypeForeachColorFunctionCallback &fn)
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)
void BKE_paint_copy(const Paint *src, Paint *dst, const int flag)
blender::float3 BKE_paint_randomize_color(const BrushColorJitterSettings &color_jitter, const blender::float3 &initial_hsv_jitter, const float distance, const float pressure, const blender::float3 &color)
void paint_update_brush_rake_rotation(Paint &paint, const Brush &brush, float rotation)
static AssetWeakReference * paint_brush_asset_reference_ptr_from_essentials(const char *name, const PaintMode paint_mode)
static bool paint_rake_rotation_active(const MTex &mtex)
static bool sculpt_modifiers_active(const Scene *scene, const Sculpt *sd, Object *ob)
bool paint_calculate_rake_rotation(Paint &paint, 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)
void BKE_sculptsession_bm_to_me(Object *ob)
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_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)
static int palettecolor_compare_luminance(const void *a1, const void *a2)
void BKE_sculptsession_free(Object *ob)
void BKE_paint_settings_foreach_mode(ToolSettings *ts, blender::FunctionRef< void(Paint *paint)> fn)
static void palette_copy_data(Main *, std::optional< Library * >, ID *id_dst, const ID *id_src, const int)
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)
void BKE_palette_color_remove(Palette *palette, PaletteColor *color)
std::optional< AssetWeakReference > BKE_paint_brush_type_default_reference(const PaintMode paint_mode, std::optional< int > brush_type)
void BKE_sculptsession_free_vwpaint_data(SculptSession *ss)
void BKE_paint_previous_asset_reference_set(Paint *paint, AssetWeakReference &&asset_weak_reference)
bool paint_is_grid_face_hidden(const blender::BoundedBitSpan grid_hidden, const int gridsize, const int x, const int y)
uint BKE_paint_get_brush_type_offset_from_paintmode(const PaintMode mode)
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)
Brush * BKE_paint_brush_from_essentials(Main *bmain, const PaintMode paint_mode, const char *name)
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)
void BKE_paint_previous_asset_reference_clear(Paint *paint)
bool BKE_paint_use_unified_color(const Paint *paint)
eObjectMode BKE_paint_object_mode_from_paintmode(const PaintMode mode)
MultiresModifierData * BKE_sculpt_multires_active(const Scene *scene, Object *ob)
static void paint_brush_default_essentials_name_get(const PaintMode paint_mode, std::optional< int > brush_type, blender::StringRefNull *r_name, blender::StringRefNull *r_eraser_name=nullptr)
Brush * BKE_paint_eraser_brush_from_essentials(Main *bmain, const PaintMode paint_mode, const char *name)
static void paint_curve_free_data(ID *id)
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)
bool BKE_paint_ensure(ToolSettings *ts, Paint **r_paint)
static ePaintOverlayControlFlags overlay_flags
bool BKE_paint_brush_set_default(Main *bmain, Paint *paint)
Palette * BKE_palette_add(Main *bmain, const char *name)
static std::optional< AssetWeakReference > paint_brush_asset_reference_from_essentials(const char *name, const PaintMode paint_mode)
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_palette_from_hash(Main *bmain, GHash *color_table, const char *name)
bool BKE_paint_eraser_brush_set_essentials(Main *bmain, Paint *paint, const char *name)
bool BKE_paint_can_use_brush(const Paint *paint, const Brush *brush)
static void paint_curve_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_sculptsession_free_pbvh(Object &object)
bool BKE_paint_brush_set(Main *bmain, Paint *paint, const AssetWeakReference &brush_asset_reference)
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 sculptsession_bm_to_me_update_data_only(Object *ob)
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)
void BKE_palette_color_set(PaletteColor *color, const float rgb[3])
Palette * BKE_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)
static const char * paint_brush_essentials_asset_file_name_from_paint_mode(const PaintMode paint_mode)
bool BKE_palette_is_empty(const Palette *palette)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
static void paint_init_data(Paint &paint)
static void palette_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_sculpt_mask_layers_ensure(Depsgraph *depsgraph, Main *bmain, Object *ob, MultiresModifierData *mmd)
void BKE_paint_init(Main *bmain, Scene *sce, PaintMode mode, const bool ensure_brushes)
bool BKE_object_sculpt_use_dyntopo(const Object *object)
void BKE_paint_brushes_set_default_references(ToolSettings *ts)
void BKE_palette_color_sync_legacy(PaletteColor *color)
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)
void BKE_sculpt_cavity_curves_ensure(Sculpt *sd)
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
CurveMapping * curve_sat_jitter
CurveMapping * curve_val_jitter
CurveMapping * curve_hue_jitter
char gpencil_sculpt_brush_type
struct CurveMapping * curve_distance_falloff
char gpencil_weight_brush_type
char gpencil_vertex_brush_type
char curves_sculpt_brush_type
const blender::FunctionRef< void(float rgb[3])> single
IDProperty * system_properties
bool is_locked_for_linking
MeshRuntimeHandle * runtime
char * active_color_attribute
struct ModifierData * next
struct SculptSession * sculpt
struct Brush * eraser_brush
struct UnifiedPaintSettings unified_paint_settings
struct CurveMapping * cavity_curve
struct AssetWeakReference * eraser_brush_asset_reference
struct AssetWeakReference * brush_asset_reference
ToolSystemBrushBindings tool_brush_bindings
PaintRuntimeHandle * runtime
struct ViewRender * view_render
struct ToolSettings * toolsettings
blender::Array< int > fake_neighbor_index
blender::ed::sculpt_paint::StrokeCache * cache
struct SculptSession::@345375365225333342236070250113232025260070150165 persistent
std::optional< int > active_grid_index
blender::ed::sculpt_paint::filter::Cache * filter_cache
std::optional< int > active_face_index
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::@300305335361021334214041350300054316061376210174 multires
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
struct SculptSession::@362240011116215270333121305340144315201335267314::@377352350121204263020240366015362210376116055117 wpaint
blender::ed::sculpt_paint::expand::Cache * expand_cache
int active_vert_index() const
ActiveVert last_active_vert() const
std::optional< PersistentMultiresData > persistent_multires_data()
blender::Array< int > edge_to_face_indices
blender::Array< blender::float3x3, 0 > deform_imats
MultiresModifierData * modifier
SculptFakeNeighbors fake_neighbors
struct SculptSession::@362240011116215270333121305340144315201335267314 mode
bool deform_modifiers_active
void set_active_vert(ActiveVert vert)
void clear_active_elements(bool persist_last_active)
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
struct CurveMapping * curve_rand_value
struct CurveMapping * curve_rand_saturation
struct CurveMapping * curve_rand_hue
blender::float2 last_rake
blender::float3 average_stroke_accum
int average_stroke_counter