45 const ColorGeometry4f replace_color(color_linear.x, color_linear.y, color_linear.z, 1.0f);
50 params, use_selection_masking, memory);
51 if (!point_selection.
is_empty() && do_points) {
56 paint, brush, view_positions[point_i], extension_sample,
params.multi_frame_falloff);
57 if (influence > 0.0f && vertex_colors[point_i].a > 0.0f) {
58 vertex_colors[point_i] = replace_color;
64 params, use_selection_masking, memory);
65 if (!fill_selection.is_empty() && do_fill) {
71 const IndexRange points = points_by_curve[curve_i];
74 paint, brush, curve_view_positions, extension_sample,
params.multi_frame_falloff);
75 if (influence > 0.0f && fill_colors[curve_i].a > 0.0f) {
76 fill_colors[curve_i] = replace_color;
88 return std::make_unique<VertexReplaceOperation>();
const float * BKE_brush_color_get(const Paint *paint, const Brush *brush)
Scene * CTX_data_scene(const bContext *C)
Low-level operations for curves.
Low-level operations for grease pencil.
Paint * BKE_paint_get_active_from_context(const bContext *C)
Brush * BKE_paint_brush(Paint *paint)
MINLINE void copy_v3_v3(float r[3], const float a[3])
Span< T > as_span() const
GreasePencilStrokeOperationCommon()=default
void init_stroke(const bContext &C, const InputSample &start_sample)
void foreach_editable_drawing(const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams ¶ms, const DeltaProjectionFunc &projection_fn)> fn) const
void on_stroke_done(const bContext &C) override
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void foreach_index(Fn &&fn) const
bool ED_grease_pencil_any_vertex_mask_selection(const ToolSettings *tool_settings)
std::unique_ptr< GreasePencilStrokeOperation > new_vertex_replace_operation()
IndexMask fill_mask_for_stroke_operation(const GreasePencilStrokeParams ¶ms, bool use_selection_masking, IndexMaskMemory &memory)
bool do_vertex_color_fill(const Brush &brush)
IndexMask point_mask_for_stroke_operation(const GreasePencilStrokeParams ¶ms, bool use_selection_masking, IndexMaskMemory &memory)
float brush_point_influence(const Paint &paint, const Brush &brush, const float2 &co, const InputSample &sample, float multi_frame_falloff)
Array< float2 > calculate_view_positions(const GreasePencilStrokeParams ¶ms, const IndexMask &selection)
float brush_fill_influence(const Paint &paint, const Brush &brush, Span< float2 > fill_positions, const InputSample &sample, float multi_frame_falloff)
bool do_vertex_color_points(const Brush &brush)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
struct ToolSettings * toolsettings