Blender V4.3
blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor Struct Reference

Public Member Functions

 PaintOperationExecutor (const bContext &C)
float randomize_radius (PaintOperation &self, const float distance, const float radius, const float pressure)
float randomize_opacity (PaintOperation &self, const float distance, const float opacity, const float pressure)
float randomize_rotation (PaintOperation &self, const float pressure)
ColorGeometry4f randomize_color (PaintOperation &self, const float distance, const ColorGeometry4f color, const float pressure)
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_
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_
bool use_vertex_color_
bool use_settings_random_
bke::greasepencil::Drawingdrawing_

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 291 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 743 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_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(), drawing_, blender::ed::sculpt_paint::greasepencil::extend_curve(), blender::bke::fill_attribute_range_default(), blender::bke::SpanAttributeWriter< T >::finish(), blender::math::floor(), IndexRange::from_single(), GP_TOOL_FLAG_PAINT_ONBACK, ToolSettings::gpencil_flags, blender::IndexRange::index_range(), blender::math::interpolate(), 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(), randomize_color(), randomize_opacity(), randomize_radius(), randomize_rotation(), self, settings_, blender::math::sin(), blender::IndexRange::size(), blender::MutableSpan< T >::slice(), blender::bke::SpanAttributeWriter< T >::span, 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

◆ randomize_color()

◆ randomize_opacity()

float blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_opacity ( PaintOperation & self,
const float distance,
const float opacity,
const float pressure )
inline

◆ randomize_radius()

float blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_radius ( PaintOperation & self,
const float distance,
const float radius,
const float pressure )
inline

◆ randomize_rotation()

float blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::randomize_rotation ( PaintOperation & self,
const float pressure )
inline

Member Data Documentation

◆ brush_

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

◆ drawing_

bke::greasepencil::Drawing* blender::ed::sculpt_paint::greasepencil::PaintOperationExecutor::drawing_

◆ fill_color_

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

Definition at line 299 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 293 of file grease_pencil_paint.cc.

◆ scene_

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

Definition at line 292 of file grease_pencil_paint.cc.

Referenced by PaintOperationExecutor().

◆ settings_

◆ softness_

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

Definition at line 300 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_

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