Blender V4.5
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.

Member Function Documentation

◆ foreach_editable_drawing() [1/3]

◆ foreach_editable_drawing() [2/3]

◆ 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

◆ 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(), blender::bke::CurvesGeometry::attributes(), 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(), blender::bke::CurvesGeometry::curves_range(), 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::index_mask::IndexMask::from_intersection(), blender::index_mask::IndexMask::from_predicate(), blender::index_mask::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(), 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::bke::CurvesGeometry::points_by_curve(), blender::bke::CurvesGeometry::points_range(), blender::math::round(), scene, blender::Vector< T, InlineBufferCapacity, Allocator >::size(), blender::bke::greasepencil::Drawing::strokes(), and Scene::toolsettings.

Referenced by 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()

◆ 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.

◆ prev_mouse_position

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

Previous mouse position for computing the direction.

Definition at line 174 of file grease_pencil_intern.hh.

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

◆ 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 blender::ed::sculpt_paint::greasepencil::SmoothOperation::on_stroke_begin().

◆ stroke_mode

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

Definition at line 169 of file grease_pencil_intern.hh.

Referenced by is_inverted().


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