Blender V5.0
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
89
91
93
98 const ToolSettings *tool_settings);
100 const ToolSettings *tool_settings);
102 const ToolSettings *tool_settings);
104 const Object *object);
109
117 const Object *object);
118
120
122
123enum class ReprojectMode : int8_t { Front, Side, Top, View, Cursor, Surface, Keep };
124
126
127enum class DrawingPlacementPlane : int8_t { View, Front, Side, Top, Cursor };
128
130 const ARegion *region_;
131 const View3D *view3d_;
132
135 ViewDepths *depth_cache_ = nullptr;
136 bool use_project_only_selected_ = false;
137 float surface_offset_;
138
139 float3 placement_loc_;
140 float3 placement_normal_;
141 /* Optional explicit placement plane. */
142 std::optional<float4> placement_plane_;
143
144 float4x4 layer_space_to_world_space_;
145 float4x4 world_space_to_layer_space_;
146
147 public:
148 DrawingPlacement() = default;
149 DrawingPlacement(const Scene &scene,
150 const ARegion &region,
151 const View3D &view3d,
152 const Object &eval_object,
153 const bke::greasepencil::Layer *layer);
154
158 DrawingPlacement(const Scene &scene,
159 const ARegion &region,
160 const View3D &view3d,
161 const Object &eval_object,
162 const bke::greasepencil::Layer *layer,
163 ReprojectMode reproject_mode,
164 float surface_offset = 0.0f,
165 ViewDepths *view_depths = nullptr);
171
172 bool use_project_to_surface() const;
173 bool use_project_to_stroke() const;
174
175 void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d);
176
181 std::optional<float3> project_depth(float2 co) const;
182
186 float3 project(float2 co, bool &clipped) const;
187 float3 project(float2 co) const;
188 void project(Span<float2> src, MutableSpan<float3> dst) const;
193
197 float3 place(float2 co, float depth) const;
198
202 float3 reproject(float3 pos) const;
203 void reproject(Span<float3> src, MutableSpan<float3> dst) const;
204
205 float4x4 to_world_space() const;
206
208 std::optional<float> get_depth(float2 co) const;
209
210 private:
212 float3 try_project_depth(float2 co) const;
213};
214
216 const eBezTriple_KeyframeType key_type);
217
218bool snap_selected_frames(GreasePencil &grease_pencil,
220 Scene &scene,
221 const eEditKeyframes_Snap mode);
222
223bool mirror_selected_frames(GreasePencil &grease_pencil,
225 Scene &scene,
226 const eEditKeyframes_Mirror mode);
227
234
236
238
240 /* Datatype for use in copy/paste buffer. */
247
253
255 int first_frame{std::numeric_limits<int>::max()};
256 int last_frame{std::numeric_limits<int>::min()};
257 int cfra{0};
258
259 void clear()
260 {
261 copy_buffer.clear();
262 first_frame = std::numeric_limits<int>::max();
263 last_frame = std::numeric_limits<int>::min();
264 cfra = 0;
265 }
266};
267
269 Object *parent,
270 StringRefNull bone,
271 bool keep_transform);
272
273void grease_pencil_layer_parent_clear(bke::greasepencil::Layer &layer, bool keep_transform);
274
275bool grease_pencil_copy_keyframes(bAnimContext *ac, KeyframeClipboard &clipboard);
276
278 const eKeyPasteOffset offset_mode,
279 const eKeyMergeMode merge_mode,
280 const KeyframeClipboard &clipboard);
281
287 const int frame_number,
288 const short select_mode);
289
291 const int frame_number,
292 const short select_mode);
293
294void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode);
295
298 const short tool,
299 const short select_mode);
300
302 const float min,
303 const float max,
304 const short select_mode);
305
310
316bool ensure_active_keyframe(const Scene &scene,
317 GreasePencil &grease_pencil,
319 bool duplicate_previous_key,
320 bool &r_inserted_keyframe);
321
323 const bke::greasepencil::Layer &layer);
324
339
340float opacity_from_input_sample(const float pressure,
341 const Brush *brush,
342 const BrushGpencilSettings *settings);
343float radius_from_input_sample(const RegionView3D *rv3d,
344 const ARegion *region,
345 const Brush *brush,
346 float pressure,
347 const float3 &location,
348 const float4x4 &to_world,
349 const BrushGpencilSettings *settings);
351 wmOperator *op,
352 bool use_duplicate_previous_key);
354 const ARegion *region,
355 const float2 &mouse,
356 const DrawingPlacement &placement);
357
360 const int layer_index;
361 const int frame_number;
362 /* This is used by the onion skinning system. A value of 0 means the drawing is on the current
363 * frame. Negative values are before the current frame, positive values are drawings after the
364 * current frame. The magnitude of the value indicates how far the drawing is from the current
365 * frame (either in absolute frames, or in number of keyframes). */
366 const int onion_id;
367};
375 GreasePencil &grease_pencil);
377 GreasePencil &grease_pencil);
379 const Scene &scene, GreasePencil &grease_pencil);
381 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
383 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
385 const GreasePencil &grease_pencil,
386 bool do_onion_skinning);
387
388IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
389 const bke::greasepencil::Drawing &drawing,
390 int layer_index,
391 IndexMaskMemory &memory);
393 const bke::greasepencil::Drawing &drawing,
394 int layer_index,
395 IndexMaskMemory &memory);
397 const bke::greasepencil::Drawing &drawing,
398 const int mat_i,
399 IndexMaskMemory &memory);
401 const bke::greasepencil::Drawing &drawing,
402 int layer_index,
403 IndexMaskMemory &memory);
405 const MutableDrawingInfo &info,
406 bke::AttrDomain selection_domain,
407 IndexMaskMemory &memory);
408
409IndexMask retrieve_visible_strokes(Object &grease_pencil_object,
410 const bke::greasepencil::Drawing &drawing,
411 IndexMaskMemory &memory);
413 const bke::greasepencil::Drawing &drawing,
414 IndexMaskMemory &memory);
415
417 const bke::greasepencil::Drawing &drawing,
418 IndexMaskMemory &memory);
420 const bke::greasepencil::Drawing &drawing,
421 IndexMaskMemory &memory);
422
424 const bke::greasepencil::Drawing &drawing,
425 int handle_display,
426 IndexMaskMemory &memory);
428 const bke::greasepencil::Drawing &drawing,
429 int layer_index,
430 int handle_display,
431 IndexMaskMemory &memory);
433 const bke::greasepencil::Drawing &drawing,
434 int layer_index,
435 bke::AttrDomain selection_domain,
436 int handle_display,
437 IndexMaskMemory &memory);
438
440 const bke::greasepencil::Drawing &drawing,
441 int layer_index,
442 IndexMaskMemory &memory);
444 const bke::greasepencil::Drawing &drawing,
445 int layer_index,
446 IndexMaskMemory &memory);
448 const bke::greasepencil::Drawing &drawing,
449 int layer_index,
450 IndexMaskMemory &memory);
452 const bke::greasepencil::Drawing &drawing,
453 int layer_index,
454 bke::AttrDomain selection_domain,
455 IndexMaskMemory &memory);
457 const bke::greasepencil::Drawing &drawing,
458 int layer_index,
459 int handle_display,
460 IndexMaskMemory &memory);
461bool has_editable_layer(const GreasePencil &grease_pencil);
462
463void create_blank(Main &bmain, Object &object, int frame_number);
464void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
465void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
466
479 float epsilon,
480 FunctionRef<float(int64_t, int64_t, int64_t)> dist_function,
481 MutableSpan<bool> points_to_delete);
482
484 float error_threshold,
485 const IndexMask &corner_mask);
486
488 float radius_min,
489 float radius_max,
490 int samples_max,
491 float angle_threshold,
492 IndexMaskMemory &memory);
493
499 const float merge_distance,
500 const IndexMask &selection,
501 const bke::AttributeFilter &attribute_filter);
502
506int curve_merge_by_distance(const IndexRange points,
507 const Span<float> distances,
508 const IndexMask &selection,
509 const float merge_distance,
510 MutableSpan<int> r_merge_indices);
511
516 const ARegion &region,
517 const bke::CurvesGeometry &src_curves,
518 const float4x4 &layer_to_world,
519 const float merge_distance,
520 const IndexMask &selection,
521 const bke::AttributeFilter &attribute_filter);
522
535 float factor;
537 bool is_cut;
538 /* Additional attributes changes that can be stored to be used after a call to
539 * compute_topology_change.
540 * Note that they won't be automatically updated in the destination's attributes.
541 */
542 float opacity;
543
547 bool is_src_end_point() const
548 {
549 /* The src_next_point index increments for all points except the last, where it is set to the
550 * first point index. This can be used to detect the curve end from the source index alone.
551 */
553 }
554};
555
570 const bke::CurvesGeometry &src,
572 const Span<Vector<PointTransferData>> src_to_dst_points,
573 const bool keep_caps);
574
577
581 int active_vertex_group,
582 Span<bool> vertex_group_is_locked,
583 Span<bool> vertex_group_is_bone_deformed);
584
586bool add_armature_vertex_groups(Object &object, const Object &armature);
589void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature);
592void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature);
593
594void clipboard_free();
599 Object &object,
600 const float4x4 &object_to_paste_layer,
601 bool keep_world_transform,
602 bool paste_back,
604
609 /* Use the current view projection unchanged. */
611 /* Fit all strokes into the view (may change pixel size). */
613};
614
625
644 const Brush &brush,
645 const Scene &scene,
646 const bke::greasepencil::Layer &layer,
647 const VArray<bool> &boundary_layers,
648 Span<DrawingInfo> src_drawings,
649 bool invert,
650 const std::optional<float> alpha_threshold,
651 const float2 &fill_point,
652 const ExtensionData &extensions,
653 FillToolFitMethod fit_method,
654 int stroke_material_index,
655 bool keep_images);
656
657namespace image_render {
658
665
669RegionViewData region_init(ARegion &region, const int2 &win_size);
673void region_reset(ARegion &region, const RegionViewData &data);
674
678GPUOffScreen *image_render_begin(const int2 &win_size);
682Image *image_render_end(Main &bmain, GPUOffScreen *buffer);
683
691void compute_view_matrices(const ViewContext &view_context,
692 const Scene &scene,
693 const int2 &win_size,
694 const float2 &zoom,
695 const float2 &offset);
696
697void set_view_matrix(const RegionView3D &rv3d);
698void clear_view_matrix();
699void set_projection_matrix(const RegionView3D &rv3d);
701
705void draw_dot(const float4x4 &transform,
706 const float3 &position,
707 float point_size,
708 const ColorGeometry4f &color);
709
715 Span<float3> positions,
716 const VArray<ColorGeometry4f> &colors,
717 bool cyclic,
718 float line_width);
719
724 const IndexRange indices,
725 Span<float3> centers,
726 const VArray<float> &radii,
727 const VArray<ColorGeometry4f> &colors,
728 const float2 &viewport_size,
729 const float line_width,
730 const bool fill);
731
735void draw_lines(const float4x4 &transform,
737 Span<float3> start_positions,
738 Span<float3> end_positions,
739 const VArray<ColorGeometry4f> &colors,
740 float line_width);
741
747 const int2 &win_size,
748 const Object &object,
749 const bke::greasepencil::Drawing &drawing,
750 const float4x4 &transform,
751 const IndexMask &strokes_mask,
752 const VArray<ColorGeometry4f> &colors,
753 bool use_xray,
754 float radius_scale = 1.0f);
755
756} // namespace image_render
757
758enum class InterpolateFlipMode : int8_t {
759 /* No flip. */
760 None = 0,
761 /* Flip always. */
763 /* Flip if needed. */
765};
766
767enum class InterpolateLayerMode : int8_t {
768 /* Only interpolate on the active layer. */
770 /* Interpolate strokes on every layer. */
772};
773
785 const IndexMask &strokes,
786 const float4x4 &transform,
787 int corner_subdivisions,
788 float outline_radius,
789 float outline_offset,
790 int material_index);
791
792/* Function that generates an update mask for a selection operation. */
794 const IndexMask &universe,
795 StringRef attribute_name,
796 IndexMaskMemory &memory)>;
797
798bool selection_update(const ViewContext *vc,
799 const eSelectOp sel_op,
800 SelectionUpdateFunc select_operation);
801
802/* BVHTree and associated data for 2D curve projection. */
804 BVHTree *tree = nullptr;
805 /* Projected coordinates for each tree element. */
808 /* BVH element index range for each drawing. */
810};
811
816 const Object &object,
817 const GreasePencil &grease_pencil,
819 int frame_number);
821
838 const IndexMask &curve_mask,
839 const Span<float2> screen_space_positions,
840 const Curves2DBVHTree &tree_data,
841 IndexRange tree_data_range,
842 MutableSpan<bool> r_hits,
843 std::optional<MutableSpan<float>> r_first_intersect_factors,
844 std::optional<MutableSpan<float>> r_last_intersect_factors);
845
866 /* Segment start index for each curve, can be used as \a OffsetIndices. */
868 /* Point indices where new segments start. */
870 /* Fraction of the start point on the line segment to the next point. */
872};
873
894 const IndexMask &curve_mask,
895 const Span<float2> screen_space_positions,
896 const Curves2DBVHTree &tree_data,
897 IndexRange tree_data_range);
898
900 const IndexMask &selection,
901 bke::AttrDomain selection_domain,
902 StringRef attribute_name,
903 GrainSize grain_size,
904 eSelectOp sel_op);
905
907 const IndexMask &point_selection,
908 StringRef attribute_name,
909 const Curves2DBVHTree &tree_data,
910 IndexRange tree_data_range,
911 GrainSize grain_size,
912 eSelectOp sel_op);
913
914namespace trim {
916 Span<float2> screen_space_positions,
917 Span<rcti> screen_space_curve_bounds,
918 const IndexMask &curve_selection,
919 const Vector<Vector<int>> &selected_points_in_curves,
920 bool keep_caps);
921}; // namespace trim
922
923void merge_layers(const GreasePencil &src_grease_pencil,
924 const Span<Vector<int>> src_layer_indices_by_dst_layer,
925 GreasePencil &dst_grease_pencil);
926
927/* Lineart */
928
929/* Stores the maximum calculation range in the whole modifier stack for line art so the cache can
930 * cover everything that will be visible. */
938
941 const LineartLimitInfo &info,
942 const bool cache_is_ready);
943
945
947
948/* Make sure selection domain is updated to match the current selection mode. */
950
956
961void resize_single_curve(bke::CurvesGeometry &curves, bool at_end, int new_points_num);
962
970float randomize_radius(const BrushGpencilSettings &settings,
971 float stroke_factor,
972 float distance,
973 float radius,
974 float pressure);
982float randomize_opacity(const BrushGpencilSettings &settings,
983 float stroke_factor,
984 float distance,
985 float opacity,
986 float pressure);
993float randomize_rotation(const BrushGpencilSettings &settings,
994 float stroke_factor,
995 float distance,
996 float pressure);
1003float randomize_rotation(const BrushGpencilSettings &settings,
1005 float stroke_factor,
1006 float pressure);
1017 const std::optional<BrushColorJitterSettings> &jitter,
1018 float stroke_hue_factor,
1019 float stroke_saturation_factor,
1020 float stroke_value_factor,
1021 float distance,
1023 float pressure);
1024
1034void apply_eval_grease_pencil_data(const GreasePencil &eval_grease_pencil,
1035 int eval_frame,
1036 const IndexMask &orig_layers,
1037 GreasePencil &orig_grease_pencil);
1038
1043
1044} // 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_pen()
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_grease_pencil_pentool_modal_keymap(wmKeyConfig *keyconf)
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)
bool ED_grease_pencil_any_vertex_mask_selection(const ToolSettings *tool_settings)
void ED_operatortypes_grease_pencil_draw()
@ LAYER_REORDER_BELOW
@ LAYER_REORDER_ABOVE
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_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const int handle_display, IndexMaskMemory &memory)
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)
FunctionRef< IndexMask(const ed::greasepencil::MutableDrawingInfo &info, const IndexMask &universe, StringRef attribute_name, IndexMaskMemory &memory)> SelectionUpdateFunc
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)
IndexMask retrieve_visible_bezier_handle_strokes(Object &object, const bke::greasepencil::Drawing &drawing, const int handle_display, IndexMaskMemory &memory)
bool grease_pencil_paste_keyframes(bAnimContext *ac, const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode, const KeyframeClipboard &clipboard)
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)
IndexMask retrieve_editable_and_all_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, int 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)
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)
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)
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)
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)
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_visible_bezier_handle_elements(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const bke::AttrDomain selection_domain, const int 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 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)
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)
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)
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
VecBase< float, 3 > float3
#define min(a, b)
Definition sort.cc:36
const bke::greasepencil::Drawing & drawing
struct blender::ed::greasepencil::ExtensionData::@020012301277233322117257155067364007210377153176 lines
struct blender::ed::greasepencil::ExtensionData::@137034222204205036366070174242001167366362372317 circles
Map< std::string, LayerBufferItem > copy_buffer
max
Definition text_draw.cc:251
wmOperatorType * ot
Definition wm_files.cc:4237