Blender V5.3
blender::VertexPaintStroke Struct Referencefinal

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

Public Member Functions

 VertexPaintStroke (bContext *C, wmOperator *op, const wmEvent *event)
Vertex Paint Operator
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
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_
VPaint * vertex_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 774 of file paint_vertex.cc.

Constructor & Destructor Documentation

◆ VertexPaintStroke()

Member Function Documentation

◆ done()

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

Callback function for cleaning up and finalizing data after a stroke has finished.

Parameters
is_cancelSome paint modes support cancelling a stroke and returning to the initial state. This parameter indicates this case so that appropriate cleanup actions can be taken.
stroke_startedWhether the stroke started. Subclasses can use this to determine if undo steps should be created. See \test_start.

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

Definition at line 1782 of file paint_vertex.cc.

References blender::ed::sculpt_paint::StrokeToggleSettings::alt_smooth, blender::SculptSession::cache, done(), blender::ed::sculpt_paint::PaintStroke::evil_C, blender::ed::sculpt_paint::PaintStroke::mode_data_, NC_OBJECT, ND_DRAW, blender::ViewContext::obact, blender::ed::sculpt_paint::PaintStroke::paint, blender::Object::runtime, blender::bke::ObjectRuntime::sculpt_session, blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_off(), blender::ed::sculpt_paint::StrokeCache::toggle_settings, blender::VPaintData::vc, and blender::WM_event_add_notifier().

Referenced by done().

◆ get_location()

std::optional< float3 > blender::VertexPaintStroke::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 796 of file paint_vertex.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::VertexPaintStroke::redraw ( bool final)
overridevirtual

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

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

Definition at line 849 of file paint_vertex.cc.

◆ test_cancel()

bool blender::VertexPaintStroke::test_cancel ( )
overridevirtual

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

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

Definition at line 850 of file paint_vertex.cc.

◆ test_start()

◆ update_step()

void blender::VertexPaintStroke::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 1745 of file paint_vertex.cc.

References base_, blender::BKE_mesh_batch_cache_dirty_tag(), blender::BKE_MESH_BATCH_DIRTY_ALL, blender::BKE_paint_brush(), blender::ed::sculpt_paint::PaintStroke::brush, blender::SculptSession::cache, blender::copy_v3_v3(), blender::Object::data, blender::DEG_id_tag_update(), blender::ed::sculpt_paint::PaintStroke::depsgraph, blender::ed::sculpt_paint::do_symmetrical_brush_actions(), blender::ED_region_tag_redraw(), blender::ed::sculpt_paint::StrokeCache::first_time, blender::ID_RECALC_GEOMETRY, blender::ed::sculpt_paint::StrokeCache::last_location, blender::ed::sculpt_paint::StrokeCache::location, blender::ed::sculpt_paint::PaintStroke::mode_data_, blender::mul_v3_m4v3(), blender::ViewContext::obact, blender::ed::sculpt_paint::PaintStroke::paint, blender::ed::sculpt_paint::PaintStroke::paint_mode, blender::ViewContext::region, blender::Object::runtime, blender::ed::sculpt_paint::PaintStroke::scene, blender::bke::ObjectRuntime::sculpt_session, blender::VPaintData::smear, blender::ed::sculpt_paint::PaintStroke::stroke_distance(), blender::ed::sculpt_paint::StrokeCache::stroke_distance, blender::bke::paint::stroke_track_location(), blender::ed::sculpt_paint::vwpaint::update_cache_variants(), update_step(), blender::ed::sculpt_paint::PaintStroke::vc, blender::VPaintData::vc, blender::Brush::vertex_brush_type, vertex_paint_, blender::VPAINT_BRUSH_TYPE_SMEAR, and blender::vpaint_do_paint().

Referenced by update_step().

Member Data Documentation

◆ base_

Base* blender::VertexPaintStroke::base_

Definition at line 777 of file paint_vertex.cc.

Referenced by update_step(), and VertexPaintStroke().

◆ bmain_

Main* blender::VertexPaintStroke::bmain_

◆ vertex_paint_

VPaint* blender::VertexPaintStroke::vertex_paint_

Definition at line 776 of file paint_vertex.cc.

Referenced by update_step(), and VertexPaintStroke().


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