Blender V5.3
blender::WeightPaintStroke Struct Referencefinal

Inherits blender::ed::sculpt_paint::PaintStroke.

Public Member Functions

 WeightPaintStroke (bContext *C, wmOperator *op, const wmEvent *event)
std::optional< float3 > get_location (float2 mouse, bool force_original) override
bool test_start (wmOperator *op, float2 mouse) override
void redraw (bool final) override
bool test_cancel () override
Weight Paint Operator
void update_step (wmOperator *op, const StrokeStep &stroke_step) override
void done (bool is_cancel, bool stroke_started) override
Public Member Functions inherited from blender::ed::sculpt_paint::PaintStroke
 PaintStroke ()=delete
virtual ~PaintStroke ()=default
wmOperatorStatus modal (bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus exec (bContext *C, wmOperator *op)
void cancel (bContext *C)
void finish (bContext *C)
bool stroke_flipped () const
bool stroke_inverted () const
float stroke_distance () const
Public Member Functions inherited from blender::blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyable & operator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyable & operator= (NonCopyable &&other)=default
Public Member Functions inherited from blender::blender::NonMovable
 NonMovable (NonMovable &&other)=delete
NonMovable & operator= (NonMovable &&other)=delete
 NonMovable ()=default
 NonMovable (const NonMovable &other)=default
NonMovable & operator= (const NonMovable &other)=default

Public Attributes

Main * bmain_
ToolSettings * tool_settings_
VPaint * weight_paint_
Base * base_
Public Attributes inherited from blender::ed::sculpt_paint::PaintStroke
bContext * evil_C = nullptr
ViewContext vc = {}
Depsgraph * depsgraph = nullptr
Object * object = nullptr
Scene * scene = nullptr
Paint * paint = nullptr
PaintMode paint_mode = PaintMode::Invalid
Brush * brush = nullptr
UnifiedPaintSettings * ups = nullptr
float2 last_mouse_position = float2(0.0f, 0.0f)
bool constrain_line = false
float2 constrained_pos = float2(0.0f, 0.0f)

Additional Inherited Members

Protected Member Functions inherited from blender::ed::sculpt_paint::PaintStroke
 PaintStroke (bContext *C, wmOperator *op, const wmEvent *event, PaintMode mode)
Protected Attributes inherited from blender::ed::sculpt_paint::PaintStroke
std::unique_ptr< PaintModeData > mode_data_ = nullptr

Detailed Description

Definition at line 890 of file paint_weight.cc.

Constructor & Destructor Documentation

◆ WeightPaintStroke()

Member Function Documentation

◆ done()

void blender::WeightPaintStroke::done ( bool is_cancel,
bool stroke_started )
overridevirtual

◆ get_location()

std::optional< float3 > blender::WeightPaintStroke::get_location ( float2 mouse,
bool force_original )
overridevirtual

Callback function to retrieve the object space coordinates based on screen space coordinates.

Returns
whether a value was actually found & the value in location is usable

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 913 of file paint_weight.cc.

References blender::ed::sculpt_paint::PaintStroke::brush, blender::ed::sculpt_paint::PaintStroke::depsgraph, blender::ed::sculpt_paint::PaintStroke::paint, blender::ed::sculpt_paint::stroke_get_location_bvh(), and blender::ed::sculpt_paint::PaintStroke::vc.

◆ redraw()

void blender::WeightPaintStroke::redraw ( bool final)
overridevirtual

Callback function for performing necessary redraw functions based on the stroke.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 1084 of file paint_weight.cc.

◆ test_cancel()

bool blender::WeightPaintStroke::test_cancel ( )
overridevirtual

Callback function for dynamically determining if a stroke can be cancelled.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 1085 of file paint_weight.cc.

◆ test_start()

bool blender::WeightPaintStroke::test_start ( wmOperator * op,
float2 mouse )
overridevirtual

Callback function to determine whether a stroke has started, and performing initialization.

In many cases, this is a check to whether the stroke is over the active mesh.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 936 of file paint_weight.cc.

References blender::WPaintVGroupIndex::active, blender::ToolSettings::auto_normalize, blender::BKE_mesh_from_object(), blender::BKE_object_defgroup_check_lock_relative(), blender::BKE_object_defgroup_check_lock_relative_multi(), blender::BKE_object_defgroup_lock_flags_get(), blender::BKE_object_defgroup_mirror_selection(), blender::BKE_object_defgroup_selected_get(), blender::BKE_object_defgroup_split_locked_validmap(), blender::BKE_object_defgroup_validmap_get(), blender::BKE_paint_brush(), blender::BKE_paint_brush_for_read(), blender::BKE_report(), BLI_array_binary_or, blender::BLI_findlink(), bmain_, blender::ed::sculpt_paint::PaintStroke::brush, blender::DG_LOCK_WEIGHT, blender::ED_wpaint_ensure_data(), ELEM, blender::ed::sculpt_paint::PaintStroke::evil_C, blender::bDeformGroup::flag, blender::init_session_data(), ME_USING_MIRROR_X_VERTEX_GROUPS, blender::MEM_new_array_uninitialized(), blender::MEM_new_array_zeroed(), blender::WPaintVGroupIndex::mirror, blender::ed::sculpt_paint::PaintStroke::mode_data_, blender::ToolSettings::multipaint, blender::ed::sculpt_paint::PaintStroke::object, blender::VPaint::paint, blender::wmOperator::reports, blender::RPT_WARNING, blender::Object::runtime, blender::ed::sculpt_paint::PaintStroke::scene, blender::bke::ObjectRuntime::sculpt_session, blender::Scene::toolsettings, blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), blender::ed::sculpt_paint::PaintStroke::vc, blender::Brush::weight_brush_type, weight_paint_, blender::WPAINT_BRUSH_TYPE_BLUR, blender::WPAINT_BRUSH_TYPE_SMEAR, blender::WPAINT_ENSURE_MIRROR, and blender::ToolSettings::wpaint_lock_relative.

◆ update_step()

void blender::WeightPaintStroke::update_step ( wmOperator * op,
const StrokeStep & stroke_step )
overridevirtual

Callback function for performing a paint stroke for a new step.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 1766 of file paint_weight.cc.

References blender::WeightPaintInfo::active, blender::WPaintData::active, blender::ToolSettings::auto_normalize, base_, blender::ed::sculpt_paint::StrokeCache::base_brush_strength, blender::BKE_brush_alpha_get(), blender::BKE_mesh_batch_cache_dirty_tag(), blender::BKE_MESH_BATCH_DIRTY_ALL, blender::BKE_paint_brush(), blender::ed::sculpt_paint::PaintStroke::brush, blender::WeightPaintInfo::brush_alpha_value, blender::ed::sculpt_paint::StrokeCache::bstrength, blender::SculptSession::cache, blender::ed::sculpt_paint::cache_calc_brushdata_symm(), blender::copy_v3_v3(), blender::Object::data, blender::WeightPaintInfo::defbase_sel, blender::WPaintData::defbase_sel, blender::WeightPaintInfo::defbase_tot, blender::WPaintData::defbase_tot, blender::WeightPaintInfo::defbase_tot_sel, blender::WPaintData::defbase_tot_sel, blender::WeightPaintInfo::defbase_tot_unsel, blender::DEG_id_tag_update(), blender::ed::sculpt_paint::PaintStroke::depsgraph, blender::WeightPaintInfo::do_auto_normalize, blender::WeightPaintInfo::do_flip, blender::WeightPaintInfo::do_lock_relative, blender::WPaintData::do_lock_relative, blender::WeightPaintInfo::do_multipaint, blender::WPaintData::do_multipaint, blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::WeightPaintInfo::dvert, blender::ED_region_tag_redraw(), blender::ed::sculpt_paint::PaintStroke::evil_C, blender::ed::sculpt_paint::StrokeCache::first_time, blender::ID_RECALC_GEOMETRY, blender::WeightPaintGroupData::index, blender::WPaintData::info, blender::ed::sculpt_paint::StrokeToggleSettings::invert, blender::WeightPaintInfo::is_normalized, blender::ed::sculpt_paint::StrokeCache::last_location, blender::ed::sculpt_paint::StrokeCache::location, blender::WeightPaintInfo::lock_flags, blender::WPaintData::lock_flags, blender::ME_EDIT_MIRROR_VERTEX_GROUPS, blender::WeightPaintInfo::mirror, blender::WPaintData::mirror, blender::ed::sculpt_paint::StrokeCache::mirror_symmetry_pass, blender::ed::sculpt_paint::PaintStroke::mode_data_, blender::mul_v3_m4v3(), NC_OBJECT, ND_DRAW, blender::ViewContext::obact, blender::ed::sculpt_paint::PaintStroke::object, blender::ed::sculpt_paint::PaintStroke::paint, blender::VPaint::paint, blender::ed::sculpt_paint::PaintStroke::paint_mode, blender::precompute_weight_values(), blender::WPaintData::precomputed_weight, blender::ed::sculpt_paint::StrokeCache::radial_symmetry_pass, blender::ViewContext::region, blender::Object::runtime, blender::ed::sculpt_paint::PaintStroke::scene, blender::bke::ObjectRuntime::sculpt_session, blender::bke::paint::stroke_track_location(), blender::ed::sculpt_paint::StrokeCache::toggle_settings, tool_settings_, blender::ed::sculpt_paint::vwpaint::update_cache_variants(), update_step(), blender::ed::sculpt_paint::PaintStroke::vc, blender::WeightPaintInfo::vgroup_locked, blender::WPaintData::vgroup_locked, blender::WeightPaintInfo::vgroup_unlocked, blender::WPaintData::vgroup_unlocked, blender::WeightPaintInfo::vgroup_validmap, blender::WPaintData::vgroup_validmap, weight_paint_, blender::WM_event_add_notifier(), and blender::wpaint_do_paint().

Referenced by update_step().

Member Data Documentation

◆ base_

Base* blender::WeightPaintStroke::base_

Definition at line 894 of file paint_weight.cc.

Referenced by update_step(), and WeightPaintStroke().

◆ bmain_

Main* blender::WeightPaintStroke::bmain_

◆ tool_settings_

ToolSettings* blender::WeightPaintStroke::tool_settings_

Definition at line 892 of file paint_weight.cc.

Referenced by update_step(), and WeightPaintStroke().

◆ weight_paint_

VPaint* blender::WeightPaintStroke::weight_paint_

Definition at line 893 of file paint_weight.cc.

Referenced by test_start(), update_step(), and WeightPaintStroke().


The documentation for this struct was generated from the following file: