Blender  V3.3
overlay_gpencil.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. */
3 
8 #include "DRW_render.h"
9 
10 #include "BKE_gpencil.h"
11 
12 #include "UI_resources.h"
13 
14 #include "DNA_gpencil_types.h"
15 
16 #include "DEG_depsgraph_query.h"
17 
18 #include "ED_view3d.h"
19 
20 #include "overlay_private.h"
21 
22 #include "draw_common.h"
23 #include "draw_manager_text.h"
24 
26 {
27  OVERLAY_PassList *psl = vedata->psl;
28  OVERLAY_PrivateData *pd = vedata->stl->pd;
29  struct GPUShader *sh;
30  DRWShadingGroup *grp;
31 
32  /* Default: Display nothing. */
35  psl->edit_gpencil_ps = NULL;
36 
40 
41  const DRWContextState *draw_ctx = DRW_context_state_get();
42  View3D *v3d = draw_ctx->v3d;
43  Object *ob = draw_ctx->obact;
44  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
45  Scene *scene = draw_ctx->scene;
47 
48  if (gpd == NULL || ob->type != OB_GPENCIL) {
49  return;
50  }
51 
52  /* For sculpt show only if mask mode, and only points if not stroke mode. */
53  const bool use_sculpt_mask = (GPENCIL_SCULPT_MODE(gpd) &&
54  GPENCIL_ANY_SCULPT_MASK(ts->gpencil_selectmode_sculpt));
55  const bool show_sculpt_points = (GPENCIL_SCULPT_MODE(gpd) &&
56  (ts->gpencil_selectmode_sculpt &
59 
60  /* For vertex paint show only if mask mode, and only points if not stroke mode. */
61  bool use_vertex_mask = (GPENCIL_VERTEX_MODE(gpd) &&
62  GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
63  const bool show_vertex_points = (GPENCIL_VERTEX_MODE(gpd) &&
64  (ts->gpencil_selectmode_vertex &
67 
68  /* If Sculpt or Vertex mode and the mask is disabled, the select must be hidden. */
69  const bool hide_select = ((GPENCIL_SCULPT_MODE(gpd) && !use_sculpt_mask) ||
70  (GPENCIL_VERTEX_MODE(gpd) && !use_vertex_mask));
71 
72  const bool do_multiedit = GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
73  const bool show_multi_edit_lines = (do_multiedit) &&
75  V3D_GP_SHOW_EDIT_LINES)) != 0);
76 
77  const bool show_lines = (v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES) || show_multi_edit_lines;
78 
79  const bool hide_lines = !GPENCIL_EDIT_MODE(gpd) && !GPENCIL_WEIGHT_MODE(gpd) &&
80  !use_sculpt_mask && !use_vertex_mask && !show_lines;
81 
82  /* Special case when vertex paint and multiedit lines. */
83  if (do_multiedit && show_multi_edit_lines && GPENCIL_VERTEX_MODE(gpd)) {
84  use_vertex_mask = true;
85  }
86 
87  const bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
88 
89  /* Show Edit points if:
90  * Edit mode: Not in Stroke selection mode
91  * Sculpt mode: If use Mask and not Stroke mode
92  * Weight mode: Always
93  * Vertex mode: If use Mask and not Stroke mode
94  */
95  const bool show_points = show_sculpt_points || is_weight_paint || show_vertex_points ||
96  (GPENCIL_EDIT_MODE(gpd) &&
97  (ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE));
98 
99  if ((!GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)) &&
100  ((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) {
104 
105  if (show_lines && !hide_lines) {
108  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
109  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", show_multi_edit_lines);
110  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
111  DRW_shgroup_uniform_bool_copy(grp, "hideSelect", hide_select);
112  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
114  }
115 
116  if (show_points && !hide_select) {
119  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
120  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", do_multiedit);
121  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
122  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
124  }
125  }
126 
127  /* Handles and curve point for Curve Edit sub-mode. */
131 
132  /* Edit lines. */
133  if (show_lines) {
136  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
137  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", show_multi_edit_lines);
138  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
139  DRW_shgroup_uniform_bool_copy(grp, "hideSelect", hide_select);
140  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
142  }
143 
146  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
147  DRW_shgroup_uniform_bool_copy(grp, "showCurveHandles", pd->edit_curve.show_handles);
148  DRW_shgroup_uniform_int_copy(grp, "curveHandleDisplay", pd->edit_curve.handle_display);
150 
153  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
154  DRW_shgroup_uniform_bool_copy(grp, "showCurveHandles", pd->edit_curve.show_handles);
155  DRW_shgroup_uniform_int_copy(grp, "curveHandleDisplay", pd->edit_curve.handle_display);
156  }
157 
158  /* control points for primitives and speed guide */
159  const bool is_cppoint = (gpd->runtime.tot_cp_points > 0);
160  const bool is_speed_guide = (ts->gp_sculpt.guide.use_guide &&
161  (draw_ctx->object_mode == OB_MODE_PAINT_GPENCIL));
162  const bool is_show_gizmo = (((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) &&
163  ((v3d->gizmo_flag & V3D_GIZMO_HIDE_TOOL) == 0));
164 
165  if ((is_cppoint || is_speed_guide) && (is_show_gizmo)) {
168 
171 
172  if (gpd->runtime.cp_points != NULL) {
173  for (int i = 0; i < gpd->runtime.tot_cp_points; i++) {
174  bGPDcontrolpoint *cp = &gpd->runtime.cp_points[i];
175  grp = DRW_shgroup_create_sub(grp);
176  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", &cp->x);
177  DRW_shgroup_uniform_float_copy(grp, "pSize", cp->size * 0.8f * G_draw.block.size_pixel);
178  DRW_shgroup_uniform_vec4_copy(grp, "pColor", cp->color);
180  }
181  }
182 
183  if (ts->gp_sculpt.guide.use_guide) {
184  float color[4];
185  if (ts->gp_sculpt.guide.reference_point == GP_GUIDE_REF_CUSTOM) {
187  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.location);
188  }
189  else if (ts->gp_sculpt.guide.reference_point == GP_GUIDE_REF_OBJECT &&
190  ts->gp_sculpt.guide.reference_object != NULL) {
192  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.reference_object->loc);
193  }
194  else {
197  }
198  DRW_shgroup_uniform_vec4_copy(grp, "pColor", color);
201  }
202  }
203 }
204 
206 {
207  OVERLAY_PassList *psl = vedata->psl;
208  OVERLAY_PrivateData *pd = vedata->stl->pd;
209  struct GPUShader *sh;
210  DRWShadingGroup *grp;
211 
212  /* Default: Display nothing. */
213  psl->gpencil_canvas_ps = NULL;
214 
215  const DRWContextState *draw_ctx = DRW_context_state_get();
216  View3D *v3d = draw_ctx->v3d;
217  Object *ob = draw_ctx->obact;
218  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
219  Scene *scene = draw_ctx->scene;
221  const View3DCursor *cursor = &scene->cursor;
222 
225 
226  if (gpd == NULL || ob->type != OB_GPENCIL) {
227  return;
228  }
229 
230  const bool show_overlays = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
231  const bool show_grid = (v3d->gp_flag & V3D_GP_SHOW_GRID) != 0 &&
232  ((ts->gpencil_v3d_align &
234  const bool grid_xray = (v3d->gp_flag & V3D_GP_SHOW_GRID_XRAY);
235 
236  if (show_grid && show_overlays) {
237  const char *grid_unit = NULL;
238  float mat[4][4];
239  float col_grid[4];
240  float size[2];
241 
242  /* set color */
243  copy_v3_v3(col_grid, gpd->grid.color);
244  col_grid[3] = max_ff(v3d->overlay.gpencil_grid_opacity, 0.01f);
245 
246  copy_m4_m4(mat, ob->obmat);
247 
248  /* Rotate and scale except align to cursor. */
250  if (gpl != NULL) {
251  if (ts->gp_sculpt.lock_axis != GP_LOCKAXIS_CURSOR) {
252  float matrot[3][3];
253  copy_m3_m4(matrot, gpl->layer_mat);
254  mul_m4_m4m3(mat, mat, matrot);
255  }
256  }
257 
258  float viewinv[4][4];
259  /* Set the grid in the selected axis */
260  switch (ts->gp_sculpt.lock_axis) {
261  case GP_LOCKAXIS_X:
262  swap_v4_v4(mat[0], mat[2]);
263  break;
264  case GP_LOCKAXIS_Y:
265  swap_v4_v4(mat[1], mat[2]);
266  break;
267  case GP_LOCKAXIS_Z:
268  /* Default. */
269  break;
270  case GP_LOCKAXIS_CURSOR:
271  loc_eul_size_to_mat4(mat, cursor->location, cursor->rotation_euler, (float[3]){1, 1, 1});
272  break;
273  case GP_LOCKAXIS_VIEW:
274  /* view aligned */
275  DRW_view_viewmat_get(NULL, viewinv, true);
276  copy_v3_v3(mat[0], viewinv[0]);
277  copy_v3_v3(mat[1], viewinv[1]);
278  break;
279  }
280 
281  /* Move the grid to the right location depending of the align type.
282  * This is required only for 3D Cursor or Origin. */
283  if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
284  copy_v3_v3(mat[3], cursor->location);
285  }
286  else if (ts->gpencil_v3d_align & GP_PROJECT_VIEWSPACE) {
287  copy_v3_v3(mat[3], ob->obmat[3]);
288  }
289 
290  translate_m4(mat, gpd->grid.offset[0], gpd->grid.offset[1], 0.0f);
291  mul_v2_v2fl(size, gpd->grid.scale, 2.0f * ED_scene_grid_scale(scene, &grid_unit));
292  rescale_m4(mat, (float[3]){size[0], size[1], 0.0f});
293 
294  /* Apply layer loc transform, except cursor mode. */
295  if ((gpl != NULL) && (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) {
296  add_v3_v3(mat[3], gpl->layer_mat[3]);
297  }
298 
299  const int gridlines = (gpd->grid.lines <= 0) ? 1 : gpd->grid.lines;
300  const int line_count = gridlines * 4 + 2;
301 
304 
306 
309  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
310  DRW_shgroup_uniform_vec4_copy(grp, "color", col_grid);
311  DRW_shgroup_uniform_vec3_copy(grp, "xAxis", mat[0]);
312  DRW_shgroup_uniform_vec3_copy(grp, "yAxis", mat[1]);
313  DRW_shgroup_uniform_vec3_copy(grp, "origin", mat[3]);
314  DRW_shgroup_uniform_int_copy(grp, "halfLineCount", line_count / 2);
315  DRW_shgroup_call_procedural_lines(grp, NULL, line_count);
316  }
317 }
318 
320 {
321  OVERLAY_PrivateData *pd = vedata->stl->pd;
322  bGPdata *gpd = (bGPdata *)ob->data;
323  const DRWContextState *draw_ctx = DRW_context_state_get();
324  View3D *v3d = draw_ctx->v3d;
325 
326  /* Overlay is only for active object. */
327  if (ob != draw_ctx->obact) {
328  return;
329  }
330 
331  if (pd->edit_gpencil_wires_grp) {
333  DRW_shgroup_uniform_vec4_copy(grp, "gpEditColor", gpd->line_color);
334 
335  struct GPUBatch *geom = DRW_cache_gpencil_edit_lines_get(ob, pd->cfra);
337  }
338 
339  if (pd->edit_gpencil_points_grp) {
340  const bool show_direction = (v3d->gp_flag & V3D_GP_SHOW_STROKE_DIRECTION) != 0;
341 
343  DRW_shgroup_uniform_float_copy(grp, "doStrokeEndpoints", show_direction);
344 
345  struct GPUBatch *geom = DRW_cache_gpencil_edit_points_get(ob, pd->cfra);
346  DRW_shgroup_call_no_cull(grp, geom, ob);
347  }
348 
351  if (geom) {
353  }
354  }
355 
357  struct GPUBatch *geom = DRW_cache_gpencil_edit_curve_points_get(ob, pd->cfra);
358  if (geom) {
360  }
361  }
362 }
363 
365  bGPDframe *UNUSED(gpf),
366  bGPDstroke *gps,
367  void *thunk)
368 {
369  Object *ob = (Object *)thunk;
370  Material *ma = BKE_object_material_get_eval(ob, gps->mat_nr + 1);
371  if (ma == NULL) {
372  return;
373  }
374  MaterialGPencilStyle *gp_style = ma->gp_style;
375  /* skip stroke if it doesn't have any valid data */
376  if ((gps->points == NULL) || (gps->totpoints < 1) || (gp_style == NULL)) {
377  return;
378  }
379  /* check if the color is visible */
380  if (gp_style->flag & GP_MATERIAL_HIDE) {
381  return;
382  }
383  /* only if selected */
384  if (gps->flag & GP_STROKE_SELECT) {
385  for (int i = 0; i < gps->totpoints; i++) {
386  bGPDspoint *pt = &gps->points[i];
387  /* Draw name at the first selected point. */
388  if (pt->flag & GP_SPOINT_SELECT) {
389  const DRWContextState *draw_ctx = DRW_context_state_get();
390  ViewLayer *view_layer = draw_ctx->view_layer;
391 
392  int theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
393  uchar color[4];
394  UI_GetThemeColor4ubv(theme_id, color);
395 
396  float fpt[3];
397  mul_v3_m4v3(fpt, ob->obmat, &pt->x);
398 
399  struct DRWTextStore *dt = DRW_text_cache_ensure();
401  fpt,
402  ma->id.name + 2,
403  strlen(ma->id.name + 2),
404  10,
405  0,
407  color);
408  break;
409  }
410  }
411  }
412 }
413 
415 {
416  const DRWContextState *draw_ctx = DRW_context_state_get();
417  int cfra = DEG_get_ctime(draw_ctx->depsgraph);
418 
420  NULL, ob, NULL, overlay_gpencil_draw_stroke_color_name, ob, false, cfra);
421 }
422 
424 {
425  const DRWContextState *draw_ctx = DRW_context_state_get();
426  View3D *v3d = draw_ctx->v3d;
427 
428  bGPdata *gpd = (bGPdata *)ob->data;
429  if (gpd == NULL) {
430  return;
431  }
432 
433  if (GPENCIL_ANY_MODE(gpd)) {
435  }
436 
437  /* don't show object extras in set's */
438  if ((ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) == 0) {
439  if ((v3d->gp_flag & V3D_GP_SHOW_MATERIAL_NAME) && (ob->mode == OB_MODE_EDIT_GPENCIL) &&
442  }
443  }
444 }
445 
447 {
448  OVERLAY_PassList *psl = vedata->psl;
449 
450  if (psl->gpencil_canvas_ps) {
452  }
453 }
454 
456 {
457  OVERLAY_PassList *psl = vedata->psl;
458 
459  if (psl->edit_gpencil_gizmos_ps) {
461  }
462 
463  if (psl->edit_gpencil_ps) {
465  }
466 
467  /* Curve edit handles. */
468  if (psl->edit_gpencil_curve_ps) {
470  }
471 }
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1558
void BKE_gpencil_visible_stroke_advanced_iter(struct ViewLayer *view_layer, struct Object *ob, gpIterCb layer_cb, gpIterCb stroke_cb, void *thunk, bool do_onion, int cfra)
Definition: gpencil.c:2430
struct Material * BKE_object_material_get_eval(struct Object *ob, short act)
Definition: material.c:707
MINLINE float max_ff(float a, float b)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
Definition: math_matrix.c:87
void mul_m4_m4m3(float R[4][4], const float A[4][4], const float B[3][3])
Definition: math_matrix.c:434
void translate_m4(float mat[4][4], float tx, float ty, float tz)
Definition: math_matrix.c:2318
void rescale_m4(float mat[4][4], const float scale[3])
Definition: math_matrix.c:2362
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:77
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:739
void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3])
Definition: math_matrix.c:2547
MINLINE void swap_v4_v4(float a[4], float b[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
unsigned char uchar
Definition: BLI_sys_types.h:70
#define UNUSED(x)
float DEG_get_ctime(const Depsgraph *graph)
#define GPENCIL_ANY_VERTEX_MASK(flag)
#define GPENCIL_VERTEX_MODE(gpd)
#define GPENCIL_EDIT_MODE(gpd)
#define GPENCIL_WEIGHT_MODE(gpd)
#define GPENCIL_SCULPT_MODE(gpd)
@ GP_STROKE_SELECT
#define GPENCIL_MULTIEDIT_SESSIONS_ON(gpd)
#define GPENCIL_PAINT_MODE(gpd)
#define GPENCIL_ANY_SCULPT_MASK(flag)
@ GP_DATA_STROKE_WEIGHTMODE
#define GPENCIL_ANY_MODE(gpd)
#define GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)
@ GP_SPOINT_SELECT
@ BASE_FROM_DUPLI
@ BASE_FROM_SET
@ GP_MATERIAL_HIDE
@ OB_MODE_EDIT_GPENCIL
@ OB_MODE_PAINT_GPENCIL
@ OB_GPENCIL
@ GP_GUIDE_REF_OBJECT
@ GP_GUIDE_REF_CUSTOM
@ GP_LOCKAXIS_X
@ GP_LOCKAXIS_VIEW
@ GP_LOCKAXIS_Y
@ GP_LOCKAXIS_Z
@ GP_LOCKAXIS_CURSOR
@ GP_SELECTMODE_STROKE
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_POINT
@ GP_PROJECT_VIEWSPACE
@ GP_PROJECT_DEPTH_VIEW
@ GP_PROJECT_CURSOR
@ GP_PROJECT_DEPTH_STROKE
#define V3D_GP_SHOW_GRID_XRAY
@ V3D_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE
#define V3D_GP_SHOW_MATERIAL_NAME
#define V3D_GP_SHOW_STROKE_DIRECTION
#define V3D_GP_SHOW_EDIT_LINES
#define V3D_HIDE_OVERLAYS
#define V3D_GP_SHOW_GRID
@ CURVE_HANDLE_NONE
#define V3D_GP_SHOW_MULTIEDIT_LINES
#define DRW_shgroup_call_no_cull(shgroup, geom, ob)
Definition: DRW_render.h:431
DRWState
Definition: DRW_render.h:298
@ DRW_STATE_BLEND_ALPHA
Definition: DRW_render.h:328
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:302
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:303
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:311
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:309
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:690
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
Definition: DRW_render.h:651
float ED_scene_grid_scale(const struct Scene *scene, const char **r_grid_unit)
GPUBatch
Definition: GPU_batch.h:78
struct GPUShader GPUShader
Definition: GPU_shader.h:20
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ TH_REDALERT
Definition: UI_resources.h:34
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:305
@ TH_GIZMO_SECONDARY
Definition: UI_resources.h:306
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1173
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
Definition: resources.c:1352
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
struct GPUBatch * DRW_cache_gpencil_edit_lines_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_gpencil_edit_curve_points_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_gpencil_edit_curve_handles_get(struct Object *ob, int cfra)
struct GPUBatch * DRW_cache_gpencil_edit_points_get(struct Object *ob, int cfra)
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
Definition: draw_common.c:279
struct DRW_Global G_draw
Definition: draw_common.c:32
bool DRW_state_show_text(void)
const DRWContextState * DRW_context_state_get(void)
struct DRWTextStore * DRW_text_cache_ensure(void)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
void DRW_shgroup_call_procedural_lines(DRWShadingGroup *shgroup, Object *ob, uint line_count)
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_call_procedural_points(DRWShadingGroup *shgroup, Object *ob, uint point_count)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_draw_pass(DRWPass *pass)
void DRW_text_cache_add(DRWTextStore *dt, const float co[3], const char *str, const int str_len, short xoffs, short yoffs, short flag, const uchar col[4])
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_TEXT_CACHE_STRING_PTR
const int state
ccl_gpu_kernel_postfix ccl_global float int int int int sh
void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata)
void OVERLAY_gpencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void overlay_gpencil_draw_stroke_color_name(bGPDlayer *UNUSED(gpl), bGPDframe *UNUSED(gpf), bGPDstroke *gps, void *thunk)
static void OVERLAY_edit_gpencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_gpencil_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_gpencil_draw(OVERLAY_Data *vedata)
void OVERLAY_gpencil_draw(OVERLAY_Data *vedata)
static void OVERLAY_gpencil_color_names(Object *ob)
GPUShader * OVERLAY_shader_edit_curve_handle(void)
GPUShader * OVERLAY_shader_edit_gpencil_guide_point(void)
GPUShader * OVERLAY_shader_edit_gpencil_point(void)
GPUShader * OVERLAY_shader_edit_gpencil_wire(void)
GPUShader * OVERLAY_shader_edit_curve_point(void)
GPUShader * OVERLAY_shader_gpencil_canvas(void)
struct Object * obact
Definition: DRW_render.h:983
struct Scene * scene
Definition: DRW_render.h:979
struct Depsgraph * depsgraph
Definition: DRW_render.h:987
struct ViewLayer * view_layer
Definition: DRW_render.h:980
eObjectMode object_mode
Definition: DRW_render.h:991
struct View3D * v3d
Definition: DRW_render.h:976
GlobalsUboStorage block
Definition: draw_common.h:127
struct GPUUniformBuf * block_ubo
Definition: draw_common.h:129
struct GPUTexture * weight_ramp
Definition: draw_common.h:132
char name[66]
Definition: DNA_ID.h:378
struct MaterialGPencilStyle * gp_style
OVERLAY_PassList * psl
OVERLAY_StorageList * stl
DRWPass * edit_gpencil_ps
DRWPass * edit_gpencil_gizmos_ps
DRWPass * gpencil_canvas_ps
DRWPass * edit_gpencil_curve_ps
DRWShadingGroup * edit_gpencil_points_grp
DRWShadingGroup * edit_gpencil_wires_grp
DRWShadingGroup * edit_gpencil_curve_handle_grp
DRWShadingGroup * edit_gpencil_curve_points_grp
struct OVERLAY_PrivateData::@250 edit_curve
struct OVERLAY_PrivateData * pd
short base_flag
float obmat[4][4]
void * data
struct ToolSettings * toolsettings
View3DCursor cursor
float gpencil_grid_opacity
float vertex_opacity
View3DOverlay overlay
char gizmo_flag
short gp_flag
float layer_mat[4][4]
bGPDspoint * points
bGPDcontrolpoint * cp_points
float line_color[4]
bGPgrid grid
bGPdata_Runtime runtime
float scale[2]
float color[3]
float offset[2]