Blender V5.3
BKE_annotations.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
10
11#include "DNA_listBase.h"
12
13namespace blender {
14
15struct BlendDataReader;
16struct Brush;
17struct CurveMapping;
18struct Depsgraph;
19struct MDeformVert;
20struct Main;
21struct Material;
22struct Object;
23struct Scene;
24struct SpaceImage;
25struct ToolSettings;
26struct ViewLayer;
27struct bDeformGroup;
28struct bGPDcurve;
29struct bGPDframe;
30struct bGPDlayer;
31struct bGPDlayer_Mask;
32struct bGPDstroke;
33struct bGPdata;
34struct bGPDpalette;
35
36/* ------------ Annotation API ------------------ */
37
38/* clean vertex groups weights */
49void BKE_annotations_free_layers(ListBaseT<bGPDlayer> *list);
51void BKE_annotations_free_legacy_palette_data(ListBaseT<bGPDpalette> *list);
53void BKE_annotations_free_data(struct bGPdata *gpd, bool free_all);
60void BKE_annotations_tag(struct bGPdata *gpd);
61
68struct bGPDframe *BKE_annotations_frame_addnew(struct bGPDlayer *gpl, int cframe);
75struct bGPDframe *BKE_annotations_frame_addcopy(struct bGPDlayer *gpl, int cframe);
85 const char *name,
86 bool setactive,
87 bool add_to_header);
94struct bGPdata *BKE_annotations_data_addnew(struct Main *bmain, const char name[]);
95
102 bool dup_strokes);
109 bool dup_frames,
110 bool dup_strokes);
111
120 bool dup_points,
121 bool dup_curve);
122
129 const struct bGPdata *gpd,
130 bool internal_copy);
131
132#define GPENCIL_STRENGTH_MIN 0.003f
133
140
141/* How annotations_layer_getframe() should behave when there
142 * is no existing GP-Frame on the frame requested.
143 */
145 /* Use the preceding gp-frame (i.e. don't add anything) */
147
148 /* Add a new empty/blank frame */
150 /* Make a copy of the active frame */
152};
153
164struct bGPDframe *BKE_annotations_layer_frame_get(struct bGPDlayer *gpl,
165 int cframe,
166 eGP_GetFrame_Mode addnew);
173struct bGPDframe *BKE_annotations_layer_frame_find(struct bGPDlayer *gpl, int cframe);
180bool BKE_annotations_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf);
181
188struct bGPDlayer *BKE_annotations_layer_named_get(struct bGPdata *gpd, const char *name);
194struct bGPDlayer *BKE_annotations_layer_active_get(struct bGPdata *gpd);
200void BKE_annotations_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active);
206void BKE_annotations_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl);
212void BKE_annotations_layer_frames_sort(struct bGPDlayer *gpl, bool *r_has_duplicate_frames);
213
214/* vertex groups */
220void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst);
221
222void BKE_annotations_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd);
223
224} // namespace blender
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
struct bGPDframe * BKE_annotations_frame_addnew(struct bGPDlayer *gpl, int cframe)
void BKE_annotations_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
struct bGPDframe * BKE_annotations_frame_addcopy(struct bGPDlayer *gpl, int cframe)
struct bGPDframe * BKE_annotations_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
struct bGPdata * BKE_annotations_data_duplicate(struct Main *bmain, const struct bGPdata *gpd, bool internal_copy)
void BKE_annotations_free_stroke_weights(struct bGPDstroke *gps)
struct bGPDlayer * BKE_annotations_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
void BKE_annotations_free_frames(struct bGPDlayer *gpl)
void BKE_annotations_free_stroke(struct bGPDstroke *gps)
struct bGPdata * BKE_annotations_data_addnew(struct Main *bmain, const char name[])
struct bGPDframe * BKE_annotations_layer_frame_find(struct bGPDlayer *gpl, int cframe)
void BKE_annotations_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst)
void BKE_annotations_free_layers(ListBaseT< bGPDlayer > *list)
struct bGPDlayer * BKE_annotations_layer_named_get(struct bGPdata *gpd, const char *name)
void BKE_annotations_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd)
void BKE_annotations_free_legacy_palette_data(ListBaseT< bGPDpalette > *list)
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, bool dup_points, bool dup_curve)
struct bGPDlayer * BKE_annotations_layer_active_get(struct bGPdata *gpd)
void BKE_annotations_tag(struct bGPdata *gpd)
void BKE_annotations_free_data(struct bGPdata *gpd, bool free_all)
bool BKE_annotations_layer_is_editable(const struct bGPDlayer *gpl)
void BKE_annotations_free_layer_masks(struct bGPDlayer *gpl)
bool BKE_annotations_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
void BKE_annotations_free_point_weights(struct MDeformVert *dvert)
void BKE_annotations_layer_frames_sort(struct bGPDlayer *gpl, bool *r_has_duplicate_frames)
bool BKE_annotations_free_strokes(struct bGPDframe *gpf)
void BKE_annotations_free_stroke_editcurve(struct bGPDstroke *gps)
struct bGPDlayer * BKE_annotations_layer_duplicate(const struct bGPDlayer *gpl_src, bool dup_frames, bool dup_strokes)
struct bGPDframe * BKE_annotations_frame_duplicate(const struct bGPDframe *gpf_src, bool dup_strokes)