33 return std::accumulate(values.begin(), values.end(),
float2(0)) / values.size();
53 if (&
params.layer != grease_pencil.get_active_layer()) {
58 const bool keep_world_transform =
false;
61 bmain,
object,
params.drawing, clipboard_to_layer, keep_world_transform,
false);
71 pasted_points_by_curve[0].start(), pasted_points_by_curve.
total_size());
83 for (
const int point_i :
range) {
84 positions[point_i] = projection_fn(deformation.positions[point_i],
mouse_delta);
87 params.drawing.tag_positions_changed();
101 return std::make_unique<CloneOperation>(stroke_mode);
Object * CTX_data_active_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
Low-level operations for curves.
Low-level operations for grease pencil.
MutableSpan< T > as_mutable_span()
constexpr bool is_empty() const
static constexpr IndexRange from_begin_size(const int64_t begin, const int64_t size)
void on_stroke_done(const bContext &) 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
float2 mouse_delta(const InputSample &input_sample) const
GreasePencilStrokeOperationCommon()
void stroke_extended(const InputSample &extension_sample)
void init_stroke(const bContext &C, const InputSample &start_sample)
void foreach_editable_drawing(const bContext &C, FunctionRef< bool(const GreasePencilStrokeParams ¶ms)> fn) const
OffsetIndices slice(const IndexRange range) const
IndexRange clipboard_paste_strokes(Main &bmain, Object &object, bke::greasepencil::Drawing &drawing, const float4x4 &transform, const bool keep_world_transform, const bool paste_back)
static float2 arithmetic_mean(Span< float2 > values)
std::unique_ptr< GreasePencilStrokeOperation > new_clone_operation(BrushStrokeMode stroke_mode)
Array< float2 > calculate_view_positions(const GreasePencilStrokeParams ¶ms, const IndexMask &selection)
bke::crazyspace::GeometryDeformation get_drawing_deformation(const GreasePencilStrokeParams ¶ms)
std::function< float3(const float3 position, const float2 &screen_delta)> DeltaProjectionFunc
CartesianBasis invert(const CartesianBasis &basis)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))