187 if (dv_prev->
flag == 1) {
207 paintval = 1.0f - paintval;
228 CLAMP(weight, 0.0f, 1.0f);
235 if (newval < oldval) {
236 return std::min(newval, curval);
238 if (newval > oldval) {
239 return std::max(newval, curval);
245 float weight,
float old_weight,
float locked_weight,
float free_weight,
bool auto_normalize)
249 if (auto_normalize || free_weight <= 0.0f) {
251 weight *= (1.0f - locked_weight);
259 if (old_weight >= free_weight) {
263 else if (weight < 1.0f) {
264 weight = weight * (free_weight - old_weight) / (1 - weight);
277 const int defbase_tot,
278 const bool *vgroup_validmap)
280 float sum = 0.0f, fac;
284 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
285 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
291 if ((tot == 0) || (
sum == 1.0f)) {
298 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
299 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
308 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
309 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
321 const int defbase_tot,
322 const bool *vgroup_validmap,
323 const bool *lock_flags)
325 float sum = 0.0f, fac;
326 float sum_unlock = 0.0f;
327 float lock_weight = 0.0f;
331 if (lock_flags ==
nullptr) {
336 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
337 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
340 if (lock_flags[dw->
def_nr]) {
341 lock_weight += dw->
weight;
361 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
362 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
363 if (lock_flags[dw->
def_nr] ==
false) {
369 return (lock_weight == 1.0f);
371 if (sum_unlock != 0.0f) {
372 fac = (1.0f - lock_weight) / sum_unlock;
374 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
375 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
376 if (lock_flags[dw->
def_nr] ==
false) {
386 fac = (1.0f - lock_weight) / tot;
388 CLAMP(fac, 0.0f, 1.0f);
390 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
391 if (dw->
def_nr < defbase_tot && vgroup_validmap[dw->
def_nr]) {
392 if (lock_flags[dw->
def_nr] ==
false) {
407 const int defbase_tot,
408 const bool *vgroup_validmap,
409 const bool *lock_flags,
410 const bool *lock_with_active)
415 dvert, defbase_tot, vgroup_validmap, lock_with_active);
432static bool has_unselected_unlocked_bone_group(
int defbase_tot,
435 const bool *lock_flags,
436 const bool *vgroup_validmap)
439 if (defbase_tot == selected) {
442 for (i = 0; i < defbase_tot; i++) {
443 if (vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) {
451 const int defbase_tot,
452 const bool *defbase_sel,
458 float change = *change_p;
461 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
462 if (dw->
def_nr < defbase_tot && defbase_sel[dw->
def_nr]) {
464 val = dw->
weight * change;
466 change = 1.0f / dw->
weight;
476 const int defbase_tot,
478 const bool *defbase_sel)
487 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
488 if (dw->
def_nr < defbase_tot && defbase_sel[dw->
def_nr]) {
490 val = dw->
weight * change;
504 const int defbase_tot,
506 const bool *defbase_sel)
511 for (i = dvert->
totweight, dw = dvert->
dw; i != 0; i--, dw++) {
512 if (dw->
def_nr < defbase_tot && defbase_sel[dw->
def_nr]) {
533 float weight_prev, weight_cur;
534 float dw_rel_locked = 0.0f, dw_rel_free = 1.0f;
549 if (index_mirr == index && vgroup_mirr == wpi.
active.
index) {
550 index_mirr = vgroup_mirr = -1;
554 index_mirr = vgroup_mirr = -1;
564 CLAMP(dw_rel_locked, 0.0f, 1.0f);
570 restrict_to_existing =
true;
575 if (restrict_to_existing) {
586 if (index_mirr != -1) {
587 dv_mirr = &wpi.
dvert[index_mirr];
591 if (dw_mirr ==
nullptr) {
592 index_mirr = vgroup_mirr = -1;
597 if (index != index_mirr) {
603 int dw_offset =
int(dw - dv_mirr->
dw);
607 if (totweight_prev != dv_mirr->
totweight) {
608 dw = &dv_mirr->
dw[dw_offset];
628 if (index_mirr != -1) {
640 weight_prev = weight_cur;
654 if (index_mirr == index) {
668 CLAMP(weight, 0.0f, 1.0f);
676 if (index_mirr != -1) {
696 if (index_mirr != -1) {
699 if (index != index_mirr) {
740 float curw, curw_real, oldw, neww, change, curw_mirr, change_mirr;
741 float dw_rel_free, dw_rel_locked;
747 if (!
ELEM(index_mirr, -1, index)) {
748 dv_mirr = &wpi.
dvert[index_mirr];
768 CLAMP(dw_rel_locked, 0.0f, 1.0f);
776 if (index_mirr != -1) {
800 change = neww / curw_real;
805 if (dv_mirr !=
nullptr) {
809 if (curw_mirr == 0.0f) {
815 float orig = change_mirr = curw_real * change / curw_mirr;
823 change *= change_mirr / orig;
834 if (dv_mirr !=
nullptr) {
842 if (dv_mirr !=
nullptr) {
872 int defbase_tot, defbase_tot_sel;
891 if (vgroup_index.
mirror != -1) {
910 &ob, defbase_tot, defbase_sel, defbase_sel, &defbase_tot_sel);
913 for (i = 0; i < defbase_tot; i++) {
914 if (defbase_sel[i]) {
925 std::unique_ptr<WPaintData> wpd = std::make_unique<WPaintData>();
933 wpd->active.index = vgroup_index.
active;
934 wpd->mirror.index = vgroup_index.
mirror;
937 wpd->defbase_tot = defbase_tot;
938 wpd->defbase_sel = defbase_sel;
939 wpd->defbase_tot_sel = defbase_tot_sel > 1 ? defbase_tot_sel : 1;
940 wpd->do_multipaint = (ts.
multipaint && defbase_tot_sel > 1);
953 wpd->lock_flags, wpd->vgroup_validmap, wpd->active.index) &&
955 defbase_tot, wpd->lock_flags, defbase_sel, defbase_tot_sel)))
957 wpd->do_lock_relative =
true;
960 if (wpd->do_lock_relative || (ts.
auto_normalize && wpd->lock_flags && !wpd->do_multipaint)) {
961 bool *unlocked = (
bool *)
MEM_dupallocN(wpd->vgroup_validmap);
963 if (wpd->lock_flags) {
964 bool *locked = (
bool *)
MEM_mallocN(
sizeof(
bool) * wpd->defbase_tot, __func__);
966 wpd->defbase_tot, wpd->lock_flags, wpd->vgroup_validmap, locked, unlocked);
967 wpd->vgroup_locked = locked;
970 wpd->vgroup_unlocked = unlocked;
975 tmpflags = (
bool *)
MEM_mallocN(
sizeof(
bool) * defbase_tot, __func__);
976 if (wpd->lock_flags) {
980 memcpy(tmpflags, wpd->defbase_sel,
sizeof(*tmpflags) * wpd->defbase_tot);
982 wpd->active.lock = tmpflags;
987 tmpflags = wpd->lock_flags ? (
bool *)
MEM_dupallocN(wpd->lock_flags) :
988 (
bool *)
MEM_callocN(
sizeof(
bool) * defbase_tot, __func__);
989 tmpflags[wpd->active.index] =
true;
990 wpd->active.lock = tmpflags;
992 tmpflags = wpd->lock_flags ? (
bool *)
MEM_dupallocN(wpd->lock_flags) :
993 (
bool *)
MEM_callocN(
sizeof(
bool) * defbase_tot, __func__);
994 tmpflags[(wpd->mirror.index != -1) ? wpd->mirror.index : wpd->active.index] =
true;
995 wpd->mirror.lock = tmpflags;
1006 wpd->precomputed_weight = (
float *)
MEM_mallocN(
sizeof(
float) * mesh.verts_num, __func__);
1011 for (
int i = 0; i < mesh.verts_num; i++, dv++) {
1039 CLAMP(weight, 0.0f, 1.0f);
1054 for (const int i : range) {
1055 const MDeformVert &dv = wpi.dvert[i];
1056 wpd.precomputed_weight[i] = wpaint_get_active_weight(dv, wpi);
1060 wpd.precomputed_weight_ready =
true;
1087 for (
const int i :
verts.index_range()) {
1088 if (!select_vert[
verts[i]]) {
1110 float brush_size_pressure, brush_alpha_value, brush_alpha_pressure;
1112 scene, ss, brush, &brush_size_pressure, &brush_alpha_value, &brush_alpha_pressure);
1122 const Span<int> corner_verts = mesh.corner_verts();
1125 const VArraySpan hide_vert = *attributes.lookup<
bool>(
".hide_vert", bke::AttrDomain::Point);
1127 if (use_vert_sel || use_face_sel) {
1128 select_vert = *attributes.lookup<
bool>(
".select_vert", bke::AttrDomain::Point);
1138 node_mask.
slice(range).foreach_index([&](
const int i) {
1143 if (!select_vert.is_empty()) {
1154 for (
const int i :
verts.index_range()) {
1155 const int vert =
verts[i];
1156 if (factors[i] == 0.0f) {
1161 int total_hit_loops = 0;
1162 float weight_final = 0.0f;
1163 for (
const int face : vert_to_face[vert]) {
1164 total_hit_loops += faces[face].size();
1165 for (
const int vert : corner_verts.
slice(faces[face])) {
1170 if (total_hit_loops == 0) {
1175 const float angle_cos = use_normal ?
1176 dot_v3v3(sculpt_normal_frontface, vert_normals[vert]) :
1184 const float final_alpha = factors[i] *
brush_strength * brush_alpha_pressure;
1195 weight_final /= total_hit_loops;
1221 float brush_size_pressure, brush_alpha_value, brush_alpha_pressure;
1223 scene, ss, brush, &brush_size_pressure, &brush_alpha_value, &brush_alpha_pressure);
1237 const Span<int> corner_verts = mesh.corner_verts();
1240 const VArraySpan hide_vert = *attributes.lookup<
bool>(
".hide_vert", bke::AttrDomain::Point);
1242 if (use_vert_sel || use_face_sel) {
1243 select_vert = *attributes.lookup<
bool>(
".select_vert", bke::AttrDomain::Point);
1256 node_mask.
slice(range).foreach_index([&](
const int i) {
1261 if (!select_vert.is_empty()) {
1272 for (
const int i :
verts.index_range()) {
1273 const int vert =
verts[i];
1274 if (factors[i] == 0.0f) {
1279 const float angle_cos = use_normal ?
1280 dot_v3v3(sculpt_normal_frontface, vert_normals[vert]) :
1288 bool do_color =
false;
1291 float stroke_dot_max = 0.0f;
1295 float weight_final = 0.0;
1296 for (
const int face : vert_to_face[vert]) {
1297 for (
const int vert_other : corner_verts.
slice(faces[face])) {
1298 if (vert_other == vert) {
1304 sub_v3_v3v3(other_dir, vert_positions[vert], vert_positions[vert_other]);
1309 const float stroke_dot =
dot_v3v3(other_dir, brush_dir);
1311 if (stroke_dot > stroke_dot_max) {
1312 stroke_dot_max = stroke_dot;
1320 const float final_alpha = factors[i] *
brush_strength * brush_alpha_pressure;
1336 const float strength,
1346 const float paintweight = strength;
1347 float brush_size_pressure, brush_alpha_value, brush_alpha_pressure;
1349 scene, ss, brush, &brush_size_pressure, &brush_alpha_value, &brush_alpha_pressure);
1360 const VArraySpan hide_vert = *attributes.lookup<
bool>(
".hide_vert", bke::AttrDomain::Point);
1362 if (use_vert_sel || use_face_sel) {
1363 select_vert = *attributes.lookup<
bool>(
".select_vert", bke::AttrDomain::Point);
1373 node_mask.
slice(range).foreach_index([&](
const int i) {
1378 if (!select_vert.is_empty()) {
1389 for (
const int i :
verts.index_range()) {
1390 const int vert =
verts[i];
1391 if (factors[i] == 0.0f) {
1395 const float angle_cos = use_normal ?
1396 dot_v3v3(sculpt_normal_frontface, vert_normals[vert]) :
1403 const float final_alpha = factors[i] *
brush_strength * brush_alpha_pressure;
1443 const VArraySpan hide_vert = *attributes.lookup<
bool>(
".hide_vert", bke::AttrDomain::Point);
1445 if (use_vert_sel || use_face_sel) {
1446 select_vert = *attributes.lookup<
bool>(
".select_vert", bke::AttrDomain::Point);
1459 LocalData &tls = all_tls.local();
1460 node_mask.slice(range).foreach_index([&](const int i) {
1461 const Span<int> verts = nodes[i].verts();
1462 tls.factors.resize(verts.size());
1463 const MutableSpan<float> factors = tls.factors;
1464 fill_factor_from_hide(hide_vert, verts, factors);
1465 if (!select_vert.is_empty()) {
1466 filter_factors_with_selection(select_vert, verts, factors);
1469 tls.distances.resize(verts.size());
1470 const MutableSpan<float> distances = tls.distances;
1471 calc_brush_distances(
1472 ss, vert_positions, verts, eBrushFalloffShape(brush.falloff_shape), distances);
1473 filter_distances_with_radius(cache.radius, distances, factors);
1474 calc_brush_strength_factors(cache, brush, distances, factors);
1476 for (const int i : verts.index_range()) {
1477 const int vert = verts[i];
1478 if (factors[i] == 0.0f) {
1481 const float angle_cos = use_normal ?
1482 dot_v3v3(sculpt_normal_frontface, vert_normals[vert]) :
1484 if (angle_cos <= 0.0f) {
1487 const MDeformVert &dv = wpi.dvert[vert];
1489 accum.value += wpaint_get_active_weight(dv, wpi);
1635 const bool is_mode_set = (ob.
mode & mode_flag) != 0;
1679 ot->
name =
"Weight Paint Mode";
1680 ot->
idname =
"PAINT_OT_weight_paint_toggle";
1727 for (
int i = 1; i < wp.
radial_symm[axis -
'X']; i++) {
1729 wpaint_do_paint(C, ob, wp, wpd, wpi, mesh, brush, symm, axis, i, angle);
1747 wpaint_do_paint(C, ob, wp, wpd, wpi, mesh, brush,
ePaintSymmetryFlags(0),
'X', 0, 0);
1763 for (i = 1; i <= symm; i++) {
1764 if (symm & i && (symm != 5 || i != 3) && (symm != 6 || !
ELEM(i, 3, 5))) {
1771 wpaint_do_paint(C, ob, wp, wpd, wpi, mesh, brush, symm,
'X', 0, 0);
1775 wpaint_do_paint(C, ob, wp, wpd, wpi, mesh, brush, symm,
'Y', 0, 0);
1779 wpaint_do_paint(C, ob, wp, wpd, wpi, mesh, brush, symm,
'Z', 0, 0);
1812 if (wpd ==
nullptr) {
1830 wpi.
dvert = mesh.deform_verts_for_write();
1981 ot->
name =
"Weight Paint";
1982 ot->
idname =
"PAINT_OT_weight_paint";
1983 ot->
description =
"Paint a stroke in the current vertex group's weights";
float BKE_brush_weight_get(const Scene *scene, const Brush *brush)
float BKE_brush_alpha_get(const Scene *scene, const Brush *brush)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
Depsgraph * CTX_data_depsgraph_on_load(const bContext *C)
wmMsgBus * CTX_wm_message_bus(const bContext *C)
void BKE_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
Mesh * BKE_mesh_from_object(Object *ob)
@ BKE_MESH_BATCH_DIRTY_ALL
General operations, lookup, etc. for blender objects.
const Brush * BKE_paint_brush_for_read(const Paint *paint)
Brush * BKE_paint_brush(Paint *paint)
void BKE_paint_brushes_validate(Main *bmain, Paint *paint)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Generic array manipulation API.
#define BLI_array_binary_or(arr, arr_a, arr_b, arr_len)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void swap_m4m4(float m1[4][4], float m2[4][4])
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void project_plane_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float n[3])
void BLI_rcti_union(struct rcti *rct_a, const struct rcti *rct_b)
bool BLI_rcti_is_empty(const struct rcti *rect)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ WPAINT_BRUSH_TYPE_AVERAGE
@ WPAINT_BRUSH_TYPE_SMEAR
@ BRUSH_FRONTFACE_FALLOFF
@ ME_EDIT_MIRROR_VERTEX_GROUPS
#define ME_USING_MIRROR_X_VERTEX_GROUPS(_me)
Object is a sort of wrapper for general info.
@ VP_FLAG_VGROUP_RESTRICT
#define OPERATOR_RETVAL_CHECK(ret)
int mesh_get_x_mirror_vert(Object *ob, Mesh *mesh_eval, int index, bool use_topology)
void ED_region_tag_redraw_partial(ARegion *region, const rcti *rct, bool rebuild)
bool ED_operator_region_view3d_active(bContext *C)
void ED_region_tag_redraw(ARegion *region)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
void view3d_operator_needs_opengl(const bContext *C)
Read Guarded memory(de)allocation.
static T sum(const btAlignedObjectArray< T > &items)
constexpr int64_t size() const
constexpr T * data() const
constexpr Span slice(int64_t start, int64_t size) const
void resize(const int64_t new_size)
Span< NodeT > nodes() const
IndexMask slice(IndexRange range) const
IndexRange index_range() const
local_group_size(16, 16) .push_constant(Type b
const Depsgraph * depsgraph
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void *(* MEM_mallocN)(size_t len, 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_get(Object &object)
Span< float3 > vert_normals_eval(const Depsgraph &depsgraph, const Object &object_orig)
Span< float3 > vert_positions_eval(const Depsgraph &depsgraph, const Object &object_orig)
void posemode_set_for_weight_paint(bContext *C, Main *bmain, Object *ob, bool is_mode_set)
bool mode_compat_set(bContext *C, Object *ob, eObjectMode mode, ReportList *reports)
bool brush_use_accumulate_ex(const Brush &brush, eObjectMode ob_mode)
void view_angle_limits_init(NormalAnglePrecalc *a, float angle, bool do_mask_normal)
void get_brush_alpha_data(const Scene &scene, const SculptSession &ss, const Brush &brush, float *r_brush_size_pressure, float *r_brush_alpha_value, float *r_brush_alpha_pressure)
bool use_normal(const VPaint &vp)
void mode_exit_generic(Object &ob, eObjectMode mode_flag)
void init_session_data(const ToolSettings &ts, Object &ob)
bool test_brush_angle_falloff(const Brush &brush, const NormalAnglePrecalc &normal_angle_precalc, const float angle_cos, float *brush_strength)
void mode_enter_generic(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, eObjectMode mode_flag)
void update_cache_invariants(bContext *C, VPaint &vp, SculptSession &ss, wmOperator *op, const float mval[2])
void smooth_brush_toggle_off(const bContext *C, Paint *paint, StrokeCache *cache)
bool brush_use_accumulate(const VPaint &vp)
void init_stroke(Depsgraph &depsgraph, Object &ob)
void update_cache_variants(bContext *C, VPaint &vp, Object &ob, PointerRNA *ptr)
IndexMask pbvh_gather_generic(const Depsgraph &depsgraph, const Object &ob, const VPaint &wp, const Brush &brush, IndexMaskMemory &memory)
bool mode_toggle_poll_test(bContext *C)
void last_stroke_update(Scene &scene, const float location[3])
int paint_stroke_exec(bContext *C, wmOperator *op, PaintStroke *stroke)
void calc_brush_strength_factors(const StrokeCache &cache, const Brush &brush, Span< float > distances, MutableSpan< float > factors)
void filter_distances_with_radius(float radius, Span< float > distances, MutableSpan< float > factors)
void calc_brush_distances(const SculptSession &ss, Span< float3 > vert_positions, Span< int > vert_indices, eBrushFalloffShape falloff_shape, MutableSpan< float > r_distances)
void paint_stroke_cancel(bContext *C, wmOperator *op, PaintStroke *stroke)
int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintStroke **stroke_p)
void * paint_stroke_mode_data(PaintStroke *stroke)
void paint_stroke_free(bContext *C, wmOperator *op, PaintStroke *stroke)
PaintStroke * paint_stroke_new(bContext *C, wmOperator *op, StrokeGetLocation get_location, StrokeTestStart test_start, StrokeUpdateStep update_step, StrokeRedraw redraw, StrokeDone done, int event_type)
void fill_factor_from_hide(Span< bool > hide_vert, Span< int > verts, MutableSpan< float > r_factors)
void paint_stroke_set_mode_data(PaintStroke *stroke, std::unique_ptr< PaintModeData > mode_data)
T safe_divide(const T &a, const T &b)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
float ED_wpaint_blend_tool(int tool, float weight, float paintval, float alpha)
bool ED_wpaint_ensure_data(bContext *C, ReportList *reports, enum eWPaintFlag flag, WPaintVGroupIndex *vgroup_index)
void paint_stroke_operator_properties(wmOperatorType *ot)
static int wpaint_exec(bContext *C, wmOperator *op)
static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mouse[2])
static void do_weight_paint_normalize_all(MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap)
void ED_object_wpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
void PAINT_OT_weight_paint(wmOperatorType *ot)
static void wpaint_do_paint(bContext *C, Object &ob, VPaint &wp, WPaintData &wpd, WeightPaintInfo &wpi, Mesh &mesh, Brush &brush, const ePaintSymmetryFlags symm, const int axis, const int i, const float angle)
static bool weight_paint_poll_ex(bContext *C, bool check_tool)
static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
bool weight_paint_mode_poll(bContext *C)
static void precompute_weight_values(Object &ob, const Brush &brush, WPaintData &wpd, WeightPaintInfo &wpi, Mesh &mesh)
static void do_wpaint_brush_smear(const Depsgraph &depsgraph, const Scene &scene, Object &ob, const Brush &brush, VPaint &vp, WPaintData &wpd, const WeightPaintInfo &wpi, Mesh &mesh, const IndexMask &node_mask)
static float wpaint_get_active_weight(const MDeformVert &dv, const WeightPaintInfo &wpi)
bool weight_paint_poll(bContext *C)
static float wpaint_blend(const VPaint &wp, float weight, const float alpha, float paintval, const float, const bool do_flip)
static void filter_factors_with_selection(const Span< bool > select_vert, const Span< int > verts, const MutableSpan< float > factors)
bool weight_paint_mode_region_view3d_poll(bContext *C)
static void do_weight_paint_vertex(const VPaint &wp, Object &ob, const WeightPaintInfo &wpi, const uint index, float alpha, float paintweight)
void ED_object_wpaintmode_exit(bContext *C)
static void wpaint_paint_leaves(bContext *C, Object &ob, VPaint &vp, WPaintData &wpd, WeightPaintInfo &wpi, Mesh &mesh, const IndexMask &node_mask)
static void do_wpaint_brush_blur(const Depsgraph &depsgraph, const Scene &scene, Object &ob, const Brush &brush, VPaint &vp, WPaintData &wpd, const WeightPaintInfo &wpi, Mesh &mesh, const IndexMask &node_mask)
static bool multipaint_verify_change(MDeformVert *dvert, const int defbase_tot, float change, const bool *defbase_sel)
static void do_wpaint_brush_draw(const Depsgraph &depsgraph, const Scene &scene, Object &ob, const Brush &brush, VPaint &vp, WPaintData &wpd, const WeightPaintInfo &wpi, Mesh &mesh, const float strength, const IndexMask &node_mask)
static int wpaint_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void ED_object_wpaintmode_exit_ex(Object &ob)
static float wpaint_clamp_monotonic(float oldval, float curval, float newval)
static void wpaint_stroke_done(const bContext *C, PaintStroke *)
static float wpaint_undo_lock_relative(float weight, float old_weight, float locked_weight, float free_weight, bool auto_normalize)
static void wpaint_do_radial_symmetry(bContext *C, Object &ob, VPaint &wp, WPaintData &wpd, WeightPaintInfo &wpi, Mesh &mesh, Brush &brush, const ePaintSymmetryFlags symm, const int axis)
static MDeformVert * defweight_prev_init(MDeformVert *dvert_prev, MDeformVert *dvert_curr, int index)
bool weight_paint_poll_ignore_tool(bContext *C)
static void do_weight_paint_vertex_multi(const VPaint &wp, Object &ob, const WeightPaintInfo &wpi, const uint index, float alpha, float paintweight)
static void wpaint_cancel(bContext *C, wmOperator *op)
static int wpaint_modal(bContext *C, wmOperator *op, const wmEvent *event)
void ED_object_wpaintmode_enter(bContext *C, Depsgraph &depsgraph)
void PAINT_OT_weight_paint_toggle(wmOperatorType *ot)
static float calculate_average_weight(const Depsgraph &depsgraph, Object &ob, const Mesh &mesh, const Brush &brush, const VPaint &vp, WeightPaintInfo &wpi, const IndexMask &node_mask)
static void wpaint_do_symmetrical_brush_actions(bContext *C, Object &ob, VPaint &wp, WPaintData &wpd, WeightPaintInfo &wpi)
static void multipaint_apply_change(MDeformVert *dvert, const int defbase_tot, float change, const bool *defbase_sel)
static void multipaint_clamp_change(MDeformVert *dvert, const int defbase_tot, const bool *defbase_sel, float *change_p)
static void wpaint_stroke_update_step(bContext *C, wmOperator *, PaintStroke *stroke, PointerRNA *itemptr)
static void do_weight_paint_vertex_single(const VPaint &wp, Object &ob, const WeightPaintInfo &wpi, const uint index, float alpha, float paintweight)
static void do_weight_paint_normalize_all_locked_try_active(MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap, const bool *lock_flags, const bool *lock_with_active)
static void parallel_nodes_loop_with_mirror_check(const Mesh &mesh, const IndexMask &node_mask, FunctionRef< void(IndexRange)> fn)
static bool do_weight_paint_normalize_all_locked(MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap, const bool *lock_flags)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
bool SCULPT_get_redraw_rect(const ARegion ®ion, const RegionView3D &rv3d, const Object &ob, rcti &rect)
ePaintSymmetryFlags SCULPT_mesh_symmetry_xyz_get(const Object &object)
bool SCULPT_stroke_get_location(bContext *C, float out[3], const float mval[2], bool force_original)
const float * SCULPT_brush_frontface_normal_from_falloff_shape(const SculptSession &ss, char falloff_shape)
void SCULPT_cache_calc_brushdata_symm(blender::ed::sculpt_paint::StrokeCache &cache, const ePaintSymmetryFlags symm, const char axis, const float angle)
static float brush_strength(const Sculpt &sd, const blender::ed::sculpt_paint::StrokeCache &cache, const float feather, const UnifiedPaintSettings &ups, const PaintModeSettings &)
struct SculptSession * sculpt
blender::ed::sculpt_paint::StrokeCache * cache
blender::Array< MDeformVert > dvert_prev
struct SculptSession::@49 mode
struct SculptSession::@49::@50 wpaint
const bool * vgroup_unlocked
NormalAnglePrecalc normal_angle_precalc
WeightPaintGroupData active
const bool * vgroup_validmap
const bool * vgroup_locked
bool precomputed_weight_ready
float * precomputed_weight
WeightPaintGroupData mirror
const bool * vgroup_locked
MutableSpan< MDeformVert > dvert
WeightPaintGroupData mirror
const bool * vgroup_unlocked
const bool * vgroup_validmap
WeightPaintGroupData active
Vector< float > distances
float3 last_location_symm
ePaintSymmetryFlags mirror_symmetry_pass
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* modal)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void(* cancel)(bContext *C, wmOperator *op)
struct ReportList * reports
struct wmOperatorType * type
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)