Blender V5.0
blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor Struct Reference

Public Member Functions

 PaintOperationExecutor (const bContext &C)
void process_start_sample (PaintOperation &self, const bContext &C, const InputSample &start_sample, const int material_index, const bool use_fill)
void active_smoothing (PaintOperation &self, const IndexRange smooth_window)
void active_jitter (PaintOperation &self, const int new_points_num, const float brush_radius_px, const float pressure, const IndexRange active_window, MutableSpan< float3 > curve_positions)
void process_extension_sample (PaintOperation &self, const bContext &C, const InputSample &extension_sample)
void execute (PaintOperation &self, const bContext &C, const InputSample &extension_sample)

Public Attributes

Scenescene_
GreasePencilgrease_pencil_
Brushbrush_
BrushGpencilSettingssettings_
std::optional< BrushColorJitterSettingsjitter_settings_
ColorGeometry4f vertex_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)
ColorGeometry4f fill_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)
float softness_
float aspect_ratio_
bool use_vertex_color_
bool use_settings_random_

Detailed Description

Utility class that actually executes the update when the stroke is updated. That's useful because it avoids passing a very large number of parameters between functions.

Definition at line 267 of file grease_pencil_paint.cc.

Constructor & Destructor Documentation

◆ PaintOperationExecutor()

Member Function Documentation

◆ active_jitter()

void blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::active_jitter ( PaintOperation & self,
const int new_points_num,
const float brush_radius_px,
const float pressure,
const IndexRange active_window,
MutableSpan< float3 > curve_positions )
inline

◆ active_smoothing()

◆ execute()

void blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::execute ( PaintOperation & self,
const bContext & C,
const InputSample & extension_sample )
inline

◆ process_extension_sample()

void blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_extension_sample ( PaintOperation & self,
const bContext & C,
const InputSample & extension_sample )
inline

Definition at line 656 of file grease_pencil_paint.cc.

References blender::math::abs(), active_jitter(), active_smoothing(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), angle(), blender::bke::attribute_filter_from_skip_ref(), BLI_assert, BLI_time_now_seconds(), brush_, blender::ed::sculpt_paint::greasepencil::brush_radius_to_pixel_radius(), C, blender::bke::AttributeAccessor::contains(), blender::MutableSpan< T >::copy_from(), blender::math::cos(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), blender::math::distance(), blender::math::dot(), blender::bke::fill_attribute_range_default(), blender::math::floor(), blender::IndexRange::from_single(), GP_TOOL_FLAG_PAINT_ONBACK, ToolSettings::gpencil_flags, i, blender::IndexRange::index_range(), blender::MutableSpan< T >::index_range(), blender::math::interpolate(), jitter_settings_, blender::IndexRange::last(), blender::ed::sculpt_paint::greasepencil::linear_interpolation(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::math::max(), blender::ed::sculpt_paint::InputSample::mouse_position, blender::math::normalize(), blender::ed::greasepencil::opacity_from_input_sample(), blender::bke::Point, blender::ed::sculpt_paint::InputSample::pressure, blender::ed::greasepencil::radius_from_input_sample(), blender::ed::greasepencil::randomize_color(), blender::ed::greasepencil::randomize_opacity(), blender::ed::greasepencil::randomize_radius(), blender::ed::greasepencil::randomize_rotation(), blender::ed::greasepencil::resize_single_curve(), self, settings_, blender::math::sin(), blender::IndexRange::size(), blender::MutableSpan< T >::slice(), Scene::toolsettings, blender::math::transform_point(), use_settings_random_, use_vertex_color_, and vertex_color_.

Referenced by execute().

◆ process_start_sample()

void blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::process_start_sample ( PaintOperation & self,
const bContext & C,
const InputSample & start_sample,
const int material_index,
const bool use_fill )
inline

Definition at line 309 of file grease_pencil_paint.cc.

References blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_multiple(), blender::ed::greasepencil::add_single_curve(), aspect_ratio_, blender::bke::attribute_filter_from_skip_ref(), brush_, C, blender::bke::AttributeAccessor::contains(), CTX_data_scene(), CTX_wm_region(), CTX_wm_region_view3d(), blender::bke::Curve, CURVE_TYPE_POLY, blender::bke::fill_attribute_range_default(), fill_color_, blender::bke::SpanAttributeWriter< T >::finish(), float, blender::VArray< T >::from_single(), GP_STROKE_CAP_TYPE_ROUND, GP_TOOL_FLAG_PAINT_ONBACK, ToolSettings::gpencil_flags, jitter_settings_, blender::IndexRange::last(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_span(), blender::ed::sculpt_paint::InputSample::mouse_position, blender::ed::greasepencil::opacity_from_input_sample(), blender::bke::Point, blender::ed::sculpt_paint::InputSample::pressure, blender::ed::greasepencil::radius_from_input_sample(), blender::ed::greasepencil::randomize_color(), blender::ed::greasepencil::randomize_opacity(), blender::ed::greasepencil::randomize_radius(), blender::ed::greasepencil::randomize_rotation(), self, settings_, softness_, blender::bke::GSpanAttributeWriter::span, blender::bke::SpanAttributeWriter< T >::span, Scene::toolsettings, use_vertex_color_, and vertex_color_.

Referenced by blender::ed::sculpt_paint::greasepencil::PaintOperation::on_stroke_begin().

Member Data Documentation

◆ aspect_ratio_

float blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::aspect_ratio_

Definition at line 279 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor(), and process_start_sample().

◆ brush_

Brush* blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::brush_

◆ fill_color_

ColorGeometry4f blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::fill_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)

Definition at line 277 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor(), and process_start_sample().

◆ grease_pencil_

GreasePencil* blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::grease_pencil_

Definition at line 269 of file grease_pencil_paint.cc.

◆ jitter_settings_

std::optional<BrushColorJitterSettings> blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::jitter_settings_

◆ scene_

Scene* blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::scene_

Definition at line 268 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor().

◆ settings_

BrushGpencilSettings* blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::settings_

◆ softness_

float blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::softness_

Definition at line 278 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor(), and process_start_sample().

◆ use_settings_random_

bool blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::use_settings_random_

Definition at line 282 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor(), and process_extension_sample().

◆ use_vertex_color_

bool blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::use_vertex_color_

◆ vertex_color_

ColorGeometry4f blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::vertex_color_ = ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f)

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