35 Brush *saved_active_brush_;
36 char saved_mask_brush_tool_;
37 int saved_smooth_size_;
39 void toggle_smooth_brush_on(
const bContext &
C);
40 void toggle_smooth_brush_off(
const bContext &
C);
55void SmoothOperation::toggle_smooth_brush_on(
const bContext &
C)
62 saved_mask_brush_tool_ = current_brush->
mask_tool;
74 saved_active_brush_ = current_brush;
82void SmoothOperation::toggle_smooth_brush_off(
const bContext &
C)
94 if (saved_active_brush_) {
97 saved_active_brush_ =
nullptr;
104 toggle_smooth_brush_on(
C);
135 const int iterations = 2;
139 return brush_point_influence(paint,
141 view_positions[point_],
143 params.multi_frame_falloff);
146 point_mask.
to_bools(selection_array);
149 bool changed =
false;
159 params.drawing.tag_positions_changed();
186 curves.tag_radii_changed();
215 toggle_smooth_brush_off(
C);
222 return std::make_unique<SmoothOperation>(stroke_mode, temp_smooth);
void BKE_brush_size_set(Paint *paint, Brush *brush, int size)
int BKE_brush_size_get(const Paint *paint, const Brush *brush)
Main * CTX_data_main(const bContext *C)
Low-level operations for curves.
Low-level operations for grease pencil.
bool BKE_paint_brush_set_essentials(Main *bmain, Paint *paint, const char *name)
bool BKE_paint_brush_set(Paint *paint, Brush *brush)
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush_from_essentials(Main *bmain, PaintMode paint_mode, const char *name)
Brush * BKE_paint_brush(Paint *paint)
@ GP_SCULPT_FLAGMODE_APPLY_UV
@ GP_SCULPT_FLAGMODE_APPLY_POSITION
@ GP_SCULPT_FLAGMODE_APPLY_THICKNESS
@ GP_SCULPT_FLAGMODE_APPLY_STRENGTH
static VArray from_func(const int64_t size, GetFunc get_func)
static VArray from_span(Span< T > values)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
float2 prev_mouse_position
GreasePencilStrokeOperationCommon()=default
void foreach_editable_drawing_with_automask(const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams ¶ms, const IndexMask &points)> fn) const
void stroke_extended(const InputSample &extension_sample)
void init_stroke(const bContext &C, const InputSample &start_sample)
float2 start_mouse_position
void init_auto_masking(const bContext &C, const InputSample &start_sample)
BrushStrokeMode stroke_mode
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
GreasePencilStrokeOperationCommon()=default
SmoothOperation(const BrushStrokeMode stroke_mode, const bool temp_smooth=false)
void on_stroke_done(const bContext &C) override
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void to_bools(MutableSpan< bool > r_bools) const
void init_brush(Brush &brush)
Array< float2 > calculate_view_positions(const GreasePencilStrokeParams ¶ms, const IndexMask &selection)
std::unique_ptr< CurvesSculptStrokeOperation > new_smooth_operation()
void smooth_curve_positions(bke::CurvesGeometry &curves, const IndexMask &curves_to_smooth, const VArray< bool > &point_selection, int iterations, const VArray< float > &influence_by_point, bool smooth_ends, bool keep_shape)
void smooth_curve_attribute(const IndexMask &curves_to_smooth, const OffsetIndices< int > points_by_curve, const VArray< bool > &point_selection, const VArray< bool > &cyclic, int iterations, float influence, bool smooth_ends, bool keep_shape, GMutableSpan attribute_data)
struct CurveMapping * curve_distance_falloff
struct BrushGpencilSettings * gpencil_settings