Blender V4.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_generic_span.hh"
15#include "BLI_index_mask_fwd.hh"
17#include "BLI_set.hh"
18
19#include "ED_keyframes_edit.hh"
20#include "ED_select_utils.hh"
21
22#include "WM_api.hh"
23
24struct bContext;
25struct Main;
26struct Object;
27struct KeyframeEditData;
28struct wmKeyConfig;
29struct wmOperator;
30struct GPUOffScreen;
31struct ToolSettings;
32struct Scene;
33struct UndoType;
34struct ViewDepths;
35struct View3D;
36struct ViewContext;
37struct BVHTree;
39namespace blender {
40namespace bke {
41enum class AttrDomain : int8_t;
42class CurvesGeometry;
43namespace crazyspace {
44}
45} // namespace bke
46} // namespace blender
47
48enum {
51};
52
53/* -------------------------------------------------------------------- */
56
61
83
85
87
92 const ToolSettings *tool_settings);
94 const ToolSettings *tool_settings);
96 const ToolSettings *tool_settings);
98 const Object *object);
106 const Object *object);
107
109
111
113
115
117
119 const ARegion *region_;
120 const View3D *view3d_;
121
124 ViewDepths *depth_cache_ = nullptr;
125 bool use_project_only_selected_ = false;
126 float surface_offset_;
127
128 float3 placement_loc_;
129 float3 placement_normal_;
130 float4 placement_plane_;
131
132 float4x4 layer_space_to_world_space_;
133 float4x4 world_space_to_layer_space_;
134
135 public:
136 DrawingPlacement() = default;
137 DrawingPlacement(const Scene &scene,
138 const ARegion &region,
139 const View3D &view3d,
140 const Object &eval_object,
141 const bke::greasepencil::Layer *layer);
142
146 DrawingPlacement(const Scene &scene,
147 const ARegion &region,
148 const View3D &view3d,
149 const Object &eval_object,
150 const bke::greasepencil::Layer *layer,
151 ReprojectMode reproject_mode,
152 float surface_offset = 0.0f,
153 ViewDepths *view_depths = nullptr);
159
160 public:
161 bool use_project_to_surface() const;
163
164 void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d);
166
170 float3 project(float2 co) const;
171 void project(Span<float2> src, MutableSpan<float3> dst) const;
176
180 float3 reproject(float3 pos) const;
181 void reproject(Span<float3> src, MutableSpan<float3> dst) const;
182
183 float4x4 to_world_space() const;
184
185 private:
186 float3 project_depth(float2 co) const;
187};
188
190 const eBezTriple_KeyframeType key_type);
191
192bool snap_selected_frames(GreasePencil &grease_pencil,
194 Scene &scene,
195 const eEditKeyframes_Snap mode);
196
197bool mirror_selected_frames(GreasePencil &grease_pencil,
199 Scene &scene,
200 const eEditKeyframes_Mirror mode);
201
208
210
212
214 /* Datatype for use in copy/paste buffer. */
221
227
229 int first_frame{std::numeric_limits<int>::max()};
230 int last_frame{std::numeric_limits<int>::min()};
231 int cfra{0};
232
233 void clear()
234 {
235 copy_buffer.clear();
236 first_frame = std::numeric_limits<int>::max();
237 last_frame = std::numeric_limits<int>::min();
238 cfra = 0;
239 }
240};
241
243 Object *parent,
244 StringRefNull bone,
245 bool keep_transform);
246
247void grease_pencil_layer_parent_clear(bke::greasepencil::Layer &layer, bool keep_transform);
248
249bool grease_pencil_copy_keyframes(bAnimContext *ac, KeyframeClipboard &clipboard);
250
252 const eKeyPasteOffset offset_mode,
253 const eKeyMergeMode merge_mode,
254 const KeyframeClipboard &clipboard);
255
261 const int frame_number,
262 const short select_mode);
263
265 const int frame_number,
266 const short select_mode);
267
268void select_all_frames(bke::greasepencil::Layer &layer, const short select_mode);
269
272 const short tool,
273 const short select_mode);
274
276 const float min,
277 const float max,
278 const short select_mode);
279
284
290bool ensure_active_keyframe(const Scene &scene,
291 GreasePencil &grease_pencil,
293 bool duplicate_previous_key,
294 bool &r_inserted_keyframe);
295
297 const bke::greasepencil::Layer &layer);
298
311
312float opacity_from_input_sample(const float pressure,
313 const Brush *brush,
314 const BrushGpencilSettings *settings);
315float radius_from_input_sample(const RegionView3D *rv3d,
316 const ARegion *region,
317 const Brush *brush,
318 float pressure,
319 float3 location,
320 float4x4 to_world,
321 const BrushGpencilSettings *settings);
323 wmOperator *op,
324 bool use_duplicate_previous_key);
326 const ARegion *region,
327 const float2 &mouse,
328 const DrawingPlacement &placement);
329
332 const int layer_index;
333 const int frame_number;
334 /* This is used by the onion skinning system. A value of 0 means the drawing is on the current
335 * frame. Negative values are before the current frame, positive values are drawings after the
336 * current frame. The magnitude of the value indicates how far the drawing is from the current
337 * frame (either in absolute frames, or in number of keyframes). */
338 const int onion_id;
339};
347 GreasePencil &grease_pencil);
349 GreasePencil &grease_pencil);
351 const Scene &scene, GreasePencil &grease_pencil);
353 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
355 const Scene &scene, GreasePencil &grease_pencil, const bke::greasepencil::Layer &layer);
357 const GreasePencil &grease_pencil,
358 bool do_onion_skinning);
359
360IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
361 const bke::greasepencil::Drawing &drawing,
362 int layer_index,
363 IndexMaskMemory &memory);
365 const bke::greasepencil::Drawing &drawing,
366 int layer_index,
367 IndexMaskMemory &memory);
369 const bke::greasepencil::Drawing &drawing,
370 const int mat_i,
371 IndexMaskMemory &memory);
373 const bke::greasepencil::Drawing &drawing,
374 int layer_index,
375 IndexMaskMemory &memory);
377 const MutableDrawingInfo &info,
378 bke::AttrDomain selection_domain,
379 IndexMaskMemory &memory);
380
381IndexMask retrieve_visible_strokes(Object &grease_pencil_object,
382 const bke::greasepencil::Drawing &drawing,
383 IndexMaskMemory &memory);
385 const bke::greasepencil::Drawing &drawing,
386 IndexMaskMemory &memory);
387
389 const bke::greasepencil::Drawing &drawing,
390 int layer_index,
391 IndexMaskMemory &memory);
393 const bke::greasepencil::Drawing &drawing,
394 int layer_index,
395 bke::AttrDomain selection_domain,
396 IndexMaskMemory &memory);
397
399 const bke::greasepencil::Drawing &drawing,
400 int layer_index,
401 IndexMaskMemory &memory);
403 const bke::greasepencil::Drawing &drawing,
404 int layer_index,
405 IndexMaskMemory &memory);
407 const bke::greasepencil::Drawing &drawing,
408 int layer_index,
409 IndexMaskMemory &memory);
411 const bke::greasepencil::Drawing &drawing,
412 int layer_index,
413 bke::AttrDomain selection_domain,
414 IndexMaskMemory &memory);
415
416void create_blank(Main &bmain, Object &object, int frame_number);
417void create_stroke(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
418void create_suzanne(Main &bmain, Object &object, const float4x4 &matrix, int frame_number);
419
432 float epsilon,
433 FunctionRef<float(int64_t, int64_t, int64_t)> dist_function,
434 MutableSpan<bool> points_to_delete);
435
437 float error_threshold,
438 const IndexMask &corner_mask);
439
441 float radius_min,
442 float radius_max,
443 int samples_max,
444 float angle_threshold,
445 IndexMaskMemory &memory);
446
452 const float merge_distance,
453 const IndexMask &selection,
454 const bke::AttributeFilter &attribute_filter);
455
459int curve_merge_by_distance(const IndexRange points,
460 const Span<float> distances,
461 const IndexMask &selection,
462 const float merge_distance,
463 MutableSpan<int> r_merge_indices);
464
469 const ARegion &region,
470 const bke::CurvesGeometry &src_curves,
471 const float4x4 &layer_to_world,
472 const float merge_distance,
473 const IndexMask &selection,
474 const bke::AttributeFilter &attribute_filter);
475
488 float factor;
490 bool is_cut;
491 /* Additional attributes changes that can be stored to be used after a call to
492 * compute_topology_change.
493 * Note that they won't be automatically updated in the destination's attributes.
494 */
495 float opacity;
496
500 bool is_src_end_point() const
501 {
502 /* The src_next_point index increments for all points except the last, where it is set to the
503 * first point index. This can be used to detect the curve end from the source index alone.
504 */
506 }
507};
508
523 const bke::CurvesGeometry &src,
525 const Span<Vector<PointTransferData>> src_to_dst_points,
526 const bool keep_caps);
527
530
534 int active_vertex_group,
535 Span<bool> vertex_group_is_locked,
536 Span<bool> vertex_group_is_bone_deformed);
537
539bool add_armature_vertex_groups(Object &object, const Object &armature);
542void add_armature_envelope_weights(Scene &scene, Object &object, const Object &ob_armature);
545void add_armature_automatic_weights(Scene &scene, Object &object, const Object &ob_armature);
546
547void clipboard_free();
556 Object &object,
558 const float4x4 &transform,
559 bool keep_world_transform,
560 bool paste_back);
561
566 /* Use the current view projection unchanged. */
568 /* Fit all strokes into the view (may change pixel size). */
570};
571
582
601 const Brush &brush,
602 const Scene &scene,
603 const bke::greasepencil::Layer &layer,
604 const VArray<bool> &boundary_layers,
605 Span<DrawingInfo> src_drawings,
606 bool invert,
607 const std::optional<float> alpha_threshold,
608 const float2 &fill_point,
609 const ExtensionData &extensions,
610 FillToolFitMethod fit_method,
611 int stroke_material_index,
612 bool keep_images);
613
614namespace image_render {
615
621
625RegionViewData region_init(ARegion &region, const int2 &win_size);
629void region_reset(ARegion &region, const RegionViewData &data);
630
634GPUOffScreen *image_render_begin(const int2 &win_size);
638Image *image_render_end(Main &bmain, GPUOffScreen *buffer);
639
647void compute_view_matrices(const ViewContext &view_context,
648 const Scene &scene,
649 const int2 &win_size,
650 const float2 &zoom,
651 const float2 &offset);
652
653void set_view_matrix(const RegionView3D &rv3d);
654void clear_view_matrix();
655void set_projection_matrix(const RegionView3D &rv3d);
657
661void draw_dot(const float4x4 &transform,
662 const float3 &position,
663 float point_size,
664 const ColorGeometry4f &color);
665
671 Span<float3> positions,
672 const VArray<ColorGeometry4f> &colors,
673 bool cyclic,
674 float line_width);
675
680 const IndexRange indices,
681 Span<float3> centers,
682 const VArray<float> &radii,
683 const VArray<ColorGeometry4f> &colors,
684 const float2 &viewport_size,
685 const float line_width,
686 const bool fill);
687
691void draw_lines(const float4x4 &transform,
693 Span<float3> start_positions,
694 Span<float3> end_positions,
695 const VArray<ColorGeometry4f> &colors,
696 float line_width);
697
703 const int2 &win_size,
704 const Object &object,
705 const bke::greasepencil::Drawing &drawing,
706 const float4x4 &transform,
707 const IndexMask &strokes_mask,
708 const VArray<ColorGeometry4f> &colors,
709 bool use_xray,
710 float radius_scale = 1.0f);
711
712} // namespace image_render
713
715 /* No flip. */
716 None = 0,
717 /* Flip always. */
719 /* Flip if needed. */
721};
722
724 /* Only interpolate on the active layer. */
726 /* Interpolate strokes on every layer. */
728};
729
741 const IndexMask &strokes,
742 const float4x4 &transform,
743 int corner_subdivisions,
744 float outline_radius,
745 float outline_offset,
746 int material_index);
747
748/* Function that generates an update mask for a selection operation. */
750 const IndexMask &universe,
751 StringRef attribute_name,
752 IndexMaskMemory &memory)>;
753
754bool selection_update(const ViewContext *vc,
755 const eSelectOp sel_op,
756 SelectionUpdateFunc select_operation);
757
758/* BVHTree and associated data for 2D curve projection. */
760 BVHTree *tree = nullptr;
761 /* Projected coordinates for each tree element. */
764 /* BVH element index range for each drawing. */
766};
767
772 const Object &object,
773 const GreasePencil &grease_pencil,
775 int frame_number);
777
794 const IndexMask &curve_mask,
795 const Span<float2> screen_space_positions,
796 const Curves2DBVHTree &tree_data,
797 IndexRange tree_data_range,
798 MutableSpan<bool> r_hits,
799 std::optional<MutableSpan<float>> r_first_intersect_factors,
800 std::optional<MutableSpan<float>> r_last_intersect_factors);
801
822 /* Segment start index for each curve, can be used as \a OffsetIndices. */
824 /* Point indices where new segments start. */
826 /* Fraction of the start point on the line segment to the next point. */
828};
829
850 const IndexMask &curve_mask,
851 const Span<float2> screen_space_positions,
852 const Curves2DBVHTree &tree_data,
853 IndexRange tree_data_range);
854
856 const IndexMask &selection,
857 bke::AttrDomain selection_domain,
858 StringRef attribute_name,
859 GrainSize grain_size,
860 eSelectOp sel_op);
861
863 const IndexMask &point_selection,
864 StringRef attribute_name,
865 const Curves2DBVHTree &tree_data,
866 IndexRange tree_data_range,
867 GrainSize grain_size,
868 eSelectOp sel_op);
869
870namespace trim {
872 Span<float2> screen_space_positions,
873 Span<rcti> screen_space_curve_bounds,
874 const IndexMask &curve_selection,
875 const Vector<Vector<int>> &selected_points_in_curves,
876 bool keep_caps);
877}; // namespace trim
878
879void merge_layers(const GreasePencil &src_grease_pencil,
880 const Span<Vector<int>> src_layer_indices_by_dst_layer,
881 GreasePencil &dst_grease_pencil);
882
883/* Lineart */
884
885/* Stores the maximum calculation range in the whole modifier stack for line art so the cache can
886 * cover everything that will be visible. */
894
897 const LineartLimitInfo &info,
898 const bool cache_is_ready);
899
901
903} // 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 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)
int ED_grease_pencil_join_objects_exec(bContext *C, wmOperator *op)
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)
void ED_operatortypes_grease_pencil_draw()
void ED_keymap_grease_pencil(wmKeyConfig *keyconf)
void ED_operatortypes_grease_pencil_primitives()
void ED_operatortypes_grease_pencil_select()
@ LAYER_REORDER_BELOW
@ LAYER_REORDER_ABOVE
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_undosys_type_grease_pencil(UndoType *undo_type)
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
#define C
Definition RandGen.cpp:29
BPy_StructRNA * depsgraph
DrawingPlacement & operator=(const DrawingPlacement &other)
void cache_viewport_depths(Depsgraph *depsgraph, ARegion *region, View3D *view3d)
static ushort indices[]
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
Definition invert.h:9
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)
int grease_pencil_draw_operator_invoke(bContext *C, wmOperator *op, const bool use_duplicate_previous_key)
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)
IndexRange clipboard_paste_strokes(Main &bmain, Object &object, bke::greasepencil::Drawing &drawing, const float4x4 &transform, const bool keep_world_transform, const bool paste_back)
bool remove_all_selected_frames(GreasePencil &grease_pencil, bke::greasepencil::Layer &layer)
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)
const bke::CurvesGeometry & clipboard_curves()
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)
GreasePencil * from_context(bContext &C)
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)
void set_selected_frames_type(bke::greasepencil::Layer &layer, const eBezTriple_KeyframeType key_type)
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)
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)
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)
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)
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)
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)
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< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
MatBase< float, 4, 2 > float4x2
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
Definition BLI_color.hh:337
VecBase< float, 3 > float3
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
#define min(a, b)
Definition sort.c:32
signed short int16_t
Definition stdint.h:76
__int64 int64_t
Definition stdint.h:89
unsigned char uint8_t
Definition stdint.h:78
signed char int8_t
Definition stdint.h:75
const bke::greasepencil::Drawing & drawing
struct blender::ed::greasepencil::ExtensionData::@205371017122172163221357243254300330236141263101 lines
struct blender::ed::greasepencil::ExtensionData::@370226035113122023045100175347052120024364305045 circles
Map< std::string, LayerBufferItem > copy_buffer
float max
wmOperatorType * ot
Definition wm_files.cc:4125