Blender V4.3
ED_gpencil_legacy.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11struct ID;
12struct ListBase;
13struct PointerRNA;
14
15struct Brush;
17struct bGPDframe;
18struct bGPDlayer;
19struct bGPDspoint;
20struct bGPDstroke;
21struct bGPdata;
22struct tGPspoint;
23
24struct ARegion;
25struct Depsgraph;
26struct Main;
27struct RegionView3D;
28struct ReportList;
29struct Scene;
30struct ScrArea;
32struct ToolSettings;
33struct View3D;
34struct bContext;
35
36struct Material;
37struct Object;
38
39struct KeyframeEditData;
40struct bAnimContext;
41
42struct wmKeyConfig;
43struct wmOperator;
44
45/* ------------- Grease-Pencil Runtime Data ---------------- */
46
52struct tGPspoint {
54 float m_xy[2];
56 float pressure;
58 float strength;
60 float time;
62 float uv_fac;
64 float uv_rot;
66 float rnd[3];
70 float vert_color[4];
71};
72
73/* ----------- Grease Pencil Tools/Context ------------- */
74
75/* Context-dependent */
76
82
87
96
114 ScrArea *area,
115 Scene *scene,
116 PointerRNA *r_ptr);
121
127
132bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps);
134bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps);
136bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps);
137
138/* ----------- Grease Pencil Operators ----------------- */
139
141
143
144/* ------------- Copy-Paste Buffers -------------------- */
145
150
151/* ------------ Grease-Pencil Drawing API ------------------ */
152/* `drawgpencil.cc` */
153
165void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d);
172 Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d);
174 Scene *scene, bGPdata *gpd, int winx, int winy, int cfra, char spacetype);
175
176/* ----------- Grease-Pencil AnimEdit API ------------------ */
181 Scene *scene,
182 bool (*gpf_cb)(bGPDframe *, Scene *));
186void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel);
187
195void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode);
199void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, short select_mode);
204 bGPDlayer *gpl,
205 short tool,
206 short select_mode);
210void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode);
214void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode);
215
220
229
239void ED_gpencil_layer_snap_frames(bGPDlayer *gpl, Scene *scene, short mode);
240
245void ED_gpencil_layer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode);
246
261bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, short offset_mode);
262
263/* ------------ Grease-Pencil Undo System ------------------ */
268int ED_undo_gpencil_step(bContext *C, int step); /* eUndoStepDir. */
269
270/* ----------- Add Primitive Utilities -------------- */
271
277 const Object *ob,
278 char align_flag,
279 float r_vec[3]);
280
281/* texture coordinate utilities */
282
287 float origin[3],
288 const tGPspoint *tpt,
289 bGPDspoint *pt);
290
296 int *buffer_size,
297 int *buffer_used,
298 bool clear);
bGPdata ** ED_gpencil_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
bool ED_gpencil_stroke_material_editable(Object *ob, const bGPDlayer *gpl, const bGPDstroke *gps)
void ED_gpencil_strokes_copybuf_free()
bool ED_gpencil_stroke_can_use_direct(const ScrArea *area, const bGPDstroke *gps)
void ED_gpencil_layer_frame_select_set(bGPDlayer *gpl, short mode)
void ED_gpencil_layer_frames_keytype_set(bGPDlayer *gpl, short type)
void ED_gpencil_layer_frames_duplicate(bGPDlayer *gpl)
bGPdata * ED_annotation_data_get_active(const bContext *C)
void ED_gpencil_set_active_channel(bGPdata *gpd, bGPDlayer *gpl)
bGPdata * ED_gpencil_data_get_active(const bContext *C)
bool ED_gpencil_layer_frames_delete(bGPDlayer *gpl)
void ED_gpencil_select_frames(bGPDlayer *gpl, short select_mode)
bool ED_gpencil_layer_frame_select_check(const bGPDlayer *gpl)
void ED_gpencil_layer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode)
void ED_annotation_draw_2dimage(const bContext *C)
void ED_gpencil_select_frame(bGPDlayer *gpl, int selx, short select_mode)
bGPdata * ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scene *scene)
bGPdata ** ED_annotation_data_get_pointers_direct(ID *screen_id, ScrArea *area, Scene *scene, PointerRNA *r_ptr)
void ED_annotation_draw_view3d(Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
bool ED_gpencil_layer_frames_looper(bGPDlayer *gpl, Scene *scene, bool(*gpf_cb)(bGPDframe *, Scene *))
void ED_gpencil_layer_frames_select_region(KeyframeEditData *ked, bGPDlayer *gpl, short tool, short select_mode)
void ED_gpencil_tpoint_to_point(ARegion *region, float origin[3], const tGPspoint *tpt, bGPDspoint *pt)
void ED_keymap_gpencil_legacy(wmKeyConfig *keyconf)
bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, short offset_mode)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
void ED_gpencil_layer_frames_select_box(bGPDlayer *gpl, float min, float max, short select_mode)
int ED_gpencil_session_active()
void ED_operatortypes_gpencil_legacy()
bool ED_gpencil_stroke_can_use(const bContext *C, const bGPDstroke *gps)
void ED_gpencil_drawing_reference_get(const Scene *scene, const Object *ob, char align_flag, float r_vec[3])
bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr)
void ED_gpencil_layer_make_cfra_list(bGPDlayer *gpl, ListBase *elems, bool onlysel)
tGPspoint * ED_gpencil_sbuffer_ensure(tGPspoint *buffer_array, int *buffer_size, int *buffer_used, bool clear)
void ED_gpencil_layer_snap_frames(bGPDlayer *gpl, Scene *scene, short mode)
void ED_gpencil_anim_copybuf_free()
void ED_annotation_draw_ex(Scene *scene, bGPdata *gpd, int winx, int winy, int cfra, char spacetype)
bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac)
bGPdata ** ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, PointerRNA *r_ptr)
int ED_undo_gpencil_step(bContext *C, int step)
bGPdata ** ED_annotation_data_get_pointers(const bContext *C, PointerRNA *r_ptr)
const Depsgraph * depsgraph
static void clear(Message &msg)
Definition msgfmt.cc:218
#define min(a, b)
Definition sort.c:32
Definition DNA_ID.h:413
float vert_color[4]