|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "BLI_array_utils.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_rect.h"#include "BLI_task.h"#include "DNA_brush_types.h"#include "DNA_mesh_types.h"#include "DNA_object_types.h"#include "DNA_particle_types.h"#include "DNA_scene_types.h"#include "RNA_access.h"#include "BKE_brush.h"#include "BKE_context.h"#include "BKE_deform.h"#include "BKE_layer.h"#include "BKE_main.h"#include "BKE_mesh.h"#include "BKE_mesh_mapping.h"#include "BKE_modifier.h"#include "BKE_object.h"#include "BKE_object_deform.h"#include "BKE_paint.h"#include "BKE_report.h"#include "BKE_subsurf.h"#include "DEG_depsgraph.h"#include "WM_api.h"#include "WM_message.h"#include "WM_toolsystem.h"#include "WM_types.h"#include "ED_armature.h"#include "ED_mesh.h"#include "ED_object.h"#include "ED_screen.h"#include "ED_view3d.h"#include "IMB_imbuf.h"#include "BKE_ccg.h"#include "bmesh.h"#include "paint_intern.h"#include "sculpt_intern.h"Go to the source code of this file.
Classes | |
| struct | VPaintAverageAccum |
| struct | WPaintAverageAccum |
| struct | NormalAnglePrecalc |
| struct | WeightPaintGroupData |
| struct | WeightPaintInfo |
| struct | WPaintData |
| struct | VPaintData |
Functions | |
Enter Vertex/Weight Paint Mode | |
| static void | ed_vwpaintmode_enter_generic (Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob, const eObjectMode mode_flag) |
| void | ED_object_vpaintmode_enter_ex (Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob) |
| void | ED_object_vpaintmode_enter (struct bContext *C, Depsgraph *depsgraph) |
| void | ED_object_wpaintmode_enter_ex (Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob) |
| void | ED_object_wpaintmode_enter (struct bContext *C, Depsgraph *depsgraph) |
Exit Vertex/Weight Paint Mode | |
| static void | ed_vwpaintmode_exit_generic (Object *ob, const eObjectMode mode_flag) |
| void | ED_object_vpaintmode_exit_ex (Object *ob) |
| void | ED_object_vpaintmode_exit (struct bContext *C) |
| void | ED_object_wpaintmode_exit_ex (Object *ob) |
| void | ED_object_wpaintmode_exit (struct bContext *C) |
Toggle Weight Paint Operator | |
| static int | wpaint_mode_toggle_exec (bContext *C, wmOperator *op) |
| static bool | paint_mode_toggle_poll_test (bContext *C) |
| void | PAINT_OT_weight_paint_toggle (wmOperatorType *ot) |
Weight Paint Operator | |
| static void | vwpaint_update_cache_invariants (bContext *C, const VPaint *vp, SculptSession *ss, wmOperator *op, const float mouse[2]) |
| static void | vwpaint_update_cache_variants (bContext *C, VPaint *vp, Object *ob, PointerRNA *ptr) |
| static bool | wpaint_stroke_test_start (bContext *C, wmOperator *op, const float mouse[2]) |
| static float | dot_vf3vs3 (const float brushNormal[3], const short vertexNormal[3]) |
| static 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) |
| static float | wpaint_get_active_weight (const MDeformVert *dv, const WeightPaintInfo *wpi) |
| static void | do_wpaint_precompute_weight_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | precompute_weight_values (bContext *C, Object *ob, Brush *brush, struct WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me) |
| static void | do_wpaint_brush_blur_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | do_wpaint_brush_smear_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | do_wpaint_brush_draw_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | do_wpaint_brush_calc_average_weight_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | calculate_average_weight (SculptThreadedTaskData *data, PBVHNode **UNUSED(nodes), int totnode) |
| static void | wpaint_paint_leaves (bContext *C, Object *ob, Sculpt *sd, VPaint *vp, struct WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me, PBVHNode **nodes, int totnode) |
| static PBVHNode ** | vwpaint_pbvh_gather_generic (Object *ob, VPaint *wp, Sculpt *sd, Brush *brush, int *r_totnode) |
| static void | wpaint_do_paint (bContext *C, Object *ob, VPaint *wp, Sculpt *sd, struct WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me, Brush *brush, const char symm, const int axis, const int i, const float angle) |
| static void | wpaint_do_radial_symmetry (bContext *C, Object *ob, VPaint *wp, Sculpt *sd, struct WPaintData *wpd, WeightPaintInfo *wpi, Mesh *me, Brush *brush, const char symm, const int axis) |
| static void | wpaint_do_symmetrical_brush_actions (bContext *C, Object *ob, VPaint *wp, Sculpt *sd, struct WPaintData *wpd, WeightPaintInfo *wpi) |
| static void | wpaint_stroke_update_step (bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) |
| static void | wpaint_stroke_done (const bContext *C, struct PaintStroke *stroke) |
| static int | wpaint_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | wpaint_exec (bContext *C, wmOperator *op) |
| static void | wpaint_cancel (bContext *C, wmOperator *op) |
| void | PAINT_OT_weight_paint (wmOperatorType *ot) |
Toggle Vertex Paint Operator | |
| static int | vpaint_mode_toggle_exec (bContext *C, wmOperator *op) |
| void | PAINT_OT_vertex_paint_toggle (wmOperatorType *ot) |
Vertex Paint Operator | |
| static bool | vpaint_stroke_test_start (bContext *C, struct wmOperator *op, const float mouse[2]) |
| static void | do_vpaint_brush_calc_average_color_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static float | tex_color_alpha_ubyte (SculptThreadedTaskData *data, const float v_co[3], uint *r_color) |
| static void | do_vpaint_brush_draw_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | do_vpaint_brush_blur_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | do_vpaint_brush_smear_task_cb_ex (void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls)) |
| static void | calculate_average_color (SculptThreadedTaskData *data, PBVHNode **UNUSED(nodes), int totnode) |
| static void | vpaint_paint_leaves (bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob, Mesh *me, PBVHNode **nodes, int totnode) |
| static void | vpaint_do_paint (bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob, Mesh *me, Brush *brush, const char symm, const int axis, const int i, const float angle) |
| static void | vpaint_do_radial_symmetry (bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob, Mesh *me, Brush *brush, const char symm, const int axis) |
| static void | vpaint_do_symmetrical_brush_actions (bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob) |
| static void | vpaint_stroke_update_step (bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) |
| static void | vpaint_stroke_done (const bContext *C, struct PaintStroke *stroke) |
| static int | vpaint_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static int | vpaint_exec (bContext *C, wmOperator *op) |
| static void | vpaint_cancel (bContext *C, wmOperator *op) |
| void | PAINT_OT_vertex_paint (wmOperatorType *ot) |
Internal Utilities | |
| typedef struct WeightPaintInfo | WeightPaintInfo |
| static void | view_angle_limits_init (struct NormalAnglePrecalc *a, float angle, bool do_mask_normal) |
| static float | view_angle_limits_apply_falloff (const struct NormalAnglePrecalc *a, float angle_cos, float *mask_p) |
| static bool | vwpaint_use_normal (const VPaint *vp) |
| static bool | brush_use_accumulate_ex (const Brush *brush, const int ob_mode) |
| static bool | brush_use_accumulate (const VPaint *vp) |
| static MDeformVert * | defweight_prev_init (MDeformVert *dvert_prev, MDeformVert *dvert_curr, int index) |
| static bool | vertex_paint_use_fast_update_check (Object *ob) |
| static void | paint_last_stroke_update (Scene *scene, const float location[3]) |
| bool | vertex_paint_mode_poll (bContext *C) |
| static bool | vertex_paint_poll_ex (bContext *C, bool check_tool) |
| bool | vertex_paint_poll (bContext *C) |
| bool | vertex_paint_poll_ignore_tool (bContext *C) |
| bool | weight_paint_mode_poll (bContext *C) |
| static bool | weight_paint_poll_ex (bContext *C, bool check_tool) |
| bool | weight_paint_poll (bContext *C) |
| bool | weight_paint_poll_ignore_tool (bContext *C) |
| uint | vpaint_get_current_col (Scene *scene, VPaint *vp, bool secondary) |
| static uint | vpaint_blend (const VPaint *vp, uint color_curr, uint color_orig, uint color_paint, const int alpha_i, const int brush_alpha_value_i) |
| static void | tex_color_alpha (VPaint *vp, const ViewContext *vc, const float co[3], float r_rgba[4]) |
| static float | wpaint_blend (const VPaint *wp, float weight, const float alpha, float paintval, const float UNUSED(brush_alpha_value), const short do_flip) |
| static float | wpaint_clamp_monotonic (float oldval, float curval, float newval) |
| static float | wpaint_undo_lock_relative (float weight, float old_weight, float locked_weight, float free_weight, bool auto_normalize) |
| static void | do_weight_paint_normalize_all (MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap) |
| static bool | do_weight_paint_normalize_all_locked (MDeformVert *dvert, const int defbase_tot, const bool *vgroup_validmap, const bool *lock_flags) |
| 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 | multipaint_clamp_change (MDeformVert *dvert, const int defbase_tot, const bool *defbase_sel, float *change_p) |
| static bool | multipaint_verify_change (MDeformVert *dvert, const int defbase_tot, float change, const bool *defbase_sel) |
| static void | multipaint_apply_change (MDeformVert *dvert, const int defbase_tot, float change, const bool *defbase_sel) |
| 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_vertex_multi (const VPaint *wp, Object *ob, const WeightPaintInfo *wpi, const uint index, float alpha, float paintweight) |
| static void | do_weight_paint_vertex (const VPaint *wp, Object *ob, const WeightPaintInfo *wpi, const uint index, float alpha, float paintweight) |
| static void | vertex_paint_init_session (Depsgraph *depsgraph, Scene *scene, Object *ob, eObjectMode object_mode) |
| static void | vertex_paint_init_stroke (Depsgraph *depsgraph, Object *ob) |
| static void | vertex_paint_init_session_data (const ToolSettings *ts, Object *ob) |
Used for vertex color & weight paint and mode switching.
paint_vertex_color_ops.c & paint_vertex_weight_ops.c for general purpose operators. Definition in file paint_vertex.c.
| typedef struct WeightPaintInfo WeightPaintInfo |
|
static |
Definition at line 160 of file paint_vertex.c.
References Paint::brush, brush_use_accumulate_ex(), Paint_Runtime::ob_mode, VPaint::paint, and Paint::runtime.
Referenced by do_weight_paint_vertex_multi(), do_weight_paint_vertex_single(), vertex_paint_init_session_data(), and vpaint_blend().
|
static |
Definition at line 153 of file paint_vertex.c.
References BRUSH_ACCUMULATE, Brush::flag, OB_MODE_VERTEX_PAINT, Brush::vertexpaint_tool, VPAINT_TOOL_SMEAR, Brush::weightpaint_tool, and WPAINT_TOOL_SMEAR.
Referenced by brush_use_accumulate(), and precompute_weight_values().
|
static |
Definition at line 3214 of file paint_vertex.c.
References BKE_pbvh_parallel_range_settings(), blend(), BLI_task_parallel_range(), data, divide_round_i(), do_vpaint_brush_calc_average_color_cb_ex(), VPaintAverageAccum::len, MEM_mallocN, MEM_SAFE_FREE, round_fl_to_uchar(), sqrtf, and VPaintAverageAccum::value.
Referenced by vpaint_paint_leaves().
|
static |
Definition at line 2138 of file paint_vertex.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, do_wpaint_brush_calc_average_weight_cb_ex(), float(), WPaintAverageAccum::len, MEM_mallocN, MEM_SAFE_FREE, and WPaintAverageAccum::value.
Referenced by wpaint_paint_leaves().
|
static |
Definition at line 165 of file paint_vertex.c.
References BKE_defvert_copy(), and MDeformVert::flag.
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
|
static |
Definition at line 2953 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, blend(), BLI_assert, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, col, MeshElemMap::count, CTX_data_scene(), data, SculptBrushTest::dist, divide_round_i(), dot_vf3vs3(), Brush::flag, MPoly::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, MeshElemMap::indices, MPoly::loopstart, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, ME_FACE_SEL, SculptSession::mode, PBVHVertexIter::no, NULL, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, round_fl_to_uchar(), scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, MPoly::totloop, PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_loop, SculptVertexPaintGeomMap::vert_to_poly, view_angle_limits_apply_falloff(), SculptSession::vpaint, vpaint_blend(), and vwpaint_use_normal().
Referenced by vpaint_paint_leaves().
|
static |
Definition at line 2790 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptSession::cache, PBVHVertexIter::co, col, MeshElemMap::count, data, PBVHVertexIter::g, PBVHVertexIter::grid_indices, PBVHVertexIter::i, MeshElemMap::indices, VPaintAverageAccum::len, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, SculptSession::mode, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, SCULPT_brush_test_init_with_falloff_shape(), SELECT, VPaintAverageAccum::value, PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_loop, and SculptSession::vpaint.
Referenced by calculate_average_color().
|
static |
Definition at line 2855 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_assert, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, MeshElemMap::count, CTX_data_scene(), data, SculptBrushTest::dist, dot_vf3vs3(), Brush::flag, MPoly::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, MeshElemMap::indices, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, ME_FACE_SEL, SculptSession::mode, PBVHVertexIter::no, NULL, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, tex_color_alpha_ubyte(), PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_loop, SculptVertexPaintGeomMap::vert_to_poly, view_angle_limits_apply_falloff(), SculptSession::vpaint, vpaint_blend(), and vwpaint_use_normal().
Referenced by vpaint_paint_leaves().
|
static |
Definition at line 3070 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BLI_assert, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, MVert::co, MeshElemMap::count, CTX_data_scene(), data, SculptBrushTest::dist, dot_v3v3(), dot_vf3vs3(), Brush::flag, MVert::flag, MPoly::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, MeshElemMap::indices, StrokeCache::is_last_valid, StrokeCache::last_location, StrokeCache::location, MPoly::loopstart, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, ME_FACE_SEL, SculptSession::mode, PBVHVertexIter::no, normalize_v3(), NULL, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, project_plane_v3_v3v3(), StrokeCache::radius, scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, sub_v3_v3v3(), MPoly::totloop, UNUSED_VARS_NDEBUG, MLoop::v, PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_loop, SculptVertexPaintGeomMap::vert_to_poly, view_angle_limits_apply_falloff(), StrokeCache::view_normal, SculptSession::vpaint, vpaint_blend(), and vwpaint_use_normal().
Referenced by vpaint_paint_leaves().
|
static |
Definition at line 444 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, sum(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_normalize_all_locked().
|
static |
A version of do_weight_paint_normalize_all that includes locked weights but only changes unlocked weights.
Definition at line 488 of file paint_vertex.c.
References CLAMP, MDeformWeight::def_nr, do_weight_paint_normalize_all(), MDeformVert::dw, NULL, sum(), MDeformVert::totweight, VERTEX_WEIGHT_LOCK_EPSILON, and MDeformWeight::weight.
Referenced by do_weight_paint_normalize_all_locked_try_active().
|
static |
Locks prevented the first pass from full completion, so remove restriction on active group; e.g:
Definition at line 574 of file paint_vertex.c.
References do_weight_paint_normalize_all_locked().
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
|
static |
Definition at line 1089 of file paint_vertex.c.
References alpha, WeightPaintInfo::do_multipaint, do_weight_paint_vertex_multi(), do_weight_paint_vertex_single(), and WeightPaintGroupData::index.
Referenced by do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), and do_wpaint_brush_smear_task_cb_ex().
|
static |
Definition at line 960 of file paint_vertex.c.
References alpha, BKE_defvert_calc_lock_relative_weight(), BKE_defvert_lock_relative_weight(), BKE_defvert_multipaint_collective_weight(), BKE_defvert_total_selected_weight(), WeightPaintInfo::brush_alpha_value, brush_use_accumulate(), CLAMP, Object::data, WeightPaintInfo::defbase_sel, WeightPaintInfo::defbase_tot, WeightPaintInfo::defbase_tot_sel, defweight_prev_init(), WeightPaintInfo::do_auto_normalize, WeightPaintInfo::do_flip, WeightPaintInfo::do_lock_relative, do_weight_paint_normalize_all_locked_try_active(), Mesh::dvert, Mesh::editflag, ELEM, WeightPaintGroupData::index, WeightPaintInfo::is_normalized, WeightPaintInfo::lock_flags, ME_EDIT_MIRROR_TOPO, ME_USING_MIRROR_X_VERTEX_GROUPS, mesh_get_x_mirror_vert(), SculptSession::mode, multipaint_apply_change(), multipaint_clamp_change(), multipaint_verify_change(), NULL, Object::sculpt, WeightPaintInfo::vgroup_locked, WeightPaintInfo::vgroup_unlocked, WeightPaintInfo::vgroup_validmap, SculptSession::wpaint, wpaint_blend(), wpaint_clamp_monotonic(), and wpaint_undo_lock_relative().
Referenced by do_weight_paint_vertex().
|
static |
Definition at line 747 of file paint_vertex.c.
References alpha, BKE_defvert_calc_lock_relative_weight(), BKE_defvert_ensure_index(), BKE_defvert_find_index(), BKE_defvert_find_weight(), BKE_defvert_lock_relative_weight(), BKE_defvert_total_selected_weight(), WeightPaintInfo::brush_alpha_value, brush_use_accumulate(), CLAMP, Object::data, WeightPaintInfo::defbase_tot, defweight_prev_init(), WeightPaintInfo::do_auto_normalize, WeightPaintInfo::do_flip, WeightPaintInfo::do_lock_relative, do_weight_paint_normalize_all_locked_try_active(), Mesh::dvert, MDeformVert::dw, Mesh::editflag, VPaint::flag, WeightPaintGroupData::index, WeightPaintGroupData::lock, WeightPaintInfo::lock_flags, ME_EDIT_MIRROR_TOPO, ME_USING_MIRROR_X_VERTEX_GROUPS, mesh_get_x_mirror_vert(), WeightPaintInfo::mirror, SculptSession::mode, NULL, Object::sculpt, MDeformVert::totweight, VERTEX_WEIGHT_LOCK_EPSILON, WeightPaintInfo::vgroup_locked, WeightPaintInfo::vgroup_unlocked, WeightPaintInfo::vgroup_validmap, VP_FLAG_VGROUP_RESTRICT, MDeformWeight::weight, SculptSession::wpaint, wpaint_blend(), wpaint_clamp_monotonic(), and wpaint_undo_lock_relative().
Referenced by do_weight_paint_vertex().
|
static |
Definition at line 1815 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BRUSH_ACCUMULATE, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, MeshElemMap::count, CTX_data_scene(), data, SculptBrushTest::dist, do_weight_paint_vertex(), dot_vf3vs3(), Brush::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, MeshElemMap::indices, MPoly::loopstart, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, SculptSession::mode, PBVHVertexIter::no, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, MPoly::totloop, MLoop::v, PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_poly, view_angle_limits_apply_falloff(), vwpaint_use_normal(), and SculptSession::wpaint.
Referenced by wpaint_paint_leaves().
|
static |
Definition at line 2089 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, SculptSession::cache, PBVHVertexIter::co, data, dot_vf3vs3(), PBVHVertexIter::g, PBVHVertexIter::grid_indices, PBVHVertexIter::i, WPaintAverageAccum::len, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, PBVHVertexIter::no, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, WPaintAverageAccum::value, PBVHVertexIter::vert_indices, vwpaint_use_normal(), and wpaint_get_active_weight().
Referenced by calculate_average_weight().
|
static |
Definition at line 2016 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BRUSH_ACCUMULATE, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, CTX_data_scene(), data, SculptBrushTest::dist, do_weight_paint_vertex(), dot_vf3vs3(), Brush::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, SculptSession::mode, PBVHVertexIter::no, SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, StrokeCache::radius, scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, PBVHVertexIter::vert_indices, view_angle_limits_apply_falloff(), vwpaint_use_normal(), and SculptSession::wpaint.
Referenced by wpaint_paint_leaves().
|
static |
Definition at line 1906 of file paint_vertex.c.
References BKE_brush_curve_strength(), BKE_pbvh_type(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, brush_strength(), StrokeCache::bstrength, SculptSession::cache, PBVHVertexIter::co, MVert::co, MeshElemMap::count, CTX_data_scene(), data, SculptBrushTest::dist, do_weight_paint_vertex(), dot_v3v3(), dot_vf3vs3(), Brush::flag, MVert::flag, PBVHVertexIter::g, get_brush_alpha_data(), PBVHVertexIter::grid_indices, PBVHVertexIter::gridsize, PBVHVertexIter::i, MeshElemMap::indices, StrokeCache::is_last_valid, StrokeCache::last_location, StrokeCache::location, MPoly::loopstart, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, SculptSession::mode, PBVHVertexIter::no, normalize_v3(), SculptSession::pbvh, PBVH_GRIDS, PBVH_ITER_UNIQUE, project_plane_v3_v3v3(), StrokeCache::radius, scene, SCULPT_brush_frontface_normal_from_falloff_shape(), SCULPT_brush_test_init_with_falloff_shape(), SELECT, sqrtf, sub_v3_v3v3(), MPoly::totloop, MLoop::v, PBVHVertexIter::vert_indices, SculptVertexPaintGeomMap::vert_to_poly, view_angle_limits_apply_falloff(), StrokeCache::view_normal, vwpaint_use_normal(), and SculptSession::wpaint.
Referenced by wpaint_paint_leaves().
|
static |
Definition at line 1782 of file paint_vertex.c.
References data, and wpaint_get_active_weight().
Referenced by precompute_weight_values().
Definition at line 1741 of file paint_vertex.c.
References dot_v3v3(), normal, and normal_short_to_float_v3().
Referenced by do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_calc_average_weight_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), and do_wpaint_brush_smear_task_cb_ex().
Definition at line 1266 of file paint_vertex.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), depsgraph, ED_object_vpaintmode_enter_ex(), and scene.
| void ED_object_vpaintmode_enter_ex | ( | Main * | bmain, |
| Depsgraph * | depsgraph, | ||
| Scene * | scene, | ||
| Object * | ob | ||
| ) |
Definition at line 1262 of file paint_vertex.c.
References depsgraph, ed_vwpaintmode_enter_generic(), OB_MODE_VERTEX_PAINT, and scene.
Referenced by ED_editors_init(), ED_object_vpaintmode_enter(), and vpaint_mode_toggle_exec().
| void ED_object_vpaintmode_exit | ( | struct bContext * | C | ) |
Definition at line 1343 of file paint_vertex.c.
References C, CTX_data_active_object(), and ED_object_vpaintmode_exit_ex().
| void ED_object_vpaintmode_exit_ex | ( | Object * | ob | ) |
Definition at line 1339 of file paint_vertex.c.
References ed_vwpaintmode_exit_generic(), and OB_MODE_VERTEX_PAINT.
Referenced by ed_object_mode_generic_exit_ex(), ED_object_vpaintmode_exit(), and vpaint_mode_toggle_exec().
Definition at line 1278 of file paint_vertex.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), depsgraph, ED_object_wpaintmode_enter_ex(), and scene.
| void ED_object_wpaintmode_enter_ex | ( | Main * | bmain, |
| Depsgraph * | depsgraph, | ||
| Scene * | scene, | ||
| Object * | ob | ||
| ) |
Definition at line 1274 of file paint_vertex.c.
References depsgraph, ed_vwpaintmode_enter_generic(), OB_MODE_WEIGHT_PAINT, and scene.
Referenced by ED_editors_init(), ED_object_wpaintmode_enter(), and wpaint_mode_toggle_exec().
| void ED_object_wpaintmode_exit | ( | struct bContext * | C | ) |
Definition at line 1353 of file paint_vertex.c.
References C, CTX_data_active_object(), and ED_object_wpaintmode_exit_ex().
| void ED_object_wpaintmode_exit_ex | ( | Object * | ob | ) |
Definition at line 1349 of file paint_vertex.c.
References ed_vwpaintmode_exit_generic(), and OB_MODE_WEIGHT_PAINT.
Referenced by ed_object_mode_generic_exit_ex(), ED_object_wpaintmode_exit(), and wpaint_mode_toggle_exec().
|
static |
Definition at line 1211 of file paint_vertex.c.
References BKE_mesh_from_object(), BKE_object_free_derived_caches(), BKE_paint_ensure(), BKE_paint_get_active_from_paintmode(), BKE_paint_init(), BKE_sculptsession_free(), BLI_assert, SculptSession::cache, DEG_id_tag_update(), depsgraph, ED_mesh_color_ensure(), ED_mesh_mirror_spatial_table_end(), ED_vgroup_sync_from_pose(), Object::id, ID_RECALC_COPY_ON_WRITE, Object::mode, NULL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, paint_cursor_start(), PAINT_CURSOR_VERTEX_PAINT, PAINT_CURSOR_WEIGHT_PAINT, PAINT_MODE_VERTEX, PAINT_MODE_WEIGHT, scene, Object::sculpt, SCULPT_cache_free(), Scene::toolsettings, vertex_paint_init_session(), vertex_paint_poll(), ToolSettings::vpaint, weight_paint_poll(), and ToolSettings::wpaint.
Referenced by ED_object_vpaintmode_enter_ex(), and ED_object_wpaintmode_enter_ex().
|
static |
Definition at line 1292 of file paint_vertex.c.
References BKE_mesh_flush_select_from_polys(), BKE_mesh_flush_select_from_verts(), BKE_mesh_from_object(), BKE_object_free_derived_caches(), BKE_sculptsession_free(), BLI_assert, SculptSession::cache, DEG_id_tag_update(), ED_mesh_mirror_spatial_table_end(), ED_mesh_mirror_topo_table_end(), Mesh::editflag, Object::id, ID_RECALC_COPY_ON_WRITE, ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, Object::mode, NULL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, paint_cursor_delete_textures(), Object::sculpt, and SCULPT_cache_free().
Referenced by ED_object_vpaintmode_exit_ex(), and ED_object_wpaintmode_exit_ex().
|
static |
Definition at line 1748 of file paint_vertex.c.
References BKE_brush_alpha_get(), BKE_brush_size_get(), BKE_brush_use_alpha_pressure(), BKE_brush_use_size_pressure(), SculptSession::cache, StrokeCache::pressure, and scene.
Referenced by do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), and do_wpaint_brush_smear_task_cb_ex().
|
static |
Definition at line 672 of file paint_vertex.c.
References CLAMP, MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex_multi().
|
static |
Definition at line 619 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex_multi().
|
static |
Definition at line 644 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex_multi().
Definition at line 194 of file paint_vertex.c.
References add_v3_v3(), UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, UnifiedPaintSettings::last_stroke_valid, scene, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by vpaint_stroke_update_step(), and wpaint_stroke_update_step().
|
static |
Definition at line 1417 of file paint_vertex.c.
References C, CTX_data_active_object(), Object::data, ID_IS_LINKED, NULL, OB_MESH, and Object::type.
Referenced by PAINT_OT_vertex_paint_toggle(), and PAINT_OT_weight_paint_toggle().
| void PAINT_OT_vertex_paint | ( | wmOperatorType * | ot | ) |
Definition at line 3512 of file paint_vertex.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_UNDO, ot, paint_stroke_modal(), paint_stroke_operator_properties(), wmOperatorType::poll, vertex_paint_poll(), vpaint_cancel(), vpaint_exec(), and vpaint_invoke().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_vertex_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 2645 of file paint_vertex.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_mode_toggle_poll_test(), wmOperatorType::poll, and vpaint_mode_toggle_exec().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_paint | ( | wmOperatorType * | ot | ) |
Definition at line 2571 of file paint_vertex.c.
References wmOperatorType::cancel, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_UNDO, ot, paint_stroke_modal(), paint_stroke_operator_properties(), wmOperatorType::poll, weight_paint_poll(), wpaint_cancel(), wpaint_exec(), and wpaint_invoke().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 1429 of file paint_vertex.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_mode_toggle_poll_test(), wmOperatorType::poll, and wpaint_mode_toggle_exec().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 1792 of file paint_vertex.c.
References BLI_parallel_range_settings_defaults(), BLI_task_parallel_range(), brush_use_accumulate_ex(), C, data, do_wpaint_precompute_weight_cb_ex(), Object::mode, WPaintData::precomputed_weight_ready, and Mesh::totvert.
Referenced by wpaint_stroke_update_step().
|
static |
Definition at line 340 of file paint_vertex.c.
References BKE_brush_sample_tex_3d(), BKE_paint_brush(), BLI_assert, MTex::brush_map_mode, ED_view3d_project_float_object(), Brush::mtex, MTEX_MAP_MODE_3D, NULL, VPaint::paint, ViewContext::region, ViewContext::scene, MTex::tex, V3D_PROJ_RET_OK, V3D_PROJ_TEST_CLIP_BB, V3D_PROJ_TEST_CLIP_NEAR, and zero_v4().
Referenced by tex_color_alpha_ubyte().
|
static |
Definition at line 2842 of file paint_vertex.c.
References data, mul_v3_v3(), rgb_float_to_uchar(), rgb_uchar_to_float(), and tex_color_alpha().
Referenced by do_vpaint_brush_draw_task_cb_ex().
|
static |
Definition at line 1108 of file paint_vertex.c.
References BKE_sculpt_toolsettings_data_ensure(), BKE_sculpt_update_object_for_edit(), BLI_assert, depsgraph, MEM_callocN, SculptSession::mode_type, NULL, scene, and Object::sculpt.
Referenced by ed_vwpaintmode_enter_generic().
|
static |
Definition at line 1127 of file paint_vertex.c.
References BKE_defvert_array_free_elems(), BKE_mesh_vert_loop_map_create(), BKE_mesh_vert_poly_map_create(), BLI_assert, brush_use_accumulate(), Object::data, MDeformVert::flag, MEM_callocN, MEM_freeN, MEM_SAFE_FREE, Mesh::mloop, SculptSession::mode, Object::mode, SculptSession::mode_type, Mesh::mpoly, NULL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, SculptVertexPaintGeomMap::poly_map_mem, Object::sculpt, Mesh::totloop, Mesh::totpoly, Mesh::totvert, SculptVertexPaintGeomMap::vert_map_mem, SculptVertexPaintGeomMap::vert_to_loop, SculptVertexPaintGeomMap::vert_to_poly, SculptSession::vpaint, ToolSettings::vpaint, SculptSession::wpaint, and ToolSettings::wpaint.
Referenced by vpaint_stroke_test_start(), and wpaint_stroke_test_start().
Definition at line 1122 of file paint_vertex.c.
References BKE_sculpt_update_object_for_edit(), and depsgraph.
Referenced by vpaint_stroke_test_start(), and wpaint_stroke_test_start().
| bool vertex_paint_mode_poll | ( | bContext * | C | ) |
Definition at line 205 of file paint_vertex.c.
References C, CTX_data_active_object(), Object::data, Object::mode, and OB_MODE_VERTEX_PAINT.
Referenced by ED_keymap_paint(), PAINT_OT_vertex_color_brightness_contrast(), PAINT_OT_vertex_color_hsv(), PAINT_OT_vertex_color_invert(), PAINT_OT_vertex_color_levels(), PAINT_OT_vertex_color_set(), PAINT_OT_vertex_color_smooth(), and vertex_paint_poll_ex().
| bool vertex_paint_poll | ( | bContext * | C | ) |
Definition at line 228 of file paint_vertex.c.
References C, and vertex_paint_poll_ex().
Referenced by ed_vwpaintmode_enter_generic(), and PAINT_OT_vertex_paint().
|
static |
Definition at line 212 of file paint_vertex.c.
References blender::compositor::area(), BKE_paint_brush(), C, CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_VIEW3D, vertex_paint_mode_poll(), and WM_toolsystem_active_tool_is_brush().
Referenced by vertex_paint_poll(), and vertex_paint_poll_ignore_tool().
| bool vertex_paint_poll_ignore_tool | ( | bContext * | C | ) |
Definition at line 233 of file paint_vertex.c.
References C, and vertex_paint_poll_ex().
Referenced by sample_color_poll().
|
static |
Definition at line 180 of file paint_vertex.c.
References BKE_mesh_from_object(), BKE_object_get_evaluated_mesh(), CD_MLOOPCOL, CustomData_get_layer(), Mesh::ldata, Mesh::mloopcol, and NULL.
Referenced by vpaint_stroke_test_start().
|
static |
Definition at line 132 of file paint_vertex.c.
References Freestyle::a, and acosf.
Referenced by do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), and do_wpaint_brush_smear_task_cb_ex().
|
static |
Definition at line 108 of file paint_vertex.c.
References Freestyle::a, angle(), cosf, float(), M_PI_2, and RAD2DEGF.
Referenced by vpaint_stroke_test_start(), and wpaint_stroke_test_start().
|
static |
Definition at line 285 of file paint_vertex.c.
References Freestyle::a, Brush::blend, blend(), Paint::brush, BRUSH_LOCK_ALPHA, brush_use_accumulate(), ED_vpaint_blend_tool(), ELEM, Brush::flag, IMB_BLEND_ADD_ALPHA, IMB_BLEND_ERASE_ALPHA, and VPaint::paint.
Referenced by do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), and do_vpaint_brush_smear_task_cb_ex().
|
static |
Definition at line 3501 of file paint_vertex.c.
References C, SculptSession::cache, CTX_data_active_object(), NULL, paint_stroke_cancel(), Object::sculpt, and SCULPT_cache_free().
Referenced by PAINT_OT_vertex_paint().
|
static |
Definition at line 3286 of file paint_vertex.c.
References angle(), C, SculptSession::cache, MEM_freeN, StrokeCache::radial_symmetry_pass, Object::sculpt, SCULPT_cache_calc_brushdata_symm(), vpaint_paint_leaves(), and vwpaint_pbvh_gather_generic().
Referenced by vpaint_do_radial_symmetry(), and vpaint_do_symmetrical_brush_actions().
|
static |
Definition at line 3313 of file paint_vertex.c.
References angle(), C, M_PI, VPaint::radial_symm, and vpaint_do_paint().
Referenced by vpaint_do_symmetrical_brush_actions().
|
static |
Definition at line 3331 of file paint_vertex.c.
References BKE_paint_brush(), C, SculptSession::cache, copy_v3_v3(), Object::data, StrokeCache::is_last_valid, StrokeCache::mirror_symmetry_pass, VPaint::paint, StrokeCache::radial_symmetry_pass, Object::sculpt, SCULPT_cache_calc_brushdata_symm(), SCULPT_mesh_symmetry_xyz_get(), StrokeCache::symmetry, StrokeCache::true_last_location, StrokeCache::true_location, vpaint_do_paint(), and vpaint_do_radial_symmetry().
Referenced by vpaint_stroke_update_step().
|
static |
Definition at line 3484 of file paint_vertex.c.
References C, wmOperator::customdata, NULL, OPERATOR_FINISHED, paint_stroke_exec(), paint_stroke_new(), SCULPT_stroke_get_location(), vpaint_stroke_done(), vpaint_stroke_test_start(), and vpaint_stroke_update_step().
Referenced by PAINT_OT_vertex_paint().
Definition at line 273 of file paint_vertex.c.
References BKE_brush_color_get(), BKE_brush_secondary_color_get(), BKE_paint_brush(), col, VPaint::paint, rgb_float_to_uchar(), and scene.
Referenced by vertex_color_set_exec(), and vpaint_stroke_test_start().
|
static |
Definition at line 3457 of file paint_vertex.c.
References BLI_assert, C, wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, paint_stroke_free(), paint_stroke_new(), SCULPT_stroke_get_location(), wmOperator::type, wmEvent::type, vpaint_stroke_done(), vpaint_stroke_test_start(), vpaint_stroke_update_step(), and WM_event_add_modal_handler().
Referenced by PAINT_OT_vertex_paint().
|
static |
Definition at line 2600 of file paint_vertex.c.
References BKE_mesh_batch_cache_dirty_tag(), BKE_MESH_BATCH_DIRTY_ALL, BKE_mesh_from_object(), BKE_paint_toolslots_brush_validate(), C, CTX_data_active_object(), CTX_data_depsgraph_on_load(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_message_bus(), Object::data, DEG_id_tag_update(), depsgraph, ED_object_mode_compat_set(), ED_object_vpaintmode_enter_ex(), ED_object_vpaintmode_exit_ex(), Mesh::id, Object::id, Object::mode, NC_SCENE, ND_MODE, OB_MODE_VERTEX_PAINT, OPERATOR_CANCELLED, OPERATOR_FINISHED, VPaint::paint, wmOperator::reports, scene, Scene::toolsettings, ToolSettings::vpaint, WM_event_add_notifier(), WM_msg_publish_rna_prop, and WM_toolsystem_update_from_context_view3d().
Referenced by PAINT_OT_vertex_paint_toggle().
|
static |
Definition at line 3245 of file paint_vertex.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), StrokeCache::brush, C, SculptSession::cache, calculate_average_color(), data, do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), Mesh::mloopcol, Object::sculpt, Brush::vertexpaint_tool, VPAINT_TOOL_AVERAGE, VPAINT_TOOL_BLUR, VPAINT_TOOL_DRAW, and VPAINT_TOOL_SMEAR.
Referenced by vpaint_do_paint().
|
static |
Definition at line 3429 of file paint_vertex.c.
References C, SculptSession::cache, VPaintData::color_curr, VPaintData::color_prev, ED_vpaint_proj_handle_free(), VPaintData::is_texbrush, MEM_freeN, VPaintData::mlooptag, NC_OBJECT, ND_DRAW, NULL, ViewContext::obact, paint_stroke_mode_data(), Object::sculpt, SCULPT_cache_free(), VPaintData::smear, VPaintData::vc, VPaintData::vp_handle, and WM_event_add_notifier().
Referenced by vpaint_exec(), and vpaint_invoke().
|
static |
Definition at line 2712 of file paint_vertex.c.
References BKE_mesh_from_object(), BKE_paint_brush(), PaintStroke::brush, Paint::brush, BRUSH_FRONTFACE_FALLOFF, BRUSH_STROKE_INVERT, SculptSession::building_vp_handle, C, VPaintData::color_curr, VPaintData::color_prev, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), wmOperator::customdata, depsgraph, ED_mesh_color_ensure(), ED_view3d_viewcontext_init(), ED_vpaint_proj_handle_create(), Brush::falloff_angle, Brush::flag, if(), VPaintData::is_texbrush, MEM_callocN, MEM_dupallocN, MEM_mallocN, Mesh::mloopcol, VPaintData::mlooptag, SculptSession::mode, Brush::mtex, VPaintData::normal_angle_precalc, NULL, VPaint::paint, paint_stroke_set_mode_data(), VPaintData::paintcol, wmOperator::ptr, RNA_enum_get(), scene, Object::sculpt, VPaintData::smear, MTex::tex, Scene::toolsettings, Mesh::totloop, Mesh::totpoly, VPaintData::use_fast_update, VPaintData::vc, vertex_paint_init_session_data(), vertex_paint_init_stroke(), vertex_paint_use_fast_update_check(), VPaintData::vertexcosnos, Brush::vertexpaint_tool, view_angle_limits_init(), VPaintData::vp_handle, SculptSession::vpaint, ToolSettings::vpaint, vpaint_get_current_col(), VPAINT_TOOL_BLUR, VPAINT_TOOL_SMEAR, and vwpaint_update_cache_invariants().
Referenced by vpaint_exec(), and vpaint_invoke().
|
static |
Definition at line 3377 of file paint_vertex.c.
References BKE_mesh_batch_cache_dirty_tag(), BKE_MESH_BATCH_DIRTY_ALL, Paint::brush, C, SculptSession::cache, VPaintData::color_curr, VPaintData::color_prev, CTX_data_scene(), CTX_data_tool_settings(), Object::data, DEG_id_tag_update(), ED_region_tag_redraw(), ED_view3d_init_mats_rv3d(), ID_RECALC_COPY_ON_WRITE, mul_m4_m4m4(), mul_v3_m4v3(), ViewContext::obact, Object::obmat, VPaint::paint, paint_last_stroke_update(), paint_stroke_mode_data(), RegionView3D::persmat, ViewContext::region, ViewContext::rv3d, scene, Object::sculpt, ToolSettings::sculpt, VPaintData::smear, swap_m4m4(), StrokeCache::true_location, VPaintData::use_fast_update, VPaintData::vc, Brush::vertexpaint_tool, ToolSettings::vpaint, vpaint_do_symmetrical_brush_actions(), VPAINT_TOOL_SMEAR, and vwpaint_update_cache_variants().
Referenced by vpaint_exec(), and vpaint_invoke().
|
static |
Definition at line 2214 of file paint_vertex.c.
References BKE_pbvh_search_gather(), SculptSession::cache, copy_v3_v3(), data, dist_squared_ray_to_aabb_v3_precalc(), Brush::falloff_shape, StrokeCache::location, NULL, PAINT_FALLOFF_SHAPE_SPHERE, SculptSession::pbvh, StrokeCache::radius_squared, Object::sculpt, StrokeCache::sculpt_normal_symm, SCULPT_pbvh_calc_area_normal(), SCULPT_search_circle_cb(), SCULPT_search_sphere_cb(), StrokeCache::view_normal, vwpaint_use_normal(), and zero_v3().
Referenced by vpaint_do_paint(), and wpaint_do_paint().
|
static |
Definition at line 1477 of file paint_vertex.c.
References StrokeCache::alt_smooth, BKE_brush_alpha_get(), StrokeCache::brush, Paint::brush, BRUSH_STROKE_INVERT, BRUSH_STROKE_SMOOTH, StrokeCache::bstrength, C, SculptSession::cache, copy_m3_m4(), copy_v2_v2(), copy_v3_v3(), CTX_data_active_object(), CTX_data_scene(), CTX_data_tool_settings(), wmOperator::customdata, UnifiedPaintSettings::draw_inverted, ED_view3d_ob_project_mat_get(), StrokeCache::first_time, Object::imat, StrokeCache::initial_mouse, StrokeCache::invert, invert_m4_m4(), StrokeCache::is_last_valid, MEM_callocN, StrokeCache::mouse, mul_m3_v3(), normalize_v3_v3(), Object::obmat, VPaint::paint, paint_stroke_view_context(), StrokeCache::projection_mat, wmOperator::ptr, RNA_enum_get(), ViewContext::rv3d, scene, StrokeCache::true_view_normal, ToolSettings::unified_paint_settings, StrokeCache::vc, StrokeCache::view_normal, RegionView3D::viewinv, and zero_v2().
Referenced by vpaint_stroke_test_start(), and wpaint_stroke_test_start().
|
static |
Definition at line 1541 of file paint_vertex.c.
References BKE_brush_size_get(), BKE_brush_unprojected_radius_set(), BKE_brush_use_size_pressure(), BKE_paint_brush(), BKE_pbvh_update_bounds(), C, SculptSession::cache, CTX_data_scene(), StrokeCache::first_time, StrokeCache::initial_radius, StrokeCache::mouse, VPaint::paint, paint_calc_object_space_radius(), PAINT_MODE_SCULPT, paint_supports_dynamic_size(), SculptSession::pbvh, PBVH_UpdateBB, PBVH_UpdateRedraw, StrokeCache::pressure, ptr, StrokeCache::radius, StrokeCache::radius_squared, RNA_float_get(), RNA_float_get_array(), scene, Object::sculpt, StrokeCache::true_location, and StrokeCache::vc.
Referenced by vpaint_stroke_update_step(), and wpaint_stroke_update_step().
|
static |
Definition at line 147 of file paint_vertex.c.
References Paint::brush, BRUSH_FRONTFACE, BRUSH_FRONTFACE_FALLOFF, Brush::flag, and VPaint::paint.
Referenced by do_vpaint_brush_blur_task_cb_ex(), do_vpaint_brush_draw_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_calc_average_weight_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), and vwpaint_pbvh_gather_generic().
| bool weight_paint_mode_poll | ( | bContext * | C | ) |
Definition at line 238 of file paint_vertex.c.
References C, CTX_data_active_object(), Object::data, Object::mode, and OB_MODE_WEIGHT_PAINT.
Referenced by ED_keymap_paint(), PAINT_OT_weight_sample(), and PAINT_OT_weight_sample_group().
| bool weight_paint_poll | ( | bContext * | C | ) |
Definition at line 263 of file paint_vertex.c.
References C, and weight_paint_poll_ex().
Referenced by ed_vwpaintmode_enter_generic(), and PAINT_OT_weight_paint().
|
static |
Definition at line 245 of file paint_vertex.c.
References blender::compositor::area(), BKE_paint_brush(), C, CTX_data_active_object(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), ELEM, Object::mode, NULL, OB_MODE_WEIGHT_PAINT, ARegion::regiontype, RGN_TYPE_HUD, RGN_TYPE_WINDOW, SPACE_VIEW3D, and WM_toolsystem_active_tool_is_brush().
Referenced by weight_paint_poll(), and weight_paint_poll_ignore_tool().
| bool weight_paint_poll_ignore_tool | ( | bContext * | C | ) |
Definition at line 268 of file paint_vertex.c.
References C, and weight_paint_poll_ex().
Referenced by PAINT_OT_weight_gradient().
|
static |
Definition at line 362 of file paint_vertex.c.
References alpha, Brush::blend, blend(), Paint::brush, CLAMP, ED_wpaint_blend_tool(), IMB_BLEND_ADD, IMB_BLEND_DARKEN, IMB_BLEND_LIGHTEN, IMB_BLEND_MIX, IMB_BLEND_SUB, and VPaint::paint.
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
|
static |
Definition at line 2560 of file paint_vertex.c.
References C, SculptSession::cache, CTX_data_active_object(), NULL, paint_stroke_cancel(), Object::sculpt, and SCULPT_cache_free().
Referenced by PAINT_OT_weight_paint().
Definition at line 401 of file paint_vertex.c.
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().
|
static |
Definition at line 2260 of file paint_vertex.c.
References angle(), C, SculptSession::cache, MEM_freeN, StrokeCache::radial_symmetry_pass, Object::sculpt, SCULPT_cache_calc_brushdata_symm(), vwpaint_pbvh_gather_generic(), and wpaint_paint_leaves().
Referenced by wpaint_do_radial_symmetry(), and wpaint_do_symmetrical_brush_actions().
|
static |
Definition at line 2287 of file paint_vertex.c.
References angle(), C, M_PI, VPaint::radial_symm, and wpaint_do_paint().
Referenced by wpaint_do_symmetrical_brush_actions().
|
static |
Definition at line 2306 of file paint_vertex.c.
References BKE_paint_brush(), C, SculptSession::cache, copy_v3_v3(), Object::data, Mesh::editflag, StrokeCache::is_last_valid, ME_EDIT_MIRROR_VERTEX_GROUPS, StrokeCache::mirror_symmetry_pass, VPaint::paint, StrokeCache::radial_symmetry_pass, Object::sculpt, SCULPT_cache_calc_brushdata_symm(), SCULPT_mesh_symmetry_xyz_get(), StrokeCache::symmetry, StrokeCache::true_last_location, StrokeCache::true_location, wpaint_do_paint(), and wpaint_do_radial_symmetry().
Referenced by wpaint_stroke_update_step().
|
static |
Definition at line 2543 of file paint_vertex.c.
References C, wmOperator::customdata, NULL, OPERATOR_FINISHED, paint_stroke_exec(), paint_stroke_new(), SCULPT_stroke_get_location(), wpaint_stroke_done(), wpaint_stroke_test_start(), and wpaint_stroke_update_step().
Referenced by PAINT_OT_weight_paint().
|
static |
Definition at line 1761 of file paint_vertex.c.
References BKE_defvert_find_weight(), BKE_defvert_lock_relative_weight(), BKE_defvert_multipaint_collective_weight(), CLAMP, WeightPaintInfo::defbase_sel, WeightPaintInfo::defbase_tot, WeightPaintInfo::defbase_tot_sel, WeightPaintInfo::do_lock_relative, WeightPaintInfo::do_multipaint, WeightPaintInfo::is_normalized, WeightPaintInfo::vgroup_locked, and WeightPaintInfo::vgroup_unlocked.
Referenced by do_wpaint_brush_calc_average_weight_cb_ex(), and do_wpaint_precompute_weight_cb_ex().
|
static |
Definition at line 2517 of file paint_vertex.c.
References BLI_assert, C, wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_FINISHED, OPERATOR_RETVAL_CHECK, OPERATOR_RUNNING_MODAL, paint_stroke_free(), paint_stroke_new(), SCULPT_stroke_get_location(), wmOperator::type, wmEvent::type, WM_event_add_modal_handler(), wpaint_stroke_done(), wpaint_stroke_test_start(), and wpaint_stroke_update_step().
Referenced by PAINT_OT_weight_paint().
|
static |
Definition at line 1368 of file paint_vertex.c.
References BKE_mesh_from_object(), BKE_paint_toolslots_brush_validate(), C, CTX_data_active_object(), CTX_data_depsgraph_on_load(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_message_bus(), DEG_id_tag_update(), depsgraph, ED_object_mode_compat_set(), ED_object_posemode_set_for_weight_paint(), ED_object_wpaintmode_enter_ex(), ED_object_wpaintmode_exit_ex(), Mesh::id, Object::id, Object::mode, NC_SCENE, ND_MODE, OB_MODE_WEIGHT_PAINT, OPERATOR_CANCELLED, OPERATOR_FINISHED, VPaint::paint, wmOperator::reports, scene, Scene::toolsettings, WM_event_add_notifier(), WM_msg_publish_rna_prop, WM_toolsystem_update_from_context_view3d(), and ToolSettings::wpaint.
Referenced by PAINT_OT_weight_paint_toggle().
|
static |
Definition at line 2163 of file paint_vertex.c.
References BKE_brush_weight_get(), BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), StrokeCache::brush, C, SculptSession::cache, calculate_average_weight(), CTX_data_scene(), data, do_wpaint_brush_blur_task_cb_ex(), do_wpaint_brush_draw_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), ME_USING_MIRROR_X_VERTEX_GROUPS, scene, Object::sculpt, Brush::weightpaint_tool, WPAINT_TOOL_AVERAGE, WPAINT_TOOL_BLUR, WPAINT_TOOL_DRAW, and WPAINT_TOOL_SMEAR.
Referenced by wpaint_do_paint().
|
static |
Definition at line 2460 of file paint_vertex.c.
References Object::actdef, C, SculptSession::cache, CTX_data_active_object(), Object::data, WPaintData::defbase_sel, DEG_id_tag_update(), ListBase::first, ID_RECALC_PSYS_RESET, WeightPaintGroupData::lock, WPaintData::lock_flags, MEM_freeN, WPaintData::mirror, NC_OBJECT, ND_DRAW, ParticleSystem::next, NULL, paint_stroke_mode_data(), Object::particlesystem, WPaintData::precomputed_weight, PSYS_TOT_VG, ParticleSystem::recalc, Object::sculpt, SCULPT_cache_free(), ParticleSystem::vgroup, WPaintData::vgroup_locked, WPaintData::vgroup_unlocked, WPaintData::vgroup_validmap, and WM_event_add_notifier().
Referenced by wpaint_exec(), and wpaint_invoke().
|
static |
Definition at line 1587 of file paint_vertex.c.
References WPaintVGroupIndex::active, ToolSettings::auto_normalize, BKE_mesh_from_object(), BKE_object_defgroup_check_lock_relative(), BKE_object_defgroup_check_lock_relative_multi(), BKE_object_defgroup_lock_flags_get(), BKE_object_defgroup_mirror_selection(), BKE_object_defgroup_selected_get(), BKE_object_defgroup_split_locked_validmap(), BKE_object_defgroup_validmap_get(), BKE_report(), BLI_array_binary_or, BLI_findlink(), BLI_listbase_count(), Paint::brush, BRUSH_FRONTFACE_FALLOFF, C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_tool_settings(), wmOperator::customdata, Object::defbase, WPaintData::defbase_sel, WPaintData::defbase_tot, WPaintData::defbase_tot_sel, depsgraph, DG_LOCK_WEIGHT, WPaintData::do_lock_relative, WPaintData::do_multipaint, ED_view3d_viewcontext_init(), ED_wpaint_ensure_data(), ELEM, Brush::falloff_angle, Brush::flag, MDeformVert::flag, bDeformGroup::flag, WeightPaintGroupData::index, WeightPaintGroupData::lock, WPaintData::lock_flags, ME_USING_MIRROR_X_VERTEX_GROUPS, MEM_callocN, MEM_dupallocN, MEM_freeN, MEM_mallocN, WPaintVGroupIndex::mirror, WPaintData::mirror, SculptSession::mode, ToolSettings::multipaint, WPaintData::normal_angle_precalc, NULL, VPaint::paint, paint_stroke_set_mode_data(), WPaintData::precomputed_weight, wmOperator::reports, RPT_WARNING, scene, Object::sculpt, Scene::toolsettings, Mesh::totvert, WPaintData::vc, vertex_paint_init_session_data(), vertex_paint_init_stroke(), WPaintData::vgroup_locked, WPaintData::vgroup_unlocked, WPaintData::vgroup_validmap, view_angle_limits_init(), vwpaint_update_cache_invariants(), Brush::weightpaint_tool, SculptSession::wpaint, ToolSettings::wpaint, WPAINT_ENSURE_MIRROR, ToolSettings::wpaint_lock_relative, WPAINT_TOOL_BLUR, and WPAINT_TOOL_SMEAR.
Referenced by wpaint_exec(), and wpaint_invoke().
|
static |
Definition at line 2358 of file paint_vertex.c.
References ToolSettings::auto_normalize, BKE_brush_alpha_get(), BKE_mesh_batch_cache_dirty_tag(), BKE_MESH_BATCH_DIRTY_ALL, BKE_paint_brush(), BLI_rcti_is_empty(), BLI_rcti_union(), WeightPaintInfo::brush_alpha_value, C, SculptSession::cache, CTX_data_active_object(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region(), CTX_wm_region_view3d(), StrokeCache::current_r, Object::data, WeightPaintInfo::defbase_sel, WPaintData::defbase_sel, WeightPaintInfo::defbase_tot, WPaintData::defbase_tot, WeightPaintInfo::defbase_tot_sel, WPaintData::defbase_tot_sel, WeightPaintInfo::defbase_tot_unsel, DEG_id_tag_update(), WeightPaintInfo::do_auto_normalize, WeightPaintInfo::do_flip, WeightPaintInfo::do_lock_relative, WPaintData::do_lock_relative, WeightPaintInfo::do_multipaint, WPaintData::do_multipaint, ED_region_tag_redraw(), ED_region_tag_redraw_partial(), ED_view3d_init_mats_rv3d(), WeightPaintInfo::is_normalized, WeightPaintInfo::lock_flags, WPaintData::lock_flags, WeightPaintInfo::mirror, WPaintData::mirror, mul_m4_m4m4(), mul_v3_m4v3(), NC_OBJECT, ND_DRAW, NULL, ViewContext::obact, Object::obmat, VPaint::paint, paint_last_stroke_update(), paint_stroke_mode_data(), RegionView3D::persmat, precompute_weight_values(), WPaintData::precomputed_weight, StrokeCache::previous_r, r, ViewContext::region, RNA_boolean_get(), ViewContext::rv3d, scene, Object::sculpt, ToolSettings::sculpt, SCULPT_get_redraw_rect(), swap_m4m4(), StrokeCache::true_location, WPaintData::vc, WeightPaintInfo::vgroup_locked, WPaintData::vgroup_locked, WeightPaintInfo::vgroup_unlocked, WPaintData::vgroup_unlocked, WeightPaintInfo::vgroup_validmap, WPaintData::vgroup_validmap, view3d_operator_needs_opengl(), vwpaint_update_cache_variants(), ARegion::winrct, WM_event_add_notifier(), ToolSettings::wpaint, wpaint_do_symmetrical_brush_actions(), rcti::xmin, and rcti::ymin.
Referenced by wpaint_exec(), and wpaint_invoke().
|
static |
Definition at line 412 of file paint_vertex.c.
References VERTEX_WEIGHT_LOCK_EPSILON.
Referenced by do_weight_paint_vertex_multi(), and do_weight_paint_vertex_single().