Blender V5.3
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
24namespace blender {
25
26struct bContext;
29struct Main;
30struct Object;
31struct KeyframeEditData;
32struct MDeformVert;
33struct wmKeyConfig;
34struct wmOperator;
35struct GPUOffScreen;
36struct ToolSettings;
37struct Scene;
38struct UndoType;
39struct ViewDepths;
40struct View3D;
41struct ViewContext;
42struct BVHTree;
44struct RV3DMatrixStore;
45
47namespace bke {
48enum class AttrDomain : int8_t;
49class CurvesGeometry;
50} // namespace bke
51
52enum {
55};
56
57/* -------------------------------------------------------------------- */
60
65
84void ED_keymap_grease_pencil(wmKeyConfig *keyconf);
85void ED_primitivetool_modal_keymap(wmKeyConfig *keyconf);
86void ED_filltool_modal_keymap(wmKeyConfig *keyconf);
87void ED_interpolatetool_modal_keymap(wmKeyConfig *keyconf);
88void ED_grease_pencil_pentool_modal_keymap(wmKeyConfig *keyconf);
89
90void GREASE_PENCIL_OT_stroke_trim(wmOperatorType *ot);
91void GREASE_PENCIL_OT_stroke_carver(wmOperatorType *ot);
92
93void ED_undosys_type_grease_pencil(UndoType *ut);
94
98bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings);
99bke::AttrDomain ED_grease_pencil_sculpt_selection_domain_get(const ToolSettings *tool_settings);
100bke::AttrDomain ED_grease_pencil_vertex_selection_domain_get(const ToolSettings *tool_settings);
101bke::AttrDomain ED_grease_pencil_selection_domain_get(const ToolSettings *tool_settings,
102 const Object *object);
106bool ED_grease_pencil_any_vertex_mask_selection(const ToolSettings *tool_settings);
107
111bool ED_grease_pencil_edit_segment_selection_enabled(const ToolSettings *tool_settings);
112bool ED_grease_pencil_sculpt_segment_selection_enabled(const ToolSettings *tool_settings);
113bool ED_grease_pencil_vertex_segment_selection_enabled(const ToolSettings *tool_settings);
114bool ED_grease_pencil_segment_selection_enabled(const ToolSettings *tool_settings,
115 const Object *object);
116
118
119namespace ed::greasepencil {
120
122
124
126
128 const ARegion *region_;
129 const View3D *view3d_;
130
133 ViewDepths *depth_cache_ = nullptr;
134 bool use_project_only_selected_ = false;
135 float surface_offset_;
136
137 float3 placement_loc_;
138 float3 placement_normal_;
139 /* Optional explicit placement plane. */
140 std::optional<float4> placement_plane_;
141
142 float4x4 layer_space_to_world_space_;
143 float4x4 world_space_to_layer_space_;
144
145 public:
146 DrawingPlacement() = default;
147 DrawingPlacement(const Scene &scene,
148 const ARegion &region,
149 const View3D &view3d,
150 const Object &eval_object,
152
156 DrawingPlacement(const Scene &scene,
157 const ARegion &region,
158 const View3D &view3d,
159 const Object &eval_object,
161 ReprojectMode reproject_mode,
162 float surface_offset = 0.0f,
163 ViewDepths *view_depths = nullptr);
169
170 bool use_project_to_surface() const;
171 bool use_project_to_stroke() const;
172
173 void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d);
174
179 std::optional<float3> project_depth(float2 co) const;
180
184 float3 project(float2 co, bool &clipped) const;
185 float3 project(float2 co) const;
186 void project(Span<float2> src, MutableSpan<float3> dst) const;
191
195 float3 place(float2 co, float depth) const;
196
200 float3 reproject(float3 pos) const;
201 void reproject(Span<float3> src, MutableSpan<float3> dst) const;
202
203 float4x4 to_world_space() const;
204
206 std::optional<float> get_depth(float2 co) const;
207
208 private:
210 float3 try_project_depth(float2 co) const;
211};
212
214 const eBezTriple_KeyframeType key_type);
215
218 Scene &scene,
219 const eEditKeyframes_Snap mode);
220
223 Scene &scene,
224 const eEditKeyframes_Mirror mode);
225
232
234
236
238 /* Datatype for use in copy/paste buffer. */
245
251
253 int first_frame{std::numeric_limits<int>::max()};
254 int last_frame{std::numeric_limits<int>::min()};
255 int cfra{0};
256
257 void clear()
258 {
260 first_frame = std::numeric_limits<int>::max();
261 last_frame = std::numeric_limits<int>::min();
262 cfra = 0;
263 }
264};
265
267 Object *parent,
268 StringRefNull bone,
269 bool keep_transform);
270
272
273bool grease_pencil_copy_keyframes(bAnimContext *ac, KeyframeClipboard &clipboard);
274
276 const eKeyPasteOffset offset_mode,
277 const eKeyMergeMode merge_mode,
278 const KeyframeClipboard &clipboard);
279
285 const int frame_number,
286 const short select_mode);
287
289 const int frame_number,
290 const short select_mode);
291
292void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode);
293
296 const short tool,
297 const short select_mode);
298
300 const float min,
301 const float max,
302 const short select_mode);
303
308
314bool ensure_active_keyframe(const Scene &scene,
317 bool duplicate_previous_key,
318 bool &r_inserted_keyframe);
319
322
337
339
340float opacity_from_input_sample(const float pressure,
341 const Paint &paint,
342 const Brush *brush,
343 const BrushGpencilSettings *settings);
344float radius_from_input_sample(const RegionView3D *rv3d,
345 const ARegion *region,
346 const Paint &paint,
347 const Brush *brush,
348 float pressure,
349 const float3 &location,
350 const float4x4 &to_world,
351 const BrushGpencilSettings *settings);
353 wmOperator *op,
354 bool use_duplicate_previous_key);
356 const ARegion *region,
357 const float2 &mouse,
358 const DrawingPlacement &placement);
359
362 const int layer_index;
363 const int frame_number;
364 /* This is used by the onion skinning system. A value of 0 means the drawing is on the current
365 * frame. Negative values are before the current frame, positive values are drawings after the
366 * current frame. The magnitude of the value indicates how far the drawing is from the current
367 * frame (either in absolute frames, or in number of keyframes). */
368 const int onion_id;
369};
381 const Scene &scene, GreasePencil &grease_pencil);
388 bool do_onion_skinning);
389
390IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
391 const bke::greasepencil::Drawing &drawing,
392 int layer_index,
393 IndexMaskMemory &memory);
395 const bke::greasepencil::Drawing &drawing,
396 int layer_index,
397 IndexMaskMemory &memory);
399 const bke::greasepencil::Drawing &drawing,
400 const int mat_i,
401 IndexMaskMemory &memory);
403 const bke::greasepencil::Drawing &drawing,
404 int layer_index,
405 IndexMaskMemory &memory);
407 const MutableDrawingInfo &info,
408 bke::AttrDomain selection_domain,
409 IndexMaskMemory &memory);
410
411IndexMask retrieve_visible_strokes(Object &grease_pencil_object,
412 const bke::greasepencil::Drawing &drawing,
413 IndexMaskMemory &memory);
415 const bke::greasepencil::Drawing &drawing,
416 IndexMaskMemory &memory);
417
418/* Note that this the fills that are visible, not the stroke that are also fills. */
420 const bke::greasepencil::Drawing &drawing,
421 IndexMaskMemory &memory);
422
424 const bke::greasepencil::Drawing &drawing,
425 IndexMaskMemory &memory);
427 const bke::greasepencil::Drawing &drawing,
428 IndexMaskMemory &memory);
429
435
437 const bke::greasepencil::Drawing &drawing,
438 eHandleDisplay handle_display,
439 IndexMaskMemory &memory);
441 const bke::greasepencil::Drawing &drawing,
442 int layer_index,
443 eHandleDisplay handle_display,
444 IndexMaskMemory &memory);
446 const bke::greasepencil::Drawing &drawing,
447 int layer_index,
448 bke::AttrDomain selection_domain,
449 eHandleDisplay handle_display,
450 IndexMaskMemory &memory);
451
453 const bke::greasepencil::Drawing &drawing,
454 int layer_index,
455 IndexMaskMemory &memory);
457 const bke::greasepencil::Drawing &drawing,
458 int layer_index,
459 IndexMaskMemory &memory);
461 const bke::greasepencil::Drawing &drawing,
462 int layer_index,
463 IndexMaskMemory &memory);
465 const bke::greasepencil::Drawing &drawing,
466 int layer_index,
467 bke::AttrDomain selection_domain,
468 IndexMaskMemory &memory);
470 const bke::greasepencil::Drawing &drawing,
471 int layer_index,
472 eHandleDisplay handle_display,
473 IndexMaskMemory &memory);
475
476void create_blank(Main &bmain, Object &object, int frame_number);
477void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
478void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
479
492 float epsilon,
493 FunctionRef<float(int64_t, int64_t, int64_t)> dist_function,
494 MutableSpan<bool> points_to_delete);
495
497 float error_threshold,
498 const IndexMask &corner_mask);
499
501 float radius_min,
502 float radius_max,
503 int samples_max,
504 float angle_threshold,
505 IndexMaskMemory &memory);
506
512 const float merge_distance,
513 const IndexMask &selection,
514 const bke::AttributeFilter &attribute_filter);
515
519int curve_merge_by_distance(const IndexRange points,
520 const Span<float> distances,
521 const IndexMask &selection,
522 const float merge_distance,
523 MutableSpan<int> r_merge_indices);
524
529 const ARegion &region,
530 const bke::CurvesGeometry &src_curves,
531 const float4x4 &layer_to_world,
532 const float merge_distance,
533 const IndexMask &selection,
534 const bke::AttributeFilter &attribute_filter);
535
548 float factor;
550 bool is_cut;
551 /* Additional attributes changes that can be stored to be used after a call to
552 * compute_topology_change.
553 * Note that they won't be automatically updated in the destination's attributes.
554 */
555 float opacity;
556
560 bool is_src_end_point() const
561 {
562 /* The src_next_point index increments for all points except the last, where it is set to the
563 * first point index. This can be used to detect the curve end from the source index alone.
564 */
566 }
567};
568
583 const bke::CurvesGeometry &src,
585 const Span<Vector<PointTransferData>> src_to_dst_points,
586 const bool keep_caps);
587
590
594 int active_vertex_group,
595 Span<bool> vertex_group_is_locked,
596 Span<bool> vertex_group_is_bone_deformed);
597
599bool add_armature_vertex_groups(Object &object, const Object &armature);
602void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature);
605void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature);
606
607void clipboard_free();
612 Object &object,
613 const float4x4 &object_to_paste_layer,
614 bool keep_world_transform,
615 bool paste_back,
617
622 /* Use the current view projection unchanged. */
624 /* Fit all strokes into the view (may change pixel size). */
626};
627
638
656 const Brush &brush,
657 const Scene &scene,
659 const VArray<bool> &boundary_layers,
660 const Span<DrawingInfo> src_drawings,
661 bool invert,
662 const std::optional<float> opacity_threshold,
663 const float2 &fill_point,
664 const ExtensionData &extensions,
665 FillToolFitMethod fit_method,
666 bool keep_images);
667
686std::optional<bke::CurvesGeometry> delaunay_fill_strokes(const ViewContext &view_context,
687 const Scene &scene,
689 const VArray<bool> &boundary_layers,
690 const Span<DrawingInfo> src_drawings,
691 bool invert,
692 std::optional<float> opacity_threshold,
693 bool internal_gaps,
694 float gap_factor,
695 const GroupedSpan<float2> &fill_points);
696
697namespace image_render {
698
705
709RegionViewData region_init(ARegion &region, const int2 &win_size);
713void region_reset(ARegion &region, const RegionViewData &data);
714
718GPUOffScreen *image_render_begin(const int2 &win_size);
722Image *image_render_end(Main &bmain, GPUOffScreen *buffer);
723
731void compute_view_matrices(const ViewContext &view_context,
732 const Scene &scene,
733 const int2 &win_size,
734 const float2 &zoom,
735 const float2 &offset);
736
737void set_view_matrix(const RegionView3D &rv3d);
738void clear_view_matrix();
739void set_projection_matrix(const RegionView3D &rv3d);
741
745void draw_dot(const float4x4 &transform,
746 const float3 &position,
747 float point_size,
748 const ColorGeometry4f &color);
749
754 IndexRange indices,
755 Span<float3> positions,
756 const VArray<ColorGeometry4f> &colors,
757 bool cyclic,
758 float line_width);
759
764 const IndexRange indices,
765 Span<float3> centers,
766 const VArray<float> &radii,
767 const VArray<ColorGeometry4f> &colors,
768 const float2 &viewport_size,
769 const float line_width,
770 const bool fill);
771
775void draw_lines(const float4x4 &transform,
776 IndexRange indices,
777 Span<float3> start_positions,
778 Span<float3> end_positions,
779 const VArray<ColorGeometry4f> &colors,
780 float line_width);
781
786 const int2 &win_size,
787 const Object &object,
788 const bke::greasepencil::Drawing &drawing,
789 const float4x4 &transform,
790 const IndexMask &strokes_mask,
791 const VArray<ColorGeometry4f> &colors,
792 bool use_xray,
793 float radius_scale = 1.0f);
794
795} // namespace image_render
796
798 /* No flip. */
799 None = 0,
800 /* Flip always. */
802 /* Flip if needed. */
804};
805
807 /* Only interpolate on the active layer. */
809 /* Interpolate strokes on every layer. */
810 All,
811};
812
824 const IndexMask &strokes,
825 const float4x4 &transform,
826 int corner_subdivisions,
827 float outline_radius,
828 float outline_offset,
829 int material_index);
830
831/* Function that generates an update mask for a selection operation. */
833 const IndexMask &universe,
834 StringRef attribute_name,
835 IndexMaskMemory &memory)>;
836
837bool selection_update(const ViewContext *vc,
838 const eSelectOp sel_op,
839 SelectionUpdateFunc select_operation);
840
841/* BVHTree and associated data for 2D curve projection. */
843 BVHTree *tree = nullptr;
844 /* Projected coordinates for each tree element. */
847 /* BVH element index range for each drawing. */
849};
850
855 const Object &object,
858 int frame_number);
860
878 const IndexMask &curve_mask,
879 const Span<float2> screen_space_positions,
880 const Curves2DBVHTree &tree_data,
881 IndexRange tree_data_range,
882 MutableSpan<bool> r_hits,
883 std::optional<MutableSpan<float>> r_first_intersect_factors,
884 std::optional<MutableSpan<float>> r_last_intersect_factors);
885
906 /* Segment start index for each curve, can be used as \a OffsetIndices. */
908 /* Point indices where new segments start. */
910 /* Fraction of the start point on the line segment to the next point. */
912};
913
927 const IndexMask &curve_mask,
928 const Span<float2> screen_space_positions,
929 const Curves2DBVHTree &tree_data,
930 IndexRange tree_data_range);
931
933 const IndexMask &selection,
934 bke::AttrDomain selection_domain,
935 StringRef attribute_name,
936 eSelectOp sel_op);
937
939 const IndexMask &point_selection,
940 StringRef attribute_name,
941 const Curves2DBVHTree &tree_data,
942 IndexRange tree_data_range,
943 eSelectOp sel_op);
944
945namespace trim {
946
960 Span<float2> screen_space_positions,
961 Span<int2> mcoords,
962 const IndexMask &editable_curves,
963 const IndexMask &visible_curves,
964 bool keep_caps);
965
979 Span<float2> screen_space_positions,
980 const IndexMask &editable_curves,
981 const IndexMask &visible_curves,
982 bool keep_caps);
983}; // namespace trim
984
985namespace boolean {
986
987enum class Operation : int8_t {
988 /* Intersection of the Subject and the Clipping. */
990 /* Union of Subject and Clipping. */
992 /* Differences of Subject with Clipping. */
994};
995
1002
1003/* Project the point from local space to the clipping 2d space. */
1005
1008 ProjectionFunc project_fn,
1009 GroupedSpan<int> shapes,
1010 const IndexMask &editable_shapes,
1011 const IndexMask &clipping_shapes);
1012
1015 ProjectionFunc project_fn,
1016 GroupedSpan<int> shapes,
1017 Span<float4> curve_planes,
1018 const IndexMask &editable_shapes,
1019 const IndexMask &clipping_shapes,
1020 const float4x4 &layer_to_world,
1021 const ARegion &region);
1022
1023} // namespace boolean
1024
1025void merge_layers(const GreasePencil &src_grease_pencil,
1026 const Span<Vector<int>> src_layer_indices_by_dst_layer,
1027 GreasePencil &dst_grease_pencil);
1028
1029/* Lineart */
1030
1031/* Stores the maximum calculation range in the whole modifier stack for line art so the cache can
1032 * cover everything that will be visible. */
1040
1043 const LineartLimitInfo &info,
1044 const bool cache_is_ready);
1045
1047
1049
1050/* Make sure selection domain is updated to match the current selection mode. */
1052
1057void add_single_curve(bke::greasepencil::Drawing &drawing, const bool at_end);
1058
1063void resize_single_curve(bke::CurvesGeometry &curves, bool at_end, int new_points_num);
1064
1072float randomize_radius(const BrushGpencilSettings &settings,
1073 float stroke_factor,
1074 float distance,
1075 float radius,
1076 float pressure);
1084float randomize_opacity(const BrushGpencilSettings &settings,
1085 float stroke_factor,
1086 float distance,
1087 float opacity,
1088 float pressure);
1095float randomize_rotation(const BrushGpencilSettings &settings,
1096 float stroke_factor,
1097 float distance,
1098 float pressure);
1105float randomize_rotation(const BrushGpencilSettings &settings,
1107 float stroke_factor,
1108 float pressure);
1119 const std::optional<BrushColorJitterSettings> &jitter,
1120 float stroke_hue_factor,
1121 float stroke_saturation_factor,
1122 float stroke_value_factor,
1123 float distance,
1125 float pressure);
1126
1136void apply_eval_grease_pencil_data(const GreasePencil &eval_grease_pencil,
1137 int eval_frame,
1138 const IndexMask &orig_layers,
1139 GreasePencil &orig_grease_pencil);
1140
1145
1146} // namespace ed::greasepencil
1147} // namespace blender
Low-level operations for grease pencil.
#define C
Definition RandGen.cpp:29
DBVT_INLINE bool Intersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b)
Definition btDbvt.h:621
btScalar max
void clear()
Definition BLI_map.hh:1038
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
#define point_size
#define position
#define layer
float distance(float, float) RET
float2x2 invert(float2x2 mat)
FunctionRef< float2(const float3)> ProjectionFunc
bke::CurvesGeometry curve_boolean_with_planes(const CurveBooleanOpParameters op_params, const bke::CurvesGeometry &curves, const ProjectionFunc project_fn, const GroupedSpan< int > shapes, const Span< float4 > curve_planes, const IndexMask &editable_shapes, const IndexMask &clipping_shapes, const float4x4 &layer_to_world, const ARegion &region)
bke::CurvesGeometry curve_boolean(const CurveBooleanOpParameters op_params, const bke::CurvesGeometry &curves, const ProjectionFunc project_fn, const GroupedSpan< int > shapes, const IndexMask &editable_shapes, const IndexMask &clipping_shapes)
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_segment_ends(const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const IndexMask &editable_curves, const IndexMask &visible_curves, const bool keep_caps)
bke::CurvesGeometry trim_curve_segments(const bke::CurvesGeometry &src, const Span< float2 > screen_space_positions, const Span< int2 > mcoords, const IndexMask &editable_curves, const IndexMask &visible_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)
bool grease_pencil_draw_operator_begin(bContext *C, wmOperator *op, const bool use_duplicate_previous_key)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
float opacity_from_input_sample(const float pressure, const Paint &paint, const Brush *brush, const BrushGpencilSettings *settings)
Set< std::string > get_bone_deformed_vertex_group_names(const Object &object)
bke::CurvesGeometry curves_merge_by_distance(const bke::CurvesGeometry &src_curves, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
FunctionRef< IndexMask(const ed::greasepencil::MutableDrawingInfo &info, const IndexMask &universe, StringRef attribute_name, IndexMaskMemory &memory)> SelectionUpdateFunc
bke::CurvesGeometry pixel_fill_strokes(const ViewContext &view_context, const Brush &brush, const Scene &scene, const bke::greasepencil::Layer &layer, const VArray< bool > &boundary_layers, const Span< DrawingInfo > src_drawings, bool invert, const std::optional< float > opacity_threshold, const float2 &fill_point, const ExtensionData &extensions, FillToolFitMethod fit_method, bool keep_images)
Definition fill.cc:1008
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)
std::optional< bke::CurvesGeometry > delaunay_fill_strokes(const ViewContext &view_context, const Scene &scene, const bke::greasepencil::Layer &layer, const VArray< bool > &boundary_layers, const Span< DrawingInfo > src_drawings, bool invert, std::optional< float > opacity_threshold, bool internal_gaps, float gap_factor, const GroupedSpan< float2 > &fill_points)
Definition fill.cc:1627
bool apply_mask_as_selection(bke::CurvesGeometry &curves, const IndexMask &selection_mask, const bke::AttrDomain selection_domain, const StringRef attribute_name, const eSelectOp sel_op)
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)
void get_lineart_modifier_limits(const Object &ob, ed::greasepencil::LineartLimitInfo &info)
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)
IndexMask retrieve_visible_bezier_handle_strokes(Object &object, const bke::greasepencil::Drawing &drawing, const eHandleDisplay handle_display, IndexMaskMemory &memory)
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)
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)
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)
IndexMask retrieve_visible_bezier_strokes(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
Vector< MutableDrawingInfo > retrieve_editable_drawings_from_layer(const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer)
bool editable_grease_pencil_with_region_view3d_poll(bContext *C)
Vector< MutableDrawingInfo > retrieve_editable_drawings_from_layer_with_falloff(const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer)
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)
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)
Vector< DrawingInfo > retrieve_visible_drawings(const Scene &scene, const GreasePencil &grease_pencil, const bool do_onion_skinning)
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)
bool check_brush_needs_new_material(Object *ob, const Brush *brush)
void create_keyframe_edit_data_selected_frames_list(KeyframeEditData *ked, const bke::greasepencil::Layer &layer)
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)
IndexMask retrieve_visible_bezier_points(Object &object, const bke::greasepencil::Drawing &drawing, 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)
IndexMask retrieve_editable_and_all_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const eHandleDisplay handle_display, IndexMaskMemory &memory)
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 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 eSelectOp sel_op)
bool grease_pencil_sculpting_poll(bContext *C)
void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature)
IndexMask retrieve_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const eHandleDisplay handle_display, IndexMaskMemory &memory)
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)
IndexMask retrieve_visible_fills(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
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)
bool grease_pencil_weight_painting_poll(bContext *C)
Vector< MutableDrawingInfo > retrieve_editable_drawings_with_falloff(const Scene &scene, GreasePencil &grease_pencil)
eHandleDisplay view3d_handle_type_or_default(const View3D *v3d)
bool grease_pencil_layer_parent_set(bke::greasepencil::Layer &layer, Object *parent, StringRefNull bone, const bool keep_transform)
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)
void add_single_curve(bke::greasepencil::Drawing &drawing, const bool at_end)
Array< Vector< MutableDrawingInfo > > retrieve_editable_drawings_grouped_per_frame(const Scene &scene, GreasePencil &grease_pencil)
void select_layer_channel(GreasePencil &grease_pencil, bke::greasepencil::Layer *layer)
bool grease_pencil_edit_poll(bContext *C)
IndexMask retrieve_visible_bezier_handle_elements(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const bke::AttrDomain selection_domain, const eHandleDisplay handle_display, IndexMaskMemory &memory)
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)
float radius_from_input_sample(const RegionView3D *rv3d, const ARegion *region, const Paint &paint, const Brush *brush, const float pressure, const float3 &location, const float4x4 &to_world, const BrushGpencilSettings *settings)
void apply_eval_grease_pencil_data(const GreasePencil &eval_grease_pencil, const int eval_frame, const IndexMask &orig_layers, GreasePencil &orig_grease_pencil)
void set_lineart_modifier_limits(GreasePencilLineartModifierData &lmd, const ed::greasepencil::LineartLimitInfo &info, const bool cache_is_ready)
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)
BMesh Iterators.
__int64 int64_t
Definition BKE_text.h:90
void ED_undosys_type_grease_pencil(UndoType *ut)
void ED_operatormacros_grease_pencil()
void GREASE_PENCIL_OT_stroke_carver(wmOperatorType *ot)
void ED_keymap_grease_pencil(wmKeyConfig *keyconf)
bool ED_grease_pencil_vertex_segment_selection_enabled(const ToolSettings *tool_settings)
bool ED_grease_pencil_segment_selection_enabled(const ToolSettings *tool_settings, const Object *object)
void ED_grease_pencil_pentool_modal_keymap(wmKeyConfig *keyconf)
void GREASE_PENCIL_OT_stroke_trim(wmOperatorType *ot)
void ED_operatortypes_grease_pencil_bake_animation()
void ED_operatortypes_grease_pencil_select()
void ED_operatortypes_grease_pencil_frames()
void ED_operatortypes_grease_pencil_edit()
MatBase< float, 4, 4 > float4x4
void ED_operatortypes_grease_pencil_interpolate()
void ED_interpolatetool_modal_keymap(wmKeyConfig *keyconf)
void ED_operatortypes_grease_pencil_draw()
Definition draw_ops.cc:2432
bke::AttrDomain ED_grease_pencil_sculpt_selection_domain_get(const ToolSettings *tool_settings)
void ED_primitivetool_modal_keymap(wmKeyConfig *keyconf)
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
wmOperatorStatus ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op)
BMesh const char void * data
MatBase< float, 4, 2 > float4x2
void ED_operatortypes_grease_pencil_layers()
bke::AttrDomain ED_grease_pencil_edit_selection_domain_get(const ToolSettings *tool_settings)
unsigned char uint8_t
Definition BKE_text.h:79
void ED_operatortypes_grease_pencil_weight_paint()
void ED_operatortypes_grease_pencil_modes()
bool ED_grease_pencil_any_vertex_mask_selection(const ToolSettings *tool_settings)
void ED_operatortypes_grease_pencil_pen()
void ED_operatortypes_grease_pencil()
bke::AttrDomain ED_grease_pencil_selection_domain_get(const ToolSettings *tool_settings, const Object *object)
bool ED_grease_pencil_edit_segment_selection_enabled(const ToolSettings *tool_settings)
void ED_operatortypes_grease_pencil_join()
bool ED_grease_pencil_sculpt_segment_selection_enabled(const ToolSettings *tool_settings)
void ED_operatortypes_grease_pencil_material()
void ED_operatortypes_grease_pencil_lineart()
void ED_operatortypes_grease_pencil_vertex_paint()
void ED_operatortypes_grease_pencil_primitives()
bke::AttrDomain ED_grease_pencil_vertex_selection_domain_get(const ToolSettings *tool_settings)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
void ED_filltool_modal_keymap(wmKeyConfig *keyconf)
Definition draw_ops.cc:2444
signed char int8_t
Definition BKE_text.h:76
void ED_operatortypes_grease_pencil_trace()
Definition trace.cc:551
signed short int16_t
Definition BKE_text.h:77
@ Union
Definition types.hh:109
#define min(a, b)
Definition sort.cc:38
const bke::greasepencil::Drawing & drawing
struct blender::ed::greasepencil::ExtensionData::@147343236172247015273153246111172323157377245354 lines
struct blender::ed::greasepencil::ExtensionData::@265020321004141327021164373252125002104130321223 circles
Map< std::string, LayerBufferItem > copy_buffer