56 const float2 &co = view_positions[point_i];
58 paint, brush, co, extension_sample,
params.multi_frame_falloff);
59 if (influence <= 0.0f) {
63 const float influence_squared = influence * influence / 25.0f;
64 const float influence_final =
invert ? 1.0 + influence_squared :
65 1.0f - influence_squared;
67 projection_fn, deformation, point_i, (target - co) * (1.0f - influence_final));
70 params.drawing.tag_positions_changed();
78 return std::make_unique<PinchOperation>(stroke_mode);
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)
bool is_inverted(const Brush &brush) const
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)
void init_auto_masking(const bContext &C, const InputSample &start_sample)
void on_stroke_extended(const bContext &C, const InputSample &extension_sample) override
GreasePencilStrokeOperationCommon()=default
void on_stroke_done(const bContext &) override
void on_stroke_begin(const bContext &C, const InputSample &start_sample) override
void foreach_index(Fn &&fn) const
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
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)
std::unique_ptr< GreasePencilStrokeOperation > new_pinch_operation(BrushStrokeMode stroke_mode)
bke::crazyspace::GeometryDeformation get_drawing_deformation(const GreasePencilStrokeParams ¶ms)
float3 compute_orig_delta(const DeltaProjectionFunc &projection_fn, const bke::crazyspace::GeometryDeformation &deformation, int index, const float2 &screen_delta)
std::function< float3(const float3 position, const float2 &screen_delta)> DeltaProjectionFunc
VecBase< float, 2 > float2