Blender  V2.93
overlay_gpencil.c
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  * Copyright 2020, Blender Foundation.
17  */
18 
23 #include "DRW_render.h"
24 
25 #include "BKE_gpencil.h"
26 
27 #include "UI_resources.h"
28 
29 #include "DNA_gpencil_types.h"
30 
31 #include "DEG_depsgraph_query.h"
32 
33 #include "ED_view3d.h"
34 
35 #include "overlay_private.h"
36 
37 #include "draw_common.h"
38 #include "draw_manager_text.h"
39 
41 {
42  OVERLAY_PassList *psl = vedata->psl;
43  OVERLAY_PrivateData *pd = vedata->stl->pd;
44  struct GPUShader *sh;
45  DRWShadingGroup *grp;
46 
47  /* Default: Display nothing. */
50  psl->edit_gpencil_ps = NULL;
51 
55 
56  const DRWContextState *draw_ctx = DRW_context_state_get();
57  View3D *v3d = draw_ctx->v3d;
58  Object *ob = draw_ctx->obact;
59  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
60  Scene *scene = draw_ctx->scene;
62 
63  if (gpd == NULL || ob->type != OB_GPENCIL) {
64  return;
65  }
66 
67  /* For sculpt show only if mask mode, and only points if not stroke mode. */
68  const bool use_sculpt_mask = (GPENCIL_SCULPT_MODE(gpd) &&
69  GPENCIL_ANY_SCULPT_MASK(ts->gpencil_selectmode_sculpt));
70  const bool show_sculpt_points = (GPENCIL_SCULPT_MODE(gpd) &&
71  (ts->gpencil_selectmode_sculpt &
74 
75  /* For vertex paint show only if mask mode, and only points if not stroke mode. */
76  bool use_vertex_mask = (GPENCIL_VERTEX_MODE(gpd) &&
77  GPENCIL_ANY_VERTEX_MASK(ts->gpencil_selectmode_vertex));
78  const bool show_vertex_points = (GPENCIL_VERTEX_MODE(gpd) &&
79  (ts->gpencil_selectmode_vertex &
82 
83  /* If Sculpt or Vertex mode and the mask is disabled, the select must be hidden. */
84  const bool hide_select = ((GPENCIL_SCULPT_MODE(gpd) && !use_sculpt_mask) ||
85  (GPENCIL_VERTEX_MODE(gpd) && !use_vertex_mask));
86 
87  const bool do_multiedit = GPENCIL_MULTIEDIT_SESSIONS_ON(gpd);
88  const bool show_multi_edit_lines = (do_multiedit) &&
90  V3D_GP_SHOW_EDIT_LINES)) != 0);
91 
92  const bool show_lines = (v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES) || show_multi_edit_lines;
93 
94  const bool hide_lines = !GPENCIL_EDIT_MODE(gpd) && !GPENCIL_WEIGHT_MODE(gpd) &&
95  !use_sculpt_mask && !use_vertex_mask && !show_lines;
96 
97  /* Special case when vertex paint and multiedit lines. */
98  if (do_multiedit && show_multi_edit_lines && GPENCIL_VERTEX_MODE(gpd)) {
99  use_vertex_mask = true;
100  }
101 
102  const bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
103 
104  /* Show Edit points if:
105  * Edit mode: Not in Stroke selection mode
106  * Sculpt mode: If use Mask and not Stroke mode
107  * Weight mode: Always
108  * Vertex mode: If use Mask and not Stroke mode
109  */
110  const bool show_points = show_sculpt_points || is_weight_paint || show_vertex_points ||
111  (GPENCIL_EDIT_MODE(gpd) &&
112  (ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE));
113 
114  if ((!GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)) &&
115  ((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) {
119 
120  if (show_lines && !hide_lines) {
123  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
124  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", show_multi_edit_lines);
125  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
126  DRW_shgroup_uniform_bool_copy(grp, "hideSelect", hide_select);
127  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
129  }
130 
131  if (show_points && !hide_select) {
134  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
135  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", do_multiedit);
136  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
137  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
139  }
140  }
141 
142  /* Handles and curve point for Curve Edit submode. */
146 
147  /* Edit lines. */
148  if (show_lines) {
151  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
152  DRW_shgroup_uniform_bool_copy(grp, "doMultiframe", show_multi_edit_lines);
153  DRW_shgroup_uniform_bool_copy(grp, "doWeightColor", is_weight_paint);
154  DRW_shgroup_uniform_bool_copy(grp, "hideSelect", hide_select);
155  DRW_shgroup_uniform_float_copy(grp, "gpEditOpacity", v3d->vertex_opacity);
157  }
158 
161  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
162  DRW_shgroup_uniform_bool_copy(grp, "showCurveHandles", pd->edit_curve.show_handles);
163  DRW_shgroup_uniform_int_copy(grp, "curveHandleDisplay", pd->edit_curve.handle_display);
165 
168  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
169  DRW_shgroup_uniform_bool_copy(grp, "showCurveHandles", pd->edit_curve.show_handles);
170  DRW_shgroup_uniform_int_copy(grp, "curveHandleDisplay", pd->edit_curve.handle_display);
171  }
172 
173  /* control points for primitives and speed guide */
174  const bool is_cppoint = (gpd->runtime.tot_cp_points > 0);
175  const bool is_speed_guide = (ts->gp_sculpt.guide.use_guide &&
176  (draw_ctx->object_mode == OB_MODE_PAINT_GPENCIL));
177  const bool is_show_gizmo = (((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) &&
178  ((v3d->gizmo_flag & V3D_GIZMO_HIDE_TOOL) == 0));
179 
180  if ((is_cppoint || is_speed_guide) && (is_show_gizmo)) {
183 
186 
187  if (gpd->runtime.cp_points != NULL) {
188  for (int i = 0; i < gpd->runtime.tot_cp_points; i++) {
189  bGPDcontrolpoint *cp = &gpd->runtime.cp_points[i];
190  grp = DRW_shgroup_create_sub(grp);
191  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", &cp->x);
192  DRW_shgroup_uniform_float_copy(grp, "pSize", cp->size * 0.8f * G_draw.block.sizePixel);
193  DRW_shgroup_uniform_vec4_copy(grp, "pColor", cp->color);
195  }
196  }
197 
198  if (ts->gp_sculpt.guide.use_guide) {
199  float color[4];
200  if (ts->gp_sculpt.guide.reference_point == GP_GUIDE_REF_CUSTOM) {
202  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.location);
203  }
204  else if (ts->gp_sculpt.guide.reference_point == GP_GUIDE_REF_OBJECT &&
205  ts->gp_sculpt.guide.reference_object != NULL) {
207  DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.reference_object->loc);
208  }
209  else {
212  }
213  DRW_shgroup_uniform_vec4_copy(grp, "pColor", color);
216  }
217  }
218 }
219 
221 {
222  OVERLAY_PassList *psl = vedata->psl;
223  OVERLAY_PrivateData *pd = vedata->stl->pd;
224  struct GPUShader *sh;
225  DRWShadingGroup *grp;
226 
227  /* Default: Display nothing. */
228  psl->gpencil_canvas_ps = NULL;
229 
230  const DRWContextState *draw_ctx = DRW_context_state_get();
231  View3D *v3d = draw_ctx->v3d;
232  Object *ob = draw_ctx->obact;
233  bGPdata *gpd = ob ? (bGPdata *)ob->data : NULL;
234  Scene *scene = draw_ctx->scene;
236  const View3DCursor *cursor = &scene->cursor;
237 
240 
241  if (gpd == NULL || ob->type != OB_GPENCIL) {
242  return;
243  }
244 
245  const bool show_overlays = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
246  const bool show_grid = (v3d->gp_flag & V3D_GP_SHOW_GRID) != 0 &&
247  ((ts->gpencil_v3d_align &
249  const bool grid_xray = (v3d->gp_flag & V3D_GP_SHOW_GRID_XRAY);
250 
251  if (show_grid && show_overlays) {
252  const char *grid_unit = NULL;
253  float mat[4][4];
254  float col_grid[4];
255  float size[2];
256 
257  /* set color */
258  copy_v3_v3(col_grid, gpd->grid.color);
259  col_grid[3] = max_ff(v3d->overlay.gpencil_grid_opacity, 0.01f);
260 
261  copy_m4_m4(mat, ob->obmat);
262 
263  /* Rotate and scale except align to cursor. */
265  if (gpl != NULL) {
266  if (ts->gp_sculpt.lock_axis != GP_LOCKAXIS_CURSOR) {
267  float matrot[3][3];
268  copy_m3_m4(matrot, gpl->layer_mat);
269  mul_m4_m4m3(mat, mat, matrot);
270  }
271  }
272 
273  float viewinv[4][4];
274  /* Set the grid in the selected axis */
275  switch (ts->gp_sculpt.lock_axis) {
276  case GP_LOCKAXIS_X:
277  swap_v4_v4(mat[0], mat[2]);
278  break;
279  case GP_LOCKAXIS_Y:
280  swap_v4_v4(mat[1], mat[2]);
281  break;
282  case GP_LOCKAXIS_Z:
283  /* Default. */
284  break;
285  case GP_LOCKAXIS_CURSOR:
286  loc_eul_size_to_mat4(mat, cursor->location, cursor->rotation_euler, (float[3]){1, 1, 1});
287  break;
288  case GP_LOCKAXIS_VIEW:
289  /* view aligned */
290  DRW_view_viewmat_get(NULL, viewinv, true);
291  copy_v3_v3(mat[0], viewinv[0]);
292  copy_v3_v3(mat[1], viewinv[1]);
293  break;
294  }
295 
296  /* Move the grid to the right location depending of the align type.
297  * This is required only for 3D Cursor or Origin. */
298  if (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) {
299  copy_v3_v3(mat[3], cursor->location);
300  }
301  else if (ts->gpencil_v3d_align & GP_PROJECT_VIEWSPACE) {
302  copy_v3_v3(mat[3], ob->obmat[3]);
303  }
304 
305  translate_m4(mat, gpd->grid.offset[0], gpd->grid.offset[1], 0.0f);
306  mul_v2_v2fl(size, gpd->grid.scale, 2.0f * ED_scene_grid_scale(scene, &grid_unit));
307  rescale_m4(mat, (float[3]){size[0], size[1], 0.0f});
308 
309  /* Apply layer loc transform, except cursor mode. */
310  if ((gpl != NULL) && (ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) {
311  add_v3_v3(mat[3], gpl->layer_mat[3]);
312  }
313 
314  const int gridlines = (gpd->grid.lines <= 0) ? 1 : gpd->grid.lines;
315  int line_ct = gridlines * 4 + 2;
316 
319 
321 
323  grp = DRW_shgroup_create(sh, psl->gpencil_canvas_ps);
324  DRW_shgroup_uniform_block(grp, "globalsBlock", G_draw.block_ubo);
325  DRW_shgroup_uniform_vec4_copy(grp, "color", col_grid);
326  DRW_shgroup_uniform_vec3_copy(grp, "xAxis", mat[0]);
327  DRW_shgroup_uniform_vec3_copy(grp, "yAxis", mat[1]);
328  DRW_shgroup_uniform_vec3_copy(grp, "origin", mat[3]);
329  DRW_shgroup_uniform_int_copy(grp, "halfLineCount", line_ct / 2);
331  }
332 }
333 
335 {
336  OVERLAY_PrivateData *pd = vedata->stl->pd;
337  bGPdata *gpd = (bGPdata *)ob->data;
338  const DRWContextState *draw_ctx = DRW_context_state_get();
339  View3D *v3d = draw_ctx->v3d;
340 
341  /* Overlay is only for active object. */
342  if (ob != draw_ctx->obact) {
343  return;
344  }
345 
346  if (pd->edit_gpencil_wires_grp) {
348  DRW_shgroup_uniform_vec4_copy(grp, "gpEditColor", gpd->line_color);
349 
350  struct GPUBatch *geom = DRW_cache_gpencil_edit_lines_get(ob, pd->cfra);
352  }
353 
354  if (pd->edit_gpencil_points_grp) {
355  const bool show_direction = (v3d->gp_flag & V3D_GP_SHOW_STROKE_DIRECTION) != 0;
356 
358  DRW_shgroup_uniform_float_copy(grp, "doStrokeEndpoints", show_direction);
359 
360  struct GPUBatch *geom = DRW_cache_gpencil_edit_points_get(ob, pd->cfra);
361  DRW_shgroup_call_no_cull(grp, geom, ob);
362  }
363 
366  if (geom) {
368  }
369  }
370 
372  struct GPUBatch *geom = DRW_cache_gpencil_edit_curve_points_get(ob, pd->cfra);
373  if (geom) {
375  }
376  }
377 }
378 
380  bGPDframe *UNUSED(gpf),
381  bGPDstroke *gps,
382  void *thunk)
383 {
384  Object *ob = (Object *)thunk;
385  Material *ma = BKE_object_material_get(ob, gps->mat_nr + 1);
386  if (ma == NULL) {
387  return;
388  }
389  MaterialGPencilStyle *gp_style = ma->gp_style;
390  /* skip stroke if it doesn't have any valid data */
391  if ((gps->points == NULL) || (gps->totpoints < 1) || (gp_style == NULL)) {
392  return;
393  }
394  /* check if the color is visible */
395  if (gp_style->flag & GP_MATERIAL_HIDE) {
396  return;
397  }
398  /* only if selected */
399  if (gps->flag & GP_STROKE_SELECT) {
400  for (int i = 0; i < gps->totpoints; i++) {
401  bGPDspoint *pt = &gps->points[i];
402  /* Draw name at the first selected point. */
403  if (pt->flag & GP_SPOINT_SELECT) {
404  const DRWContextState *draw_ctx = DRW_context_state_get();
405  ViewLayer *view_layer = draw_ctx->view_layer;
406 
407  int theme_id = DRW_object_wire_theme_get(ob, view_layer, NULL);
408  uchar color[4];
409  UI_GetThemeColor4ubv(theme_id, color);
410 
411  float fpt[3];
412  mul_v3_m4v3(fpt, ob->obmat, &pt->x);
413 
414  struct DRWTextStore *dt = DRW_text_cache_ensure();
416  fpt,
417  ma->id.name + 2,
418  strlen(ma->id.name + 2),
419  10,
420  0,
422  color);
423  break;
424  }
425  }
426  }
427 }
428 
430 {
431  const DRWContextState *draw_ctx = DRW_context_state_get();
432  int cfra = DEG_get_ctime(draw_ctx->depsgraph);
433 
435  NULL, ob, NULL, overlay_gpencil_draw_stroke_color_name, ob, false, cfra);
436 }
437 
439 {
440  const DRWContextState *draw_ctx = DRW_context_state_get();
441  View3D *v3d = draw_ctx->v3d;
442 
443  bGPdata *gpd = (bGPdata *)ob->data;
444  if (gpd == NULL) {
445  return;
446  }
447 
448  if (GPENCIL_ANY_MODE(gpd)) {
450  }
451 
452  /* don't show object extras in set's */
453  if ((ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) == 0) {
454  if ((v3d->gp_flag & V3D_GP_SHOW_MATERIAL_NAME) && (ob->mode == OB_MODE_EDIT_GPENCIL) &&
457  }
458  }
459 }
460 
462 {
463  OVERLAY_PassList *psl = vedata->psl;
464 
465  if (psl->gpencil_canvas_ps) {
467  }
468 }
469 
471 {
472  OVERLAY_PassList *psl = vedata->psl;
473 
474  if (psl->edit_gpencil_gizmos_ps) {
476  }
477 
478  if (psl->edit_gpencil_ps) {
480  }
481 
482  /* Curve edit handles. */
483  if (psl->edit_gpencil_curve_ps) {
485  }
486 }
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1650
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
struct Material * BKE_object_material_get(struct Object *ob, short act)
Definition: material.c:697
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:105
void mul_m4_m4m3(float R[4][4], const float A[4][4], const float B[3][3])
Definition: math_matrix.c:437
void translate_m4(float mat[4][4], float tx, float ty, float tz)
Definition: math_matrix.c:2325
void rescale_m4(float mat[4][4], const float scale[3])
Definition: math_matrix.c:2396
void copy_m4_m4(float m1[4][4], const float m2[4][4])
Definition: math_matrix.c:95
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
Definition: math_matrix.c:742
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:2653
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:86
#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
#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
@ V3D_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE
#define DRW_shgroup_call_no_cull(shgroup, geom, ob)
Definition: DRW_render.h:433
DRWState
Definition: DRW_render.h:312
@ DRW_STATE_BLEND_ALPHA
Definition: DRW_render.h:340
@ DRW_STATE_WRITE_DEPTH
Definition: DRW_render.h:314
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:315
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition: DRW_render.h:323
@ DRW_STATE_DEPTH_ALWAYS
Definition: DRW_render.h:321
#define DRW_PASS_CREATE(pass, state)
Definition: DRW_render.h:593
float ED_scene_grid_scale(const struct Scene *scene, const char **r_grid_unit)
GPUBatch
Definition: GPU_batch.h:93
struct GPUShader GPUShader
Definition: GPU_shader.h:33
@ TH_REDALERT
Definition: UI_resources.h:50
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:321
@ TH_GIZMO_SECONDARY
Definition: UI_resources.h:322
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1199
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
Definition: resources.c:1381
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:299
struct DRW_Global G_draw
Definition: draw_common.c:45
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_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
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
static ulong state[N]
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:749
struct Scene * scene
Definition: DRW_render.h:745
struct Depsgraph * depsgraph
Definition: DRW_render.h:753
struct ViewLayer * view_layer
Definition: DRW_render.h:746
eObjectMode object_mode
Definition: DRW_render.h:757
struct View3D * v3d
Definition: DRW_render.h:742
GlobalsUboStorage block
Definition: draw_common.h:208
struct GPUUniformBuf * block_ubo
Definition: draw_common.h:210
struct GPUTexture * weight_ramp
Definition: draw_common.h:213
char name[66]
Definition: DNA_ID.h:283
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
struct OVERLAY_PrivateData::@240 edit_curve
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 * 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]