Blender V4.5
ED_grease_pencil.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BKE_grease_pencil.hh"
12
14#include "BLI_index_mask_fwd.hh"
16#include "BLI_set.hh"
17#include "BLI_task.hh"
18
19#include "ED_keyframes_edit.hh"
20#include "ED_select_utils.hh"
21
22#include "WM_api.hh"
23
24struct bContext;
27struct Main;
28struct Object;
29struct KeyframeEditData;
30struct MDeformVert;
31struct wmKeyConfig;
32struct wmOperator;
33struct GPUOffScreen;
34struct ToolSettings;
35struct Scene;
36struct UndoType;
37struct ViewDepths;
38struct View3D;
39struct ViewContext;
40struct BVHTree;
42struct RV3DMatrixStore;
43
44namespace blender {
46namespace bke {
47enum class AttrDomain : int8_t;
48class CurvesGeometry;
49} // namespace bke
50} // namespace blender
51
52enum {
55};
56
57/* -------------------------------------------------------------------- */
60
65
87
89
91
96 const ToolSettings *tool_settings);
98 const ToolSettings *tool_settings);
100 const ToolSettings *tool_settings);
102 const Object *object);
110 const Object *object);
111
113
115
116enum class ReprojectMode : int8_t { Front, Side, Top, View, Cursor, Surface, Keep };
117
119
120enum class DrawingPlacementPlane : int8_t { View, Front, Side, Top, Cursor };
121
123 const ARegion *region_;
124 const View3D *view3d_;
125
128 ViewDepths *depth_cache_ = nullptr;
129 bool use_project_only_selected_ = false;
130 float surface_offset_;
131
132 float3 placement_loc_;
133 float3 placement_normal_;
134 /* Optional explicit placement plane. */
135 std::optional<float4> placement_plane_;
136
137 float4x4 layer_space_to_world_space_;
138 float4x4 world_space_to_layer_space_;
139
140 public:
141 DrawingPlacement() = default;
142 DrawingPlacement(const Scene &scene,
143 const ARegion &region,
144 const View3D &view3d,
145 const Object &eval_object,
146 const bke::greasepencil::Layer *layer);
147
151 DrawingPlacement(const Scene &scene,
152 const ARegion &region,
153 const View3D &view3d,
154 const Object &eval_object,
155 const bke::greasepencil::Layer *layer,
156 ReprojectMode reproject_mode,
157 float surface_offset = 0.0f,
158 ViewDepths *view_depths = nullptr);
164
165 bool use_project_to_surface() const;
166 bool use_project_to_stroke() const;
167
168 void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d);
169
174 std::optional<float3> project_depth(float2 co) const;
175
179 float3 project(float2 co, bool &clipped) const;
180 float3 project(float2 co) const;
181 void project(Span<float2> src, MutableSpan<float3> dst) const;
186
190 float3 place(float2 co, float depth) const;
191
195 float3 reproject(float3 pos) const;
196 void reproject(Span<float3> src, MutableSpan<float3> dst) const;
197
198 float4x4 to_world_space() const;
199
201 std::optional<float> get_depth(float2 co) const;
202
203 private:
205 float3 try_project_depth(float2 co) const;
206};
207
209 const eBezTriple_KeyframeType key_type);
210
211bool snap_selected_frames(GreasePencil &grease_pencil,
213 Scene &scene,
214 const eEditKeyframes_Snap mode);
215
216bool mirror_selected_frames(GreasePencil &grease_pencil,
218 Scene &scene,
219 const eEditKeyframes_Mirror mode);
220
227
229
231
233 /* Datatype for use in copy/paste buffer. */
240
246
248 int first_frame{std::numeric_limits<int>::max()};
249 int last_frame{std::numeric_limits<int>::min()};
250 int cfra{0};
251
252 void clear()
253 {
254 copy_buffer.clear();
255 first_frame = std::numeric_limits<int>::max();
256 last_frame = std::numeric_limits<int>::min();
257 cfra = 0;
258 }
259};
260
262 Object *parent,
263 StringRefNull bone,
264 bool keep_transform);
265
266void grease_pencil_layer_parent_clear(bke::greasepencil::Layer &layer, bool keep_transform);
267
268bool grease_pencil_copy_keyframes(bAnimContext *ac, KeyframeClipboard &clipboard);
269
271 const eKeyPasteOffset offset_mode,
272 const eKeyMergeMode merge_mode,
273 const KeyframeClipboard &clipboard);
274
280 const int frame_number,
281 const short select_mode);
282
284 const int frame_number,
285 const short select_mode);
286
287void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode);
288
291 const short tool,
292 const short select_mode);
293
295 const float min,
296 const float max,
297 const short select_mode);
298
303
309bool ensure_active_keyframe(const Scene &scene,
310 GreasePencil &grease_pencil,
312 bool duplicate_previous_key,
313 bool &r_inserted_keyframe);
314
316 const bke::greasepencil::Layer &layer);
317
332
333float opacity_from_input_sample(const float pressure,
334 const Brush *brush,
335 const BrushGpencilSettings *settings);
336float radius_from_input_sample(const RegionView3D *rv3d,
337 const ARegion *region,
338 const Brush *brush,
339 float pressure,
340 float3 location,
341 float4x4 to_world,
342 const BrushGpencilSettings *settings);
344 wmOperator *op,
345 bool use_duplicate_previous_key);
347 const ARegion *region,
348 const float2 &mouse,
349 const DrawingPlacement &placement);
350
353 const int layer_index;
354 const int frame_number;
355 /* This is used by the onion skinning system. A value of 0 means the drawing is on the current
356 * frame. Negative values are before the current frame, positive values are drawings after the
357 * current frame. The magnitude of the value indicates how far the drawing is from the current
358 * frame (either in absolute frames, or in number of keyframes). */
359 const int onion_id;
360};
368 GreasePencil &grease_pencil);
370 GreasePencil &grease_pencil);
372 const Scene &scene, GreasePencil &grease_pencil);
374 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
376 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
378 const GreasePencil &grease_pencil,
379 bool do_onion_skinning);
380
381IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
382 const bke::greasepencil::Drawing &drawing,
383 int layer_index,
384 IndexMaskMemory &memory);
386 const bke::greasepencil::Drawing &drawing,
387 int layer_index,
388 IndexMaskMemory &memory);
390 const bke::greasepencil::Drawing &drawing,
391 const int mat_i,
392 IndexMaskMemory &memory);
394 const bke::greasepencil::Drawing &drawing,
395 int layer_index,
396 IndexMaskMemory &memory);
398 const MutableDrawingInfo &info,
399 bke::AttrDomain selection_domain,
400 IndexMaskMemory &memory);
401
402IndexMask retrieve_visible_strokes(Object &grease_pencil_object,
403 const bke::greasepencil::Drawing &drawing,
404 IndexMaskMemory &memory);
406 const bke::greasepencil::Drawing &drawing,
407 IndexMaskMemory &memory);
408
410 const bke::greasepencil::Drawing &drawing,
411 int layer_index,
412 IndexMaskMemory &memory);
414 const bke::greasepencil::Drawing &drawing,
415 int layer_index,
416 bke::AttrDomain selection_domain,
417 IndexMaskMemory &memory);
418
420 const bke::greasepencil::Drawing &drawing,
421 int layer_index,
422 IndexMaskMemory &memory);
424 const bke::greasepencil::Drawing &drawing,
425 int layer_index,
426 IndexMaskMemory &memory);
428 const bke::greasepencil::Drawing &drawing,
429 int layer_index,
430 IndexMaskMemory &memory);
432 const bke::greasepencil::Drawing &drawing,
433 int layer_index,
434 bke::AttrDomain selection_domain,
435 IndexMaskMemory &memory);
436bool has_editable_layer(const GreasePencil &grease_pencil);
437
438void create_blank(Main &bmain, Object &object, int frame_number);
439void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
440void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
441
454 float epsilon,
455 FunctionRef<float(int64_t, int64_t, int64_t)> dist_function,
456 MutableSpan<bool> points_to_delete);
457
459 float error_threshold,
460 const IndexMask &corner_mask);
461
463 float radius_min,
464 float radius_max,
465 int samples_max,
466 float angle_threshold,
467 IndexMaskMemory &memory);
468
474 const float merge_distance,
475 const IndexMask &selection,
476 const bke::AttributeFilter &attribute_filter);
477
481int curve_merge_by_distance(const IndexRange points,
482 const Span<float> distances,
483 const IndexMask &selection,
484 const float merge_distance,
485 MutableSpan<int> r_merge_indices);
486
491 const ARegion &region,
492 const bke::CurvesGeometry &src_curves,
493 const float4x4 &layer_to_world,
494 const float merge_distance,
495 const IndexMask &selection,
496 const bke::AttributeFilter &attribute_filter);
497
510 float factor;
512 bool is_cut;
513 /* Additional attributes changes that can be stored to be used after a call to
514 * compute_topology_change.
515 * Note that they won't be automatically updated in the destination's attributes.
516 */
517 float opacity;
518
522 bool is_src_end_point() const
523 {
524 /* The src_next_point index increments for all points except the last, where it is set to the
525 * first point index. This can be used to detect the curve end from the source index alone.
526 */
528 }
529};
530
545 const bke::CurvesGeometry &src,
547 const Span<Vector<PointTransferData>> src_to_dst_points,
548 const bool keep_caps);
549
552
556 int active_vertex_group,
557 Span<bool> vertex_group_is_locked,
558 Span<bool> vertex_group_is_bone_deformed);
559
561bool add_armature_vertex_groups(Object &object, const Object &armature);
564void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature);
567void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature);
568
569void clipboard_free();
574 Object &object,
575 const float4x4 &object_to_paste_layer,
576 bool keep_world_transform,
577 bool paste_back,
579
584 /* Use the current view projection unchanged. */
586 /* Fit all strokes into the view (may change pixel size). */
588};
589
600
619 const Brush &brush,
620 const Scene &scene,
621 const bke::greasepencil::Layer &layer,
622 const VArray<bool> &boundary_layers,
623 Span<DrawingInfo> src_drawings,
624 bool invert,
625 const std::optional<float> alpha_threshold,
626 const float2 &fill_point,
627 const ExtensionData &extensions,
628 FillToolFitMethod fit_method,
629 int stroke_material_index,
630 bool keep_images);
631
632namespace image_render {
633
640
644RegionViewData region_init(ARegion &region, const int2 &win_size);
648void region_reset(ARegion &region, const RegionViewData &data);
649
653GPUOffScreen *image_render_begin(const int2 &win_size);
657Image *image_render_end(Main &bmain, GPUOffScreen *buffer);
658
666void compute_view_matrices(const ViewContext &view_context,
667 const Scene &scene,
668 const int2 &win_size,
669 const float2 &zoom,
670 const float2 &offset);
671
672void set_view_matrix(const RegionView3D &rv3d);
673void clear_view_matrix();
674void set_projection_matrix(const RegionView3D &rv3d);
676
680void draw_dot(const float4x4 &transform,
681 const float3 &position,
682 float point_size,
683 const ColorGeometry4f &color);
684
690 Span<float3> positions,
691 const VArray<ColorGeometry4f> &colors,
692 bool cyclic,
693 float line_width);
694
699 const IndexRange indices,
700 Span<float3> centers,
701 const VArray<float> &radii,
702 const VArray<ColorGeometry4f> &colors,
703 const float2 &viewport_size,
704 const float line_width,
705 const bool fill);
706
710void draw_lines(const float4x4 &transform,
712 Span<float3> start_positions,
713 Span<float3> end_positions,
714 const VArray<ColorGeometry4f> &colors,
715 float line_width);
716
722 const int2 &win_size,
723 const Object &object,
724 const bke::greasepencil::Drawing &drawing,
725 const float4x4 &transform,
726 const IndexMask &strokes_mask,
727 const VArray<ColorGeometry4f> &colors,
728 bool use_xray,
729 float radius_scale = 1.0f);
730
731} // namespace image_render
732
733enum class InterpolateFlipMode : int8_t {
734 /* No flip. */
735 None = 0,
736 /* Flip always. */
738 /* Flip if needed. */
740};
741
742enum class InterpolateLayerMode : int8_t {
743 /* Only interpolate on the active layer. */
745 /* Interpolate strokes on every layer. */
747};
748
760 const IndexMask &strokes,
761 const float4x4 &transform,
762 int corner_subdivisions,
763 float outline_radius,
764 float outline_offset,
765 int material_index);
766
767/* Function that generates an update mask for a selection operation. */
769 const IndexMask &universe,
770 StringRef attribute_name,
771 IndexMaskMemory &memory)>;
772
773bool selection_update(const ViewContext *vc,
774 const eSelectOp sel_op,
775 SelectionUpdateFunc select_operation);
776
777/* BVHTree and associated data for 2D curve projection. */
779 BVHTree *tree = nullptr;
780 /* Projected coordinates for each tree element. */
783 /* BVH element index range for each drawing. */
785};
786
791 const Object &object,
792 const GreasePencil &grease_pencil,
794 int frame_number);
796
813 const IndexMask &curve_mask,
814 const Span<float2> screen_space_positions,
815 const Curves2DBVHTree &tree_data,
816 IndexRange tree_data_range,
817 MutableSpan<bool> r_hits,
818 std::optional<MutableSpan<float>> r_first_intersect_factors,
819 std::optional<MutableSpan<float>> r_last_intersect_factors);
820
841 /* Segment start index for each curve, can be used as \a OffsetIndices. */
843 /* Point indices where new segments start. */
845 /* Fraction of the start point on the line segment to the next point. */
847};
848
869 const IndexMask &curve_mask,
870 const Span<float2> screen_space_positions,
871 const Curves2DBVHTree &tree_data,
872 IndexRange tree_data_range);
873
875 const IndexMask &selection,
876 bke::AttrDomain selection_domain,
877 StringRef attribute_name,
878 GrainSize grain_size,
879 eSelectOp sel_op);
880
882 const IndexMask &point_selection,
883 StringRef attribute_name,
884 const Curves2DBVHTree &tree_data,
885 IndexRange tree_data_range,
886 GrainSize grain_size,
887 eSelectOp sel_op);
888
889namespace trim {
891 Span<float2> screen_space_positions,
892 Span<rcti> screen_space_curve_bounds,
893 const IndexMask &curve_selection,
894 const Vector<Vector<int>> &selected_points_in_curves,
895 bool keep_caps);
896}; // namespace trim
897
898void merge_layers(const GreasePencil &src_grease_pencil,
899 const Span<Vector<int>> src_layer_indices_by_dst_layer,
900 GreasePencil &dst_grease_pencil);
901
902/* Lineart */
903
904/* Stores the maximum calculation range in the whole modifier stack for line art so the cache can
905 * cover everything that will be visible. */
913
916 const LineartLimitInfo &info,
917 const bool cache_is_ready);
918
920
922
923/* Make sure selection domain is updated to match the current selection mode. */
925
931
936void resize_single_curve(bke::CurvesGeometry &curves, bool at_end, int new_points_num);
937
945float randomize_radius(const BrushGpencilSettings &settings,
946 float stroke_factor,
947 float distance,
948 float radius,
949 float pressure);
957float randomize_opacity(const BrushGpencilSettings &settings,
958 float stroke_factor,
959 float distance,
960 float opacity,
961 float pressure);
968float randomize_rotation(const BrushGpencilSettings &settings,
969 float stroke_factor,
970 float distance,
971 float pressure);
978float randomize_rotation(const BrushGpencilSettings &settings,
980 float stroke_factor,
981 float pressure);
992 const std::optional<BrushColorJitterSettings> &jitter,
993 float stroke_hue_factor,
994 float stroke_saturation_factor,
995 float stroke_value_factor,
996 float distance,
998 float pressure);
999
1009void apply_eval_grease_pencil_data(const GreasePencil &eval_grease_pencil,
1010 int eval_frame,
1011 const IndexMask &orig_layers,
1012 GreasePencil &orig_grease_pencil);
1013
1018
1019} // namespace blender::ed::greasepencil
Low-level operations for grease pencil.
eBezTriple_KeyframeType
void ED_interpolatetool_modal_keymap(wmKeyConfig *keyconf)
blender::bke::AttrDomain ED_grease_pencil_sculpt_selection_domain_get(const ToolSettings *tool_settings)
void ED_undosys_type_grease_pencil(UndoType *ut)
void GREASE_PENCIL_OT_stroke_trim(wmOperatorType *ot)
void ED_operatortypes_grease_pencil_edit()
void ED_operatortypes_grease_pencil_trace()
bool ED_grease_pencil_sculpt_segment_selection_enabled(const ToolSettings *tool_settings)
blender::bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings)
void ED_operatormacros_grease_pencil()
void ED_operatortypes_grease_pencil_join()
void ED_primitivetool_modal_keymap(wmKeyConfig *keyconf)
bool ED_grease_pencil_edit_segment_selection_enabled(const ToolSettings *tool_settings)
void ED_filltool_modal_keymap(wmKeyConfig *keyconf)
void ED_operatortypes_grease_pencil_frames()
blender::bke::AttrDomain ED_grease_pencil_vertex_selection_domain_get(const ToolSettings *tool_settings)
@ LAYER_REORDER_BELOW
@ LAYER_REORDER_ABOVE
void ED_operatortypes_grease_pencil_draw()
wmOperatorStatus ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op)
void ED_keymap_grease_pencil(wmKeyConfig *keyconf)
void ED_operatortypes_grease_pencil_primitives()
void ED_operatortypes_grease_pencil_select()
void ED_operatortypes_grease_pencil()
void ED_operatortypes_grease_pencil_layers()
blender::bke::AttrDomain ED_grease_pencil_selection_domain_get(const ToolSettings *tool_settings, const Object *object)
void ED_operatortypes_grease_pencil_lineart()
void ED_operatortypes_grease_pencil_modes()
void ED_operatortypes_grease_pencil_weight_paint()
void ED_operatortypes_grease_pencil_interpolate()
bool ED_grease_pencil_segment_selection_enabled(const ToolSettings *tool_settings, const Object *object)
void ED_operatortypes_grease_pencil_material()
bool ED_grease_pencil_vertex_segment_selection_enabled(const ToolSettings *tool_settings)
void ED_operatortypes_grease_pencil_bake_animation()
eEditKeyframes_Mirror
eKeyPasteOffset
eEditKeyframes_Snap
eSelectOp
static void View(GHOST_IWindow *window, bool stereo, int eye=0)
#define C
Definition RandGen.cpp:29
BMesh const char void * data
BPy_StructRNA * depsgraph
long long int int64_t
DrawingPlacement & operator=(const DrawingPlacement &other)
std::optional< float > get_depth(float2 co) const
void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d)
float3 place(float2 co, float depth) const
std::optional< float3 > project_depth(float2 co) const
float3 project(float2 co, bool &clipped) const
static ushort indices[]
uint pos
float distance(VecOp< float, D >, VecOp< float, D >) RET
CCL_NAMESPACE_BEGIN ccl_device float invert(const float color, const float factor)
Definition invert.h:11
void compute_view_matrices(const ViewContext &view_context, const Scene &scene, const int2 &win_size, const float2 &zoom, const float2 &offset)
void region_reset(ARegion &region, const RegionViewData &data)
void draw_lines(const float4x4 &transform, IndexRange indices, Span< float3 > start_positions, Span< float3 > end_positions, const VArray< ColorGeometry4f > &colors, float line_width)
Image * image_render_end(Main &bmain, GPUOffScreen *buffer)
void draw_grease_pencil_strokes(const RegionView3D &rv3d, const int2 &win_size, const Object &object, const bke::greasepencil::Drawing &drawing, const float4x4 &transform, const IndexMask &strokes_mask, const VArray< ColorGeometry4f > &colors, const bool use_xray, const float radius_scale)
RegionViewData region_init(ARegion &region, const int2 &win_size)
void draw_circles(const float4x4 &transform, const IndexRange indices, Span< float3 > centers, const VArray< float > &radii, const VArray< ColorGeometry4f > &colors, const float2 &viewport_size, const float line_width, const bool fill)
void draw_dot(const float4x4 &transform, const float3 &position, const float point_size, const ColorGeometry4f &color)
void draw_polyline(const float4x4 &transform, const IndexRange indices, Span< float3 > positions, const VArray< ColorGeometry4f > &colors, const bool cyclic, const float line_width)
GPUOffScreen * image_render_begin(const int2 &win_size)
bke::CurvesGeometry trim_curve_segments(const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const Span< rcti > screen_space_curve_bounds, const IndexMask &curve_selection, const Vector< Vector< int > > &selected_points_in_curves, const bool keep_caps)
void find_curve_intersections(const bke::CurvesGeometry &curves, const IndexMask &curve_mask, const Span< float2 > screen_space_positions, const Curves2DBVHTree &tree_data, const IndexRange tree_data_range, MutableSpan< bool > r_hits, std::optional< MutableSpan< float > > r_first_intersect_factors, std::optional< MutableSpan< float > > r_last_intersect_factors)
void select_frames_at(bke::greasepencil::LayerGroup &layer_group, const int frame_number, const short select_mode)
IndexMask retrieve_editable_and_selected_elements(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
bool active_grease_pencil_poll(bContext *C)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
Set< std::string > get_bone_deformed_vertex_group_names(const Object &object)
blender::bke::CurvesGeometry curves_merge_by_distance(const bke::CurvesGeometry &src_curves, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
float randomize_rotation(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float pressure)
bool remove_all_selected_frames(GreasePencil &grease_pencil, bke::greasepencil::Layer &layer)
void resize_single_curve(bke::CurvesGeometry &curves, const bool at_end, const int new_points_num)
bool grease_pencil_copy_keyframes(bAnimContext *ac, KeyframeClipboard &clipboard)
IndexMask retrieve_editable_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
bool grease_pencil_paste_keyframes(bAnimContext *ac, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, const KeyframeClipboard &clipboard)
FunctionRef< IndexMask(const ed::greasepencil::MutableDrawingInfo &info, const IndexMask &universe, StringRef attribute_name, IndexMaskMemory &memory)> SelectionUpdateFunc
bool ensure_active_keyframe(const Scene &scene, GreasePencil &grease_pencil, bke::greasepencil::Layer &layer, const bool duplicate_previous_key, bool &r_inserted_keyframe)
int64_t ramer_douglas_peucker_simplify(const IndexRange range, const float epsilon, const FunctionRef< float(int64_t, int64_t, int64_t)> dist_function, MutableSpan< bool > points_to_delete)
void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, const int frame_number)
bool selection_update(const ViewContext *vc, const eSelectOp sel_op, SelectionUpdateFunc select_operation)
bool ensure_selection_domain(ToolSettings *ts, Object *object)
GreasePencil * from_context(bContext &C)
float randomize_opacity(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float opacity, const float pressure)
bool grease_pencil_vertex_painting_poll(bContext *C)
IndexMask retrieve_editable_fill_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
float opacity_from_input_sample(const float pressure, const Brush *brush, const BrushGpencilSettings *settings)
bool editable_grease_pencil_point_selection_poll(bContext *C)
void grease_pencil_layer_parent_clear(bke::greasepencil::Layer &layer, const bool keep_transform)
IndexMask retrieve_editable_elements(Object &object, const MutableDrawingInfo &info, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
IndexMask retrieve_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory)
ColorGeometry4f randomize_color(const BrushGpencilSettings &settings, const std::optional< BrushColorJitterSettings > &jitter, const float stroke_hue_factor, const float stroke_saturation_factor, const float stroke_value_factor, const float distance, const ColorGeometry4f color, const float pressure)
void set_selected_frames_type(bke::greasepencil::Layer &layer, const eBezTriple_KeyframeType key_type)
void add_single_curve(bke::CurvesGeometry &curves, const bool at_end)
bool editable_grease_pencil_with_region_view3d_poll(bContext *C)
float randomize_radius(const BrushGpencilSettings &settings, const float stroke_factor, const float distance, const float radius, const float pressure)
bool mirror_selected_frames(GreasePencil &grease_pencil, bke::greasepencil::Layer &layer, Scene &scene, const eEditKeyframes_Mirror mode)
void free_curves_2d_bvh_data(Curves2DBVHTree &data)
bke::CurvesGeometry fill_strokes(const ViewContext &view_context, const Brush &brush, const Scene &scene, const bke::greasepencil::Layer &layer, const VArray< bool > &boundary_layers, Span< DrawingInfo > src_drawings, bool invert, const std::optional< float > alpha_threshold, const float2 &fill_point, const ExtensionData &extensions, FillToolFitMethod fit_method, int stroke_material_index, bool keep_images)
void select_frames_range(bke::greasepencil::TreeNode &node, const float min, const float max, const short select_mode)
CurveSegmentsData find_curve_segments(const bke::CurvesGeometry &curves, const IndexMask &curve_mask, const Span< float2 > screen_space_positions, const Curves2DBVHTree &tree_data, const IndexRange tree_data_range)
void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature)
IndexMask retrieve_visible_points(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
void get_lineart_modifier_limits(const Object &ob, blender::ed::greasepencil::LineartLimitInfo &info)
Vector< DrawingInfo > retrieve_visible_drawings(const Scene &scene, const GreasePencil &grease_pencil, const bool do_onion_skinning)
float radius_from_input_sample(const RegionView3D *rv3d, const ARegion *region, const Brush *brush, const float pressure, const float3 location, const float4x4 to_world, const BrushGpencilSettings *settings)
void create_blank(Main &bmain, Object &object, const int frame_number)
IndexMask retrieve_editable_strokes_by_material(Object &object, const bke::greasepencil::Drawing &drawing, const int mat_i, IndexMaskMemory &memory)
IndexMask retrieve_editable_and_selected_fill_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
void create_keyframe_edit_data_selected_frames_list(KeyframeEditData *ked, const bke::greasepencil::Layer &layer)
void set_lineart_modifier_limits(GreasePencilLineartModifierData &lmd, const blender::ed::greasepencil::LineartLimitInfo &info, const bool cache_is_ready)
bool has_editable_layer(const GreasePencil &grease_pencil)
void select_frames_region(KeyframeEditData *ked, bke::greasepencil::TreeNode &node, const short tool, const short select_mode)
bool has_any_frame_selected(const bke::greasepencil::Layer &layer)
void normalize_vertex_weights(MDeformVert &dvert, const int active_vertex_group, const Span< bool > vertex_group_is_locked, const Span< bool > vertex_group_is_bone_deformed)
IndexMask polyline_detect_corners(Span< float2 > points, const float radius_min, const float radius_max, const int samples_max, const float angle_threshold, IndexMaskMemory &memory)
bool editable_grease_pencil_poll(bContext *C)
bool grease_pencil_selection_poll(bContext *C)
void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode)
Array< PointTransferData > compute_topology_change(const bke::CurvesGeometry &src, bke::CurvesGeometry &dst, const Span< Vector< PointTransferData > > src_to_dst_points, const bool keep_caps)
void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, const int frame_number)
GreasePencilLineartModifierData * get_first_lineart_modifier(const Object &ob)
IndexMask retrieve_editable_and_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
bool grease_pencil_sculpting_poll(bContext *C)
void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature)
bool apply_mask_as_selection(bke::CurvesGeometry &curves, const IndexMask &selection_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const GrainSize grain_size, const eSelectOp sel_op)
Vector< MutableDrawingInfo > retrieve_editable_drawings_from_layer(const Scene &scene, GreasePencil &grease_pencil, const blender::bke::greasepencil::Layer &layer)
IndexMask retrieve_visible_strokes(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
bke::CurvesGeometry curves_merge_endpoints_by_distance(const ARegion &region, const bke::CurvesGeometry &src_curves, const float4x4 &layer_to_world, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
Array< float2 > polyline_fit_curve(Span< float2 > points, const float error_threshold, const IndexMask &corner_mask)
bool duplicate_selected_frames(GreasePencil &grease_pencil, bke::greasepencil::Layer &layer)
IndexRange paste_all_strokes_from_clipboard(Main &bmain, Object &object, const float4x4 &object_to_paste_layer, const bool keep_world_transform, const bool paste_back, bke::greasepencil::Drawing &drawing)
Vector< MutableDrawingInfo > retrieve_editable_drawings_from_layer_with_falloff(const Scene &scene, GreasePencil &grease_pencil, const blender::bke::greasepencil::Layer &layer)
IndexMask retrieve_visible_bezier_handle_elements(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const bke::AttrDomain selection_domain, IndexMaskMemory &memory)
bool grease_pencil_weight_painting_poll(bContext *C)
Vector< MutableDrawingInfo > retrieve_editable_drawings_with_falloff(const Scene &scene, GreasePencil &grease_pencil)
bool grease_pencil_layer_parent_set(bke::greasepencil::Layer &layer, Object *parent, StringRefNull bone, const bool keep_transform)
wmOperatorStatus grease_pencil_draw_operator_invoke(bContext *C, wmOperator *op, const bool use_duplicate_previous_key)
bool active_grease_pencil_material_poll(bContext *C)
IndexMask retrieve_editable_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
bool add_armature_vertex_groups(Object &object, const Object &ob_armature)
bool grease_pencil_context_poll(bContext *C)
bool remove_fill_guides(bke::CurvesGeometry &curves)
Vector< MutableDrawingInfo > retrieve_editable_drawings(const Scene &scene, GreasePencil &grease_pencil)
Curves2DBVHTree build_curves_2d_bvh_from_visible(const ViewContext &vc, const Object &object, const GreasePencil &grease_pencil, Span< MutableDrawingInfo > drawings, const int frame_number)
void merge_layers(const GreasePencil &src_grease_pencil, const Span< Vector< int > > src_layer_indices_by_dst_layer, GreasePencil &dst_grease_pencil)
bool active_grease_pencil_layer_group_poll(bContext *C)
float4x2 calculate_texture_space(const Scene *scene, const ARegion *region, const float2 &mouse, const DrawingPlacement &placement)
Array< Vector< MutableDrawingInfo > > retrieve_editable_drawings_grouped_per_frame(const Scene &scene, GreasePencil &grease_pencil)
bool apply_mask_as_segment_selection(bke::CurvesGeometry &curves, const IndexMask &point_selection_mask, const StringRef attribute_name, const Curves2DBVHTree &tree_data, const IndexRange tree_data_range, const GrainSize grain_size, const eSelectOp sel_op)
void select_layer_channel(GreasePencil &grease_pencil, bke::greasepencil::Layer *layer)
bool grease_pencil_edit_poll(bContext *C)
bool grease_pencil_painting_poll(bContext *C)
int curve_merge_by_distance(const IndexRange points, const Span< float > distances, const IndexMask &selection, const float merge_distance, MutableSpan< int > r_merge_indices)
bool active_grease_pencil_layer_poll(bContext *C)
bke::CurvesGeometry create_curves_outline(const bke::greasepencil::Drawing &drawing, const IndexMask &strokes, const float4x4 &transform, const int corner_subdivisions, const float outline_radius, const float outline_offset, const int material_index)
void apply_eval_grease_pencil_data(const GreasePencil &eval_grease_pencil, const int eval_frame, const IndexMask &orig_layers, GreasePencil &orig_grease_pencil)
bool select_frame_at(bke::greasepencil::Layer &layer, const int frame_number, const short select_mode)
bool snap_selected_frames(GreasePencil &grease_pencil, bke::greasepencil::Layer &layer, Scene &scene, const eEditKeyframes_Snap mode)
MatBase< float, 4, 4 > float4x4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
MatBase< float, 4, 2 > float4x2
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
Definition BLI_color.hh:342
VecBase< float, 3 > float3
#define min(a, b)
Definition sort.cc:36
const bke::greasepencil::Drawing & drawing
struct blender::ed::greasepencil::ExtensionData::@265316100001155077130350022146237135245145324021 circles
struct blender::ed::greasepencil::ExtensionData::@207123002345000122024010374336267127200316171106 lines
Map< std::string, LayerBufferItem > copy_buffer
max
Definition text_draw.cc:251
wmOperatorType * ot
Definition wm_files.cc:4225