Blender  V2.93
BKE_gpencil.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008, Blender Foundation
17  * This is a new part of Blender
18  */
19 
20 #pragma once
21 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct BlendDataReader;
31 struct Brush;
32 struct CurveMapping;
33 struct Depsgraph;
34 struct GHash;
35 struct ListBase;
36 struct MDeformVert;
37 struct Main;
38 struct Material;
39 struct Object;
40 struct Scene;
41 struct SpaceImage;
42 struct ToolSettings;
43 struct ViewLayer;
44 struct bDeformGroup;
45 struct bGPDcurve;
46 struct bGPDframe;
47 struct bGPDlayer;
48 struct bGPDlayer_Mask;
49 struct bGPDstroke;
50 struct bGPdata;
51 
52 #define GPENCIL_SIMPLIFY(scene) ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ENABLE))
53 #define GPENCIL_SIMPLIFY_ONPLAY(playing) \
54  (((playing == true) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY)) || \
55  ((scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_ON_PLAY) == 0))
56 #define GPENCIL_SIMPLIFY_FILL(scene, playing) \
57  ((GPENCIL_SIMPLIFY_ONPLAY(playing) && (GPENCIL_SIMPLIFY(scene)) && \
58  (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FILL)))
59 #define GPENCIL_SIMPLIFY_MODIF(scene) \
60  ((GPENCIL_SIMPLIFY(scene) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_MODIFIER)))
61 #define GPENCIL_SIMPLIFY_FX(scene, playing) \
62  ((GPENCIL_SIMPLIFY_ONPLAY(playing) && (GPENCIL_SIMPLIFY(scene)) && \
63  (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_FX)))
64 #define GPENCIL_SIMPLIFY_TINT(scene) \
65  ((GPENCIL_SIMPLIFY(scene)) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_TINT))
66 #define GPENCIL_SIMPLIFY_AA(scene) \
67  ((GPENCIL_SIMPLIFY(scene)) && (scene->r.simplify_gpencil & SIMPLIFY_GPENCIL_AA))
68 
69 /* Vertex Color macros. */
70 #define GPENCIL_USE_VERTEX_COLOR(toolsettings) \
71  (((toolsettings)->gp_paint->mode == GPPAINT_FLAG_USE_VERTEXCOLOR))
72 #define GPENCIL_USE_VERTEX_COLOR_STROKE(toolsettings, brush) \
73  ((GPENCIL_USE_VERTEX_COLOR(toolsettings) && \
74  (((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_STROKE) || \
75  ((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_BOTH))))
76 #define GPENCIL_USE_VERTEX_COLOR_FILL(toolsettings, brush) \
77  ((GPENCIL_USE_VERTEX_COLOR(toolsettings) && \
78  (((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_FILL) || \
79  ((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_BOTH))))
80 #define GPENCIL_TINT_VERTEX_COLOR_STROKE(brush) \
81  (((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_STROKE) || \
82  ((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_BOTH))
83 #define GPENCIL_TINT_VERTEX_COLOR_FILL(brush) \
84  (((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_FILL) || \
85  ((brush)->gpencil_settings->vertex_mode == GPPAINT_MODE_BOTH))
86 
87 /* ------------ Grease-Pencil API ------------------ */
88 
92 void BKE_gpencil_free_stroke(struct bGPDstroke *gps);
93 bool BKE_gpencil_free_strokes(struct bGPDframe *gpf);
94 void BKE_gpencil_free_frames(struct bGPDlayer *gpl);
95 void BKE_gpencil_free_layers(struct ListBase *list);
96 void BKE_gpencil_free(struct bGPdata *gpd, bool free_all);
97 void BKE_gpencil_eval_delete(struct bGPdata *gpd_eval);
98 void BKE_gpencil_free_layer_masks(struct bGPDlayer *gpl);
99 void BKE_gpencil_tag(struct bGPdata *gpd);
100 
102 void BKE_gpencil_batch_cache_free(struct bGPdata *gpd);
103 
104 void BKE_gpencil_stroke_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps);
105 void BKE_gpencil_curve_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps);
106 void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps);
108 
109 struct bGPDframe *BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe);
110 struct bGPDframe *BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe);
111 struct bGPDlayer *BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive);
112 struct bGPdata *BKE_gpencil_data_addnew(struct Main *bmain, const char name[]);
113 
114 struct bGPDframe *BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src,
115  const bool dup_strokes);
116 struct bGPDlayer *BKE_gpencil_layer_duplicate(const struct bGPDlayer *gpl_src,
117  const bool dup_frames,
118  const bool dup_strokes);
119 void BKE_gpencil_frame_copy_strokes(struct bGPDframe *gpf_src, struct bGPDframe *gpf_dst);
120 void BKE_gpencil_frame_selected_hash(struct bGPdata *gpd, struct GHash *r_list);
121 
123 struct bGPDstroke *BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src,
124  const bool dup_points,
125  const bool dup_curve);
126 
128  const struct bGPdata *gpd,
129  bool internal_copy);
130 
131 void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe *gpf);
132 
133 /* materials */
134 void BKE_gpencil_material_index_reassign(struct bGPdata *gpd, int totcol, int index);
135 bool BKE_gpencil_material_index_used(struct bGPdata *gpd, int index);
136 void BKE_gpencil_material_remap(struct bGPdata *gpd,
137  const unsigned int *remap,
138  unsigned int remap_len);
140  const float hue_threshold,
141  const float sat_threshold,
142  const float val_threshold,
143  struct GHash *r_mat_table);
144 bool BKE_gpencil_merge_materials(struct Object *ob,
145  const float hue_threshold,
146  const float sat_threshold,
147  const float val_threshold,
148  int *r_removed);
149 
150 /* statistics functions */
151 void BKE_gpencil_stats_update(struct bGPdata *gpd);
152 
153 /* Utilities for creating and populating GP strokes */
154 /* - Number of values defining each point in the built-in data
155  * buffers for primitives (e.g. 2D Monkey)
156  */
157 #define GP_PRIM_DATABUF_SIZE 5
158 
160  const float *array,
161  const int totpoints,
162  const float mat[4][4]);
163 
164 struct bGPDstroke *BKE_gpencil_stroke_new(int mat_idx, int totpoints, short thickness);
166  struct bGPDframe *gpf, int mat_idx, int totpoints, short thickness, const bool insert_at_head);
167 
169  struct bGPDstroke *existing,
170  int mat_idx,
171  int totpoints,
172  short thickness);
173 
175 
176 /* Stroke and Fill - Alpha Visibility Threshold */
177 #define GPENCIL_ALPHA_OPACITY_THRESH 0.001f
178 #define GPENCIL_STRENGTH_MIN 0.003f
179 
180 bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl);
181 
182 /* How gpencil_layer_getframe() should behave when there
183  * is no existing GP-Frame on the frame requested.
184  */
185 typedef enum eGP_GetFrame_Mode {
186  /* Use the preceding gp-frame (i.e. don't add anything) */
188 
189  /* Add a new empty/blank frame */
191  /* Make a copy of the active frame */
194 
196  int cframe,
197  eGP_GetFrame_Mode addnew);
198 struct bGPDframe *BKE_gpencil_layer_frame_find(struct bGPDlayer *gpl, int cframe);
199 bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf);
200 
201 struct bGPDlayer *BKE_gpencil_layer_named_get(struct bGPdata *gpd, const char *name);
202 struct bGPDlayer *BKE_gpencil_layer_active_get(struct bGPdata *gpd);
203 void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active);
204 void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl);
205 void BKE_gpencil_layer_autolock_set(struct bGPdata *gpd, const bool unlock);
206 
207 struct bGPDlayer_Mask *BKE_gpencil_layer_mask_add(struct bGPDlayer *gpl, const char *name);
209 void BKE_gpencil_layer_mask_remove_ref(struct bGPdata *gpd, const char *name);
210 struct bGPDlayer_Mask *BKE_gpencil_layer_mask_named_get(struct bGPDlayer *gpl, const char *name);
211 void BKE_gpencil_layer_mask_sort(struct bGPdata *gpd, struct bGPDlayer *gpl);
212 void BKE_gpencil_layer_mask_sort_all(struct bGPdata *gpd);
213 void BKE_gpencil_layer_frames_sort(struct bGPDlayer *gpl, bool *r_has_duplicate_frames);
214 
216  char *name,
217  int first_if_not_found);
218 
219 /* Brush */
220 struct Material *BKE_gpencil_brush_material_get(struct Brush *brush);
221 void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material);
222 
223 /* Object */
226  struct Object *ob,
227  struct Brush *brush);
228 int BKE_gpencil_object_material_ensure(struct Main *bmain,
229  struct Object *ob,
230  struct Material *material);
232  struct Object *ob,
233  const char *name,
234  int *r_index);
235 
236 struct Material *BKE_gpencil_object_material_new(struct Main *bmain,
237  struct Object *ob,
238  const char *name,
239  int *r_index);
240 
241 int BKE_gpencil_object_material_index_get(struct Object *ob, struct Material *ma);
242 int BKE_gpencil_object_material_index_get_by_name(struct Object *ob, const char *name);
243 
245  struct Brush *brush);
246 int BKE_gpencil_object_material_get_index_from_brush(struct Object *ob, struct Brush *brush);
247 
249  struct Main *bmain, struct Object *ob, struct ToolSettings *ts);
251  struct Object *ob,
252  struct Brush *brush);
254 
256 
257 /* vertex groups */
258 void BKE_gpencil_dvert_ensure(struct bGPDstroke *gps);
259 void BKE_gpencil_vgroup_remove(struct Object *ob, struct bDeformGroup *defgroup);
260 void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst);
261 
262 /* Set active frame by layer. */
263 void BKE_gpencil_frame_active_set(struct Depsgraph *depsgraph, struct bGPdata *gpd);
264 
265 void BKE_gpencil_frame_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe);
267  struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff);
268 
269 void BKE_gpencil_palette_ensure(struct Main *bmain, struct Scene *scene);
270 
271 bool BKE_gpencil_from_image(struct SpaceImage *sima,
272  struct bGPdata *gpd,
273  struct bGPDframe *gpf,
274  const float size,
275  const bool mask);
276 
277 /* Iterator */
278 /* frame & stroke are NULL if it is a layer callback. */
279 typedef void (*gpIterCb)(struct bGPDlayer *layer,
280  struct bGPDframe *frame,
281  struct bGPDstroke *stroke,
282  void *thunk);
283 
284 void BKE_gpencil_visible_stroke_iter(struct ViewLayer *view_layer,
285  struct Object *ob,
286  gpIterCb layer_cb,
287  gpIterCb stroke_cb,
288  void *thunk,
289  bool do_onion,
290  int cfra);
291 
292 extern void (*BKE_gpencil_batch_cache_dirty_tag_cb)(struct bGPdata *gpd);
293 extern void (*BKE_gpencil_batch_cache_free_cb)(struct bGPdata *gpd);
294 
295 void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig,
296  const struct bGPDframe *gpf_eval);
297 void BKE_gpencil_update_orig_pointers(const struct Object *ob_orig, const struct Object *ob_eval);
298 
300  struct Object *obact,
301  struct bGPDlayer *gpl,
302  float diff_mat[4][4]);
303 
305 
306 int BKE_gpencil_material_find_index_by_name_prefix(struct Object *ob, const char *name_prefix);
307 
308 void BKE_gpencil_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd);
309 
310 #ifdef __cplusplus
311 }
312 #endif
void BKE_gpencil_eval_delete(struct bGPdata *gpd_eval)
Definition: gpencil.c:512
bool BKE_gpencil_free_strokes(struct bGPDframe *gpf)
Definition: gpencil.c:425
void BKE_gpencil_curve_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps)
Definition: gpencil.c:1167
void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps)
Definition: gpencil.c:1203
struct Material * BKE_gpencil_brush_material_get(struct Brush *brush)
Definition: gpencil.c:1787
struct bGPDframe * BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe)
Definition: gpencil.c:539
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
Definition: gpencil.c:1698
struct bGPDstroke * BKE_gpencil_stroke_add(struct bGPDframe *gpf, int mat_idx, int totpoints, short thickness, const bool insert_at_head)
Definition: gpencil.c:871
struct Material * BKE_gpencil_object_material_new(struct Main *bmain, struct Object *ob, const char *name, int *r_index)
Definition: gpencil.c:1873
struct Material * BKE_gpencil_object_material_ensure_by_name(struct Main *bmain, struct Object *ob, const char *name, int *r_index)
Definition: gpencil.c:2466
struct bGPDlayer_Mask * BKE_gpencil_layer_mask_named_get(struct bGPDlayer *gpl, const char *name)
Definition: gpencil.c:1510
void BKE_gpencil_layer_mask_sort(struct bGPdata *gpd, struct bGPDlayer *gpl)
Definition: gpencil.c:1588
bool BKE_gpencil_material_index_used(struct bGPdata *gpd, int index)
Definition: gpencil.c:2167
void BKE_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd)
Definition: gpencil.c:343
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1650
struct bGPDframe * BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe)
Definition: gpencil.c:598
void BKE_gpencil_free_stroke_weights(struct bGPDstroke *gps)
Definition: gpencil.c:370
int BKE_gpencil_object_material_ensure(struct Main *bmain, struct Object *ob, struct Material *material)
Definition: gpencil.c:1851
void BKE_gpencil_material_remap(struct bGPdata *gpd, const unsigned int *remap, unsigned int remap_len)
Definition: gpencil.c:2188
void BKE_gpencil_material_index_reassign(struct bGPdata *gpd, int totcol, int index)
Definition: gpencil.c:2146
void BKE_gpencil_layer_mask_sort_all(struct bGPdata *gpd)
Definition: gpencil.c:1607
struct bGPDlayer * BKE_gpencil_layer_duplicate(const struct bGPDlayer *gpl_src, const bool dup_frames, const bool dup_strokes)
float BKE_gpencil_multiframe_falloff_calc(struct bGPDframe *gpf, int actnum, int f_init, int f_end, struct CurveMapping *cur_falloff)
Definition: gpencil.c:2109
struct Material * BKE_gpencil_object_material_ensure_active(struct Object *ob)
Definition: gpencil.c:1982
void BKE_gpencil_visible_stroke_iter(struct ViewLayer *view_layer, struct Object *ob, gpIterCb layer_cb, gpIterCb stroke_cb, void *thunk, bool do_onion, int cfra)
Definition: gpencil.c:2637
void BKE_gpencil_frame_delete_laststroke(struct bGPDlayer *gpl, struct bGPDframe *gpf)
Definition: gpencil.c:1223
void BKE_gpencil_free_point_weights(struct MDeformVert *dvert)
Definition: gpencil.c:362
void BKE_gpencil_palette_ensure(struct Main *bmain, struct Scene *scene)
Definition: gpencil.c:2484
void(* gpIterCb)(struct bGPDlayer *layer, struct bGPDframe *frame, struct bGPDstroke *stroke, void *thunk)
Definition: BKE_gpencil.h:279
void BKE_gpencil_stroke_select_index_reset(struct bGPDstroke *gps)
Definition: gpencil.c:1210
bool BKE_gpencil_merge_materials_table_get(struct Object *ob, const float hue_threshold, const float sat_threshold, const float val_threshold, struct GHash *r_mat_table)
Definition: gpencil.c:2222
struct bGPDstroke * BKE_gpencil_stroke_add_existing_style(struct bGPDframe *gpf, struct bGPDstroke *existing, int mat_idx, int totpoints, short thickness)
Definition: gpencil.c:899
void BKE_gpencil_free_frames(struct bGPDlayer *gpl)
Definition: gpencil.c:439
struct bGPDcurve * BKE_gpencil_stroke_editcurve_new(const int tot_curve_points)
Definition: gpencil.c:910
struct bGPDcurve * BKE_gpencil_stroke_curve_duplicate(struct bGPDcurve *gpc_src)
Definition: gpencil.c:939
void BKE_gpencil_layer_mask_remove(struct bGPDlayer *gpl, struct bGPDlayer_Mask *mask)
Definition: gpencil.c:1540
struct bGPDlayer_Mask * BKE_gpencil_layer_mask_add(struct bGPDlayer *gpl, const char *name)
Definition: gpencil.c:1524
void BKE_gpencil_frame_active_set(struct Depsgraph *depsgraph, struct bGPdata *gpd)
void BKE_gpencil_layer_frames_sort(struct bGPDlayer *gpl, bool *r_has_duplicate_frames)
Definition: gpencil.c:1640
void BKE_gpencil_dvert_ensure(struct bGPDstroke *gps)
Definition: gpencil.c:2067
bool BKE_gpencil_layer_is_editable(const struct bGPDlayer *gpl)
bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
Definition: gpencil.c:1467
void BKE_gpencil_stats_update(struct bGPdata *gpd)
Definition: gpencil.c:2412
void BKE_gpencil_layer_mask_remove_ref(struct bGPdata *gpd, const char *name)
Definition: gpencil.c:1552
int BKE_gpencil_object_material_index_get_by_name(struct Object *ob, const char *name)
Definition: gpencil.c:2451
struct Material * BKE_gpencil_object_material_ensure_from_active_input_material(struct Object *ob)
Definition: gpencil.c:1967
bool BKE_gpencil_stroke_select_check(const struct bGPDstroke *gps)
struct Material * BKE_gpencil_object_material_ensure_from_active_input_brush(struct Main *bmain, struct Object *ob, struct Brush *brush)
Definition: gpencil.c:1944
void BKE_gpencil_blend_read_data(struct BlendDataReader *reader, struct bGPdata *gpd)
Definition: gpencil.c:196
int BKE_gpencil_object_material_index_get(struct Object *ob, struct Material *ma)
Definition: gpencil.c:2437
struct bGPDstroke * BKE_gpencil_stroke_new(int mat_idx, int totpoints, short thickness)
Definition: gpencil.c:826
void BKE_gpencil_free_layer_masks(struct bGPDlayer *gpl)
Definition: gpencil.c:459
void BKE_gpencil_frame_range_selected(struct bGPDlayer *gpl, int *r_initframe, int *r_endframe)
Definition: gpencil.c:2084
void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig, const struct bGPDframe *gpf_eval)
Definition: gpencil.c:2839
void BKE_gpencil_update_layer_transforms(const struct Depsgraph *depsgraph, struct Object *ob)
void BKE_gpencil_free_stroke_editcurve(struct bGPDstroke *gps)
Definition: gpencil.c:386
struct bGPDlayer * BKE_gpencil_layer_named_get(struct bGPdata *gpd, const char *name)
Definition: gpencil.c:1496
struct bGPDframe * BKE_gpencil_layer_frame_find(struct bGPDlayer *gpl, int cframe)
Definition: gpencil.c:1281
struct bGPDlayer * BKE_gpencil_layer_get_by_name(struct bGPdata *gpd, char *name, int first_if_not_found)
Definition: gpencil.c:1668
void BKE_gpencil_free(struct bGPdata *gpd, bool free_all)
Definition: gpencil.c:493
void BKE_gpencil_free_stroke(struct bGPDstroke *gps)
Definition: gpencil.c:401
struct Material * BKE_gpencil_object_material_ensure_from_active_input_toolsettings(struct Main *bmain, struct Object *ob, struct ToolSettings *ts)
Definition: gpencil.c:1925
struct Material * BKE_gpencil_object_material_from_brush_get(struct Object *ob, struct Brush *brush)
Definition: gpencil.c:1893
void BKE_gpencil_vgroup_remove(struct Object *ob, struct bDeformGroup *defgroup)
Definition: gpencil.c:2025
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
Definition: gpencil.c:1307
bool BKE_gpencil_merge_materials(struct Object *ob, const float hue_threshold, const float sat_threshold, const float val_threshold, int *r_removed)
Definition: gpencil.c:2350
int BKE_gpencil_object_material_get_index_from_brush(struct Object *ob, struct Brush *brush)
Definition: gpencil.c:1910
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, const bool dup_strokes)
void(* BKE_gpencil_batch_cache_dirty_tag_cb)(struct bGPdata *gpd)
Definition: gpencil.c:340
struct bGPdata * BKE_gpencil_data_addnew(struct Main *bmain, const char name[])
Definition: gpencil.c:742
void BKE_gpencil_update_orig_pointers(const struct Object *ob_orig, const struct Object *ob_eval)
bool BKE_gpencil_from_image(struct SpaceImage *sima, struct bGPdata *gpd, struct bGPDframe *gpf, const float size, const bool mask)
Definition: gpencil.c:2542
void BKE_gpencil_stroke_add_points(struct bGPDstroke *gps, const float *array, const int totpoints, const float mat[4][4])
Definition: gpencil.c:800
void BKE_gpencil_layer_transform_matrix_get(const struct Depsgraph *depsgraph, struct Object *obact, struct bGPDlayer *gpl, float diff_mat[4][4])
struct Material * BKE_gpencil_object_material_ensure_from_brush(struct Main *bmain, struct Object *ob, struct Brush *brush)
Definition: gpencil.c:1826
struct bGPDstroke * BKE_gpencil_stroke_duplicate(struct bGPDstroke *gps_src, const bool dup_points, const bool dup_curve)
Definition: gpencil.c:957
int BKE_gpencil_material_find_index_by_name_prefix(struct Object *ob, const char *name_prefix)
Definition: gpencil.c:3031
void BKE_gpencil_batch_cache_free(struct bGPdata *gpd)
Definition: gpencil.c:351
void BKE_gpencil_frame_copy_strokes(struct bGPDframe *gpf_src, struct bGPDframe *gpf_dst)
Definition: gpencil.c:1032
void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
Definition: gpencil.c:1760
struct bGPdata * BKE_gpencil_data_duplicate(struct Main *bmain, const struct bGPdata *gpd, bool internal_copy)
void BKE_gpencil_free_layers(struct ListBase *list)
Definition: gpencil.c:469
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive)
Definition: gpencil.c:659
void(* BKE_gpencil_batch_cache_free_cb)(struct bGPdata *gpd)
Definition: gpencil.c:341
void BKE_gpencil_stroke_weights_duplicate(struct bGPDstroke *gps_src, struct bGPDstroke *gps_dst)
Definition: gpencil.c:928
void BKE_gpencil_tag(struct bGPdata *gpd)
Definition: gpencil.c:525
void BKE_gpencil_layer_autolock_set(struct bGPdata *gpd, const bool unlock)
Definition: gpencil.c:1725
void BKE_gpencil_frame_selected_hash(struct bGPdata *gpd, struct GHash *r_list)
Definition: gpencil.c:3046
void BKE_gpencil_brush_material_set(struct Brush *brush, struct Material *material)
Definition: gpencil.c:1804
eGP_GetFrame_Mode
Definition: BKE_gpencil.h:185
@ GP_GETFRAME_ADD_NEW
Definition: BKE_gpencil.h:190
@ GP_GETFRAME_ADD_COPY
Definition: BKE_gpencil.h:192
@ GP_GETFRAME_USE_PREV
Definition: BKE_gpencil.h:187
void BKE_gpencil_stroke_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps)
Definition: gpencil.c:1139
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
Material material
const Depsgraph * depsgraph
bool active
all scheduled work for the GPU.
Definition: BKE_main.h:116
struct Material ** mat
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)