Blender V5.0
blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon Class Reference

#include <grease_pencil_intern.hh>

Inherits blender::ed::sculpt_paint::GreasePencilStrokeOperation.

Inherited by blender::ed::sculpt_paint::greasepencil::CloneOperation, blender::ed::sculpt_paint::greasepencil::GrabOperation, blender::ed::sculpt_paint::greasepencil::PinchOperation, blender::ed::sculpt_paint::greasepencil::PushOperation, blender::ed::sculpt_paint::greasepencil::RandomizeOperation, blender::ed::sculpt_paint::greasepencil::SmoothOperation, blender::ed::sculpt_paint::greasepencil::StrengthOperation, blender::ed::sculpt_paint::greasepencil::ThicknessOperation, blender::ed::sculpt_paint::greasepencil::TwistOperation, blender::ed::sculpt_paint::greasepencil::VertexAverageOperation, blender::ed::sculpt_paint::greasepencil::VertexBlurOperation, blender::ed::sculpt_paint::greasepencil::VertexPaintOperation, blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation, and blender::ed::sculpt_paint::greasepencil::VertexSmearOperation.

Classes

struct  AutoMaskingInfo

Public Types

using MutableDrawingInfo = blender::ed::greasepencil::MutableDrawingInfo
using DrawingPlacement = ed::greasepencil::DrawingPlacement

Public Member Functions

 GreasePencilStrokeOperationCommon ()=default
 GreasePencilStrokeOperationCommon (const BrushStrokeMode stroke_mode)
bool is_inverted (const Brush &brush) const
float2 mouse_delta (const InputSample &input_sample) const
void init_stroke (const bContext &C, const InputSample &start_sample)
void init_auto_masking (const bContext &C, const InputSample &start_sample)
void stroke_extended (const InputSample &extension_sample)
void foreach_editable_drawing_with_automask (const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams &params, const IndexMask &points)> fn) const
void foreach_editable_drawing_with_automask (const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams &params, const IndexMask &points, const DeltaProjectionFunc &projection_fn)> fn) const
void foreach_editable_drawing (const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams &params, const DeltaProjectionFunc &projection_fn)> fn) const
void foreach_editable_drawing (const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams &params)> fn) const
void foreach_editable_drawing (const bContext &C, GrainSize grain_size, FunctionRef< bool(const GreasePencilStrokeParams &params)> fn) const
Public Member Functions inherited from blender::ed::sculpt_paint::GreasePencilStrokeOperation
virtual void on_stroke_begin (const bContext &C, const InputSample &start_sample)=0
virtual void on_stroke_extended (const bContext &C, const InputSample &extension_sample)=0
virtual void on_stroke_done (const bContext &C)=0
Public Member Functions inherited from blender::ed::sculpt_paint::PaintModeData
virtual ~PaintModeData ()=default

Public Attributes

BrushStrokeMode stroke_mode
float2 start_mouse_position
float2 prev_mouse_position
Array< AutoMaskingInfoauto_masking_info_per_drawing

Detailed Description

Definition at line 164 of file grease_pencil_intern.hh.

Member Typedef Documentation

◆ DrawingPlacement

◆ MutableDrawingInfo

Constructor & Destructor Documentation

◆ GreasePencilStrokeOperationCommon() [1/2]

blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::GreasePencilStrokeOperationCommon ( )
default

◆ GreasePencilStrokeOperationCommon() [2/2]

blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::GreasePencilStrokeOperationCommon ( const BrushStrokeMode stroke_mode)
inline

Definition at line 184 of file grease_pencil_intern.hh.

References stroke_mode.

Member Function Documentation

◆ foreach_editable_drawing() [1/3]

◆ foreach_editable_drawing() [2/3]

void blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::foreach_editable_drawing ( const bContext & C,
FunctionRef< bool(const GreasePencilStrokeParams &params, const DeltaProjectionFunc &projection_fn)> fn ) const

Definition at line 531 of file grease_pencil_paint_common.cc.

References C, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), DEG_get_evaluated(), DEG_id_tag_update(), depsgraph, blender::ed::greasepencil::MutableDrawingInfo::drawing, foreach_editable_drawing(), blender::ed::greasepencil::MutableDrawingInfo::frame_number, blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeParams::from_context(), blender::ed::sculpt_paint::greasepencil::get_drawings_for_stroke_operation(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), i, GreasePencil::id, ID_RECALC_GEOMETRY, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), blender::ed::greasepencil::MutableDrawingInfo::layer_index, blender::ed::greasepencil::MutableDrawingInfo::multi_frame_falloff, NC_GEOM, ND_DATA, params, and WM_event_add_notifier().

Referenced by foreach_editable_drawing(), foreach_editable_drawing(), foreach_editable_drawing(), blender::ed::sculpt_paint::greasepencil::CloneOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::VertexAverageOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexBlurOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexPaintOperation::on_stroke_extended(), blender::ed::sculpt_paint::greasepencil::VertexReplaceOperation::on_stroke_extended(), and blender::ed::sculpt_paint::greasepencil::VertexSmearOperation::on_stroke_extended().

◆ foreach_editable_drawing() [3/3]

◆ foreach_editable_drawing_with_automask() [1/2]

◆ foreach_editable_drawing_with_automask() [2/2]

void blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::foreach_editable_drawing_with_automask ( const bContext & C,
FunctionRef< bool(const GreasePencilStrokeParams &params, const IndexMask &points, const DeltaProjectionFunc &projection_fn)> fn ) const

References C, and params.

◆ init_auto_masking()

void blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking ( const bContext & C,
const InputSample & start_sample )

Definition at line 627 of file grease_pencil_paint_common.cc.

References blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), auto_masking_info_per_drawing, C, blender::ed::sculpt_paint::greasepencil::calculate_view_positions(), blender::VectorSet< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::contains(), CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), blender::bke::Curve, blender::ed::sculpt_paint::greasepencil::curve_mask_for_stroke_operation(), depsgraph, blender::math::distance(), distance(), blender::ed::greasepencil::MutableDrawingInfo::drawing, GP_Sculpt_Settings::flag, blender::index_mask::IndexMask::foreach_index(), blender::ed::greasepencil::MutableDrawingInfo::frame_number, blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeParams::from_context(), blender::IndexMask::from_intersection(), blender::IndexMask::from_predicate(), blender::IndexMask::from_ranges(), blender::ed::sculpt_paint::greasepencil::get_drawings_with_masking_for_stroke_operation(), ToolSettings::gp_sculpt, GP_SCULPT_MASK_SELECTMODE_POINT, GP_SCULPT_MASK_SELECTMODE_SEGMENT, GP_SCULPT_MASK_SELECTMODE_STROKE, GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE, GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE, GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE, GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE, ToolSettings::gpencil_selectmode_sculpt, if(), blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), init_auto_masking(), blender::index_mask::IndexMask::is_empty(), blender::ed::greasepencil::MutableDrawingInfo::layer_index, blender::bke::AttributeAccessor::lookup_or_default(), blender::math::max(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::AutoMaskingInfo::memory, blender::ed::sculpt_paint::InputSample::mouse_position, blender::ed::greasepencil::MutableDrawingInfo::multi_frame_falloff, blender::threading::parallel_for_each(), params, blender::bke::Point, blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::AutoMaskingInfo::point_mask, blender::ed::sculpt_paint::greasepencil::point_mask_for_stroke_operation(), blender::math::round(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::greasepencil::Drawing::strokes(), and Scene::toolsettings.

Referenced by init_auto_masking(), blender::ed::sculpt_paint::greasepencil::GrabOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PinchOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::PushOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::RandomizeOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::StrengthOperation::on_stroke_begin(), blender::ed::sculpt_paint::greasepencil::ThicknessOperation::on_stroke_begin(), and blender::ed::sculpt_paint::greasepencil::TwistOperation::on_stroke_begin().

◆ init_stroke()

void blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_stroke ( const bContext & C,
const InputSample & start_sample )

◆ is_inverted()

◆ mouse_delta()

◆ stroke_extended()

Member Data Documentation

◆ auto_masking_info_per_drawing

Array<AutoMaskingInfo> blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::auto_masking_info_per_drawing

Definition at line 181 of file grease_pencil_intern.hh.

Referenced by init_auto_masking().

◆ prev_mouse_position

float2 blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::prev_mouse_position

◆ start_mouse_position

float2 blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::start_mouse_position

Initial mouse sample position, used for placement origin.

Definition at line 172 of file grease_pencil_intern.hh.

Referenced by init_stroke(), and blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_begin().

◆ stroke_mode

BrushStrokeMode blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::stroke_mode

The documentation for this class was generated from the following files: