Blender  V2.93
overlay_engine.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 2019, Blender Foundation.
17  */
18 
25 #include "DRW_engine.h"
26 #include "DRW_render.h"
27 
28 #include "DEG_depsgraph_query.h"
29 
30 #include "ED_view3d.h"
31 
32 #include "UI_interface.h"
33 
34 #include "BKE_object.h"
35 #include "BKE_paint.h"
36 
37 #include "DNA_space_types.h"
38 
39 #include "overlay_engine.h"
40 #include "overlay_private.h"
41 
42 /* -------------------------------------------------------------------- */
46 static void OVERLAY_engine_init(void *vedata)
47 {
48  OVERLAY_Data *data = vedata;
49  OVERLAY_StorageList *stl = data->stl;
50  const DRWContextState *draw_ctx = DRW_context_state_get();
51  const RegionView3D *rv3d = draw_ctx->rv3d;
52  const View3D *v3d = draw_ctx->v3d;
53  const Scene *scene = draw_ctx->scene;
54  const ToolSettings *ts = scene->toolsettings;
55 
57 
58  if (!stl->pd) {
59  /* Alloc transient pointers */
60  stl->pd = MEM_callocN(sizeof(*stl->pd), __func__);
61  }
62 
63  OVERLAY_PrivateData *pd = stl->pd;
64  pd->space_type = v3d != NULL ? SPACE_VIEW3D : draw_ctx->space_data->spacetype;
65 
66  if (pd->space_type == SPACE_IMAGE) {
67  const SpaceImage *sima = (SpaceImage *)draw_ctx->space_data;
69  pd->clipping_state = 0;
72  return;
73  }
74  if (pd->space_type == SPACE_NODE) {
75  pd->hide_overlays = true;
76  pd->clipping_state = 0;
77  return;
78  }
79 
80  pd->hide_overlays = (v3d->flag2 & V3D_HIDE_OVERLAYS) != 0;
82  draw_ctx->object_edit, draw_ctx->obact, draw_ctx->object_mode);
83 
84  if (!pd->hide_overlays) {
85  pd->overlay = v3d->overlay;
86  pd->v3d_flag = v3d->flag;
87  pd->v3d_gridflag = v3d->gridflag;
88  }
89  else {
90  memset(&pd->overlay, 0, sizeof(pd->overlay));
91  pd->v3d_flag = 0;
92  pd->v3d_gridflag = 0;
98  }
99 
100  if (v3d->shading.type == OB_WIRE) {
102  }
103 
104  if (ts->sculpt) {
105  if (ts->sculpt->flags & SCULPT_HIDE_FACE_SETS) {
107  }
108  if (ts->sculpt->flags & SCULPT_HIDE_MASK) {
110  }
111  }
112 
113  pd->use_in_front = (v3d->shading.type <= OB_SOLID) ||
115  pd->wireframe_mode = (v3d->shading.type == OB_WIRE);
117  pd->xray_opacity = XRAY_ALPHA(v3d);
118  pd->xray_enabled = XRAY_ACTIVE(v3d);
120  pd->clear_in_front = (v3d->shading.type != OB_SOLID);
121  pd->cfra = DEG_get_ctime(draw_ctx->depsgraph);
122 
124 
125  switch (stl->pd->ctx_mode) {
126  case CTX_MODE_EDIT_MESH:
127  OVERLAY_edit_mesh_init(vedata);
128  break;
129  default:
130  /* Nothing to do. */
131  break;
132  }
133  OVERLAY_facing_init(vedata);
134  OVERLAY_grid_init(vedata);
135  OVERLAY_image_init(vedata);
136  OVERLAY_outline_init(vedata);
137  OVERLAY_wireframe_init(vedata);
138  OVERLAY_paint_init(vedata);
139 }
140 
141 static void OVERLAY_cache_init(void *vedata)
142 {
143  OVERLAY_Data *data = vedata;
144  OVERLAY_StorageList *stl = data->stl;
145  OVERLAY_PrivateData *pd = stl->pd;
146 
147  if (pd->space_type == SPACE_IMAGE) {
149  OVERLAY_grid_cache_init(vedata);
151  return;
152  }
153  if (pd->space_type == SPACE_NODE) {
155  return;
156  }
157 
158  switch (pd->ctx_mode) {
159  case CTX_MODE_EDIT_MESH:
161  /* `pd->edit_mesh.flag` is valid after calling `OVERLAY_edit_mesh_cache_init`. */
162  const bool draw_edit_weights = (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT);
163  if (draw_edit_weights) {
164  OVERLAY_paint_cache_init(vedata);
165  }
166  break;
168  case CTX_MODE_EDIT_CURVE:
170  break;
171  case CTX_MODE_EDIT_TEXT:
173  break;
175  break;
177  break;
180  break;
181  case CTX_MODE_PARTICLE:
183  break;
184  case CTX_MODE_POSE:
188  OVERLAY_paint_cache_init(vedata);
189  break;
190  case CTX_MODE_SCULPT:
192  break;
199  break;
200  case CTX_MODE_OBJECT:
201  break;
202  default:
203  BLI_assert(!"Draw mode invalid");
204  break;
205  }
209  OVERLAY_fade_cache_init(vedata);
210  OVERLAY_extra_cache_init(vedata);
213  OVERLAY_grid_cache_init(vedata);
214  OVERLAY_image_cache_init(vedata);
221 }
222 
223 BLI_INLINE OVERLAY_DupliData *OVERLAY_duplidata_get(Object *ob, void *vedata, bool *do_init)
224 {
225  OVERLAY_DupliData **dupli_data = (OVERLAY_DupliData **)DRW_duplidata_get(vedata);
226  *do_init = false;
228  return NULL;
229  }
230 
231  if (dupli_data) {
232  if (*dupli_data == NULL) {
233  *dupli_data = MEM_callocN(sizeof(OVERLAY_DupliData), __func__);
234  *do_init = true;
235  }
236  else if ((*dupli_data)->base_flag != ob->base_flag) {
237  /* Select state might have change, reinit. */
238  *do_init = true;
239  }
240  return *dupli_data;
241  }
242  return NULL;
243 }
244 
245 static bool overlay_object_is_edit_mode(const OVERLAY_PrivateData *pd, const Object *ob)
246 {
247  if (DRW_object_is_in_edit_mode(ob)) {
248  /* Also check for context mode as the object mode is not 100% reliable. (see T72490) */
249  switch (ob->type) {
250  case OB_MESH:
251  return pd->ctx_mode == CTX_MODE_EDIT_MESH;
252  case OB_ARMATURE:
253  return pd->ctx_mode == CTX_MODE_EDIT_ARMATURE;
254  case OB_CURVE:
255  return pd->ctx_mode == CTX_MODE_EDIT_CURVE;
256  case OB_SURF:
257  return pd->ctx_mode == CTX_MODE_EDIT_SURFACE;
258  case OB_LATTICE:
259  return pd->ctx_mode == CTX_MODE_EDIT_LATTICE;
260  case OB_MBALL:
261  return pd->ctx_mode == CTX_MODE_EDIT_METABALL;
262  case OB_FONT:
263  return pd->ctx_mode == CTX_MODE_EDIT_TEXT;
264  case OB_HAIR:
265  case OB_POINTCLOUD:
266  case OB_VOLUME:
267  /* No edit mode yet. */
268  return false;
269  }
270  }
271  return false;
272 }
273 
274 static bool overlay_should_fade_object(Object *ob, Object *active_object)
275 {
276  if (!active_object || !ob) {
277  return false;
278  }
279 
280  if (ELEM(active_object->mode, OB_MODE_OBJECT, OB_MODE_POSE)) {
281  return false;
282  }
283 
284  if ((active_object->mode & ob->mode) != 0) {
285  return false;
286  }
287 
288  return true;
289 }
290 
291 static void OVERLAY_cache_populate(void *vedata, Object *ob)
292 {
293  OVERLAY_Data *data = vedata;
294  OVERLAY_PrivateData *pd = data->stl->pd;
295 
296  if (pd->space_type == SPACE_IMAGE) {
297  return;
298  }
299 
300  const DRWContextState *draw_ctx = DRW_context_state_get();
301  const bool is_select = DRW_state_is_select();
302  const bool renderable = DRW_object_is_renderable(ob);
303  const bool in_pose_mode = ob->type == OB_ARMATURE && OVERLAY_armature_is_pose_mode(ob, draw_ctx);
304  const bool in_edit_mode = overlay_object_is_edit_mode(pd, ob);
305  const bool in_particle_edit_mode = (ob->mode == OB_MODE_PARTICLE_EDIT) &&
306  (pd->ctx_mode == CTX_MODE_PARTICLE);
307  const bool in_paint_mode = (ob == draw_ctx->obact) &&
308  (draw_ctx->object_mode & OB_MODE_ALL_PAINT);
309  const bool in_sculpt_mode = (ob == draw_ctx->obact) && (ob->sculpt != NULL) &&
310  (ob->sculpt->mode_type == OB_MODE_SCULPT);
311  const bool has_surface = ELEM(ob->type,
312  OB_MESH,
313  OB_CURVE,
314  OB_SURF,
315  OB_MBALL,
316  OB_FONT,
317  OB_GPENCIL,
318  OB_HAIR,
320  OB_VOLUME);
321  const bool draw_surface = (ob->dt >= OB_WIRE) && (renderable || (ob->dt == OB_WIRE));
322  const bool draw_facing = draw_surface && (pd->overlay.flag & V3D_OVERLAY_FACE_ORIENTATION) &&
323  !is_select;
324  const bool draw_fade = draw_surface && (pd->overlay.flag & V3D_OVERLAY_FADE_INACTIVE) &&
325  overlay_should_fade_object(ob, draw_ctx->obact);
326  const bool draw_bones = (pd->overlay.flag & V3D_OVERLAY_HIDE_BONES) == 0;
327  const bool draw_wires = draw_surface && has_surface &&
328  (pd->wireframe_mode || !pd->hide_overlays);
329  const bool draw_outlines = !in_edit_mode && !in_paint_mode && renderable && has_surface &&
330  (pd->v3d_flag & V3D_SELECT_OUTLINE) &&
331  (ob->base_flag & BASE_SELECTED);
332  const bool draw_bone_selection = (ob->type == OB_MESH) && pd->armature.do_pose_fade_geom &&
333  !is_select;
334  const bool draw_edit_weights = in_edit_mode && (pd->edit_mesh.flag & V3D_OVERLAY_EDIT_WEIGHT);
335  const bool draw_extras =
336  (!pd->hide_overlays) &&
337  (((pd->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_XTRAS) == 0) ||
338  /* Show if this is the camera we're looking through since it's useful for selecting. */
339  ((draw_ctx->rv3d->persp == RV3D_CAMOB) && ((ID *)draw_ctx->v3d->camera == ob->id.orig_id)));
340 
341  const bool draw_motion_paths = (pd->overlay.flag & V3D_OVERLAY_HIDE_MOTION_PATHS) == 0;
342 
343  bool do_init;
344  OVERLAY_DupliData *dupli = OVERLAY_duplidata_get(ob, vedata, &do_init);
345 
346  if (draw_fade) {
347  OVERLAY_fade_cache_populate(vedata, ob);
348  }
349  if (draw_facing) {
350  OVERLAY_facing_cache_populate(vedata, ob);
351  }
352  if (draw_wires) {
353  OVERLAY_wireframe_cache_populate(vedata, ob, dupli, do_init);
354  }
355  if (draw_outlines) {
356  OVERLAY_outline_cache_populate(vedata, ob, dupli, do_init);
357  }
358  if (draw_bone_selection) {
359  OVERLAY_pose_cache_populate(vedata, ob);
360  }
361 
362  if (ob->type == OB_VOLUME) {
363  OVERLAY_volume_cache_populate(vedata, ob);
364  }
365 
366  if (in_edit_mode && !pd->hide_overlays) {
367  switch (ob->type) {
368  case OB_MESH:
370  if (draw_edit_weights) {
372  }
373  break;
374  case OB_ARMATURE:
375  if (draw_bones) {
377  }
378  break;
379  case OB_CURVE:
381  break;
382  case OB_SURF:
384  break;
385  case OB_LATTICE:
387  break;
388  case OB_MBALL:
390  break;
391  case OB_FONT:
393  break;
394  }
395  }
396  else if (in_pose_mode && draw_bones) {
398  }
399  else if (in_paint_mode && !pd->hide_overlays) {
400  switch (draw_ctx->object_mode) {
403  break;
406  break;
409  break;
410  default:
411  break;
412  }
413  }
414  else if (in_particle_edit_mode) {
416  }
417 
418  if (in_sculpt_mode) {
419  OVERLAY_sculpt_cache_populate(vedata, ob);
420  }
421 
422  if (draw_motion_paths) {
424  }
425 
426  if (!pd->hide_overlays) {
427  switch (ob->type) {
428  case OB_ARMATURE:
429  if (draw_bones && (is_select || (!in_edit_mode && !in_pose_mode))) {
431  }
432  break;
433  case OB_MBALL:
434  if (!in_edit_mode) {
436  }
437  break;
438  case OB_GPENCIL:
439  OVERLAY_gpencil_cache_populate(vedata, ob);
440  break;
441  }
442  }
443  /* Non-Meshes */
444  if (draw_extras) {
445  switch (ob->type) {
446  case OB_EMPTY:
447  OVERLAY_empty_cache_populate(vedata, ob);
448  break;
449  case OB_LAMP:
450  OVERLAY_light_cache_populate(vedata, ob);
451  break;
452  case OB_CAMERA:
453  OVERLAY_camera_cache_populate(vedata, ob);
454  break;
455  case OB_SPEAKER:
456  OVERLAY_speaker_cache_populate(vedata, ob);
457  break;
458  case OB_LIGHTPROBE:
460  break;
461  case OB_LATTICE:
462  OVERLAY_lattice_cache_populate(vedata, ob);
463  break;
464  }
465  }
466 
469  }
470 
471  /* Relationship, object center, bounbox ... */
472  if (!pd->hide_overlays) {
473  OVERLAY_extra_cache_populate(vedata, ob);
474  }
475 
476  if (dupli) {
477  dupli->base_flag = ob->base_flag;
478  }
479 }
480 
481 static void OVERLAY_cache_finish(void *vedata)
482 {
483  OVERLAY_Data *data = vedata;
484  OVERLAY_PrivateData *pd = data->stl->pd;
485 
486  if (ELEM(pd->space_type, SPACE_IMAGE)) {
488  return;
489  }
490  if (ELEM(pd->space_type, SPACE_NODE)) {
491  return;
492  }
493 
494  /* TODO(fclem): Only do this when really needed. */
495  {
496  /* HACK we allocate the in front depth here to avoid the overhead when if is not needed. */
499 
501 
502  GPU_framebuffer_ensure_config(
503  &dfbl->in_front_fb,
504  {GPU_ATTACHMENT_TEXTURE(dtxl->depth_in_front), GPU_ATTACHMENT_TEXTURE(dtxl->color)});
505  }
506 
510 }
511 
512 static void OVERLAY_draw_scene(void *vedata)
513 {
514  OVERLAY_Data *data = vedata;
515  OVERLAY_PrivateData *pd = data->stl->pd;
516  OVERLAY_FramebufferList *fbl = data->fbl;
518 
519  /* Needs to be done first as it modifies the scene color and depth buffer. */
520  if (pd->space_type == SPACE_VIEW3D) {
522  }
523 
524  if (DRW_state_is_fbo()) {
526  /* Don't clear background for the node editor. The node editor draws the background and we
527  * need to mask out the image from the already drawn overlay color buffer. */
528  if (pd->space_type != SPACE_NODE) {
529  const float clear_col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
530  GPU_framebuffer_clear_color(dfbl->overlay_only_fb, clear_col);
531  }
532  }
533 
534  if (pd->space_type == SPACE_IMAGE) {
537  if (DRW_state_is_fbo()) {
539  }
541  return;
542  }
543  if (pd->space_type == SPACE_NODE) {
545  return;
546  }
547 
549  OVERLAY_background_draw(vedata);
550 
552 
554 
555  if (DRW_state_is_fbo()) {
557  }
558 
559  OVERLAY_outline_draw(vedata);
560  OVERLAY_xray_depth_copy(vedata);
561 
562  if (DRW_state_is_fbo()) {
564  }
565 
566  OVERLAY_image_draw(vedata);
567  OVERLAY_fade_draw(vedata);
568  OVERLAY_facing_draw(vedata);
569  OVERLAY_extra_blend_draw(vedata);
570  OVERLAY_volume_draw(vedata);
571 
572  if (pd->ctx_mode == CTX_MODE_SCULPT) {
573  /* Sculpt overlays are drawn here to avoid artifacts with wireframe opacity. */
574  OVERLAY_sculpt_draw(vedata);
575  }
576 
577  if (DRW_state_is_fbo()) {
579  }
580 
581  OVERLAY_wireframe_draw(vedata);
582  OVERLAY_armature_draw(vedata);
583  OVERLAY_particle_draw(vedata);
584  OVERLAY_metaball_draw(vedata);
585  OVERLAY_gpencil_draw(vedata);
586  OVERLAY_extra_draw(vedata);
587 
588  if (DRW_state_is_fbo()) {
590  }
591 
592  OVERLAY_xray_fade_draw(vedata);
593  OVERLAY_grid_draw(vedata);
594 
596 
597  if (pd->ctx_mode == CTX_MODE_PAINT_WEIGHT) {
598  /* Fix weird case where weightpaint mode needs to draw before xray bones. */
599  OVERLAY_paint_draw(vedata);
600  }
601 
602  if (DRW_state_is_fbo()) {
604  }
605 
608 
609  if (DRW_state_is_fbo()) {
611  }
612 
617 
618  if (DRW_state_is_fbo()) {
620  }
621 
623  OVERLAY_motion_path_draw(vedata);
625 
627  /* Edit modes have their own selection code. */
628  return;
629  }
630 
631  /* Functions after this point can change FBO freely. */
632 
633  switch (pd->ctx_mode) {
634  case CTX_MODE_EDIT_MESH:
635  OVERLAY_paint_draw(vedata);
636  OVERLAY_edit_mesh_draw(vedata);
637  break;
639  case CTX_MODE_EDIT_CURVE:
640  OVERLAY_edit_curve_draw(vedata);
641  break;
642  case CTX_MODE_EDIT_TEXT:
643  OVERLAY_edit_text_draw(vedata);
644  break;
647  break;
648  case CTX_MODE_POSE:
649  OVERLAY_paint_draw(vedata);
650  OVERLAY_pose_draw(vedata);
651  break;
654  OVERLAY_paint_draw(vedata);
655  break;
656  case CTX_MODE_PARTICLE:
658  break;
665  break;
666  default:
667  break;
668  }
669 
670  OVERLAY_antialiasing_end(vedata);
671 }
672 
673 static void OVERLAY_engine_free(void)
674 {
676 }
677 
680 /* -------------------------------------------------------------------- */
685 
687  NULL,
688  NULL,
689  N_("Overlay"),
697  NULL,
698  NULL,
699  NULL,
700  NULL,
701 };
702 
705 #undef SELECT_ENGINE
@ CTX_MODE_EDIT_GPENCIL
Definition: BKE_context.h:130
@ CTX_MODE_EDIT_CURVE
Definition: BKE_context.h:116
@ CTX_MODE_PAINT_TEXTURE
Definition: BKE_context.h:126
@ CTX_MODE_EDIT_SURFACE
Definition: BKE_context.h:117
@ CTX_MODE_WEIGHT_GPENCIL
Definition: BKE_context.h:132
@ CTX_MODE_PARTICLE
Definition: BKE_context.h:127
@ CTX_MODE_SCULPT
Definition: BKE_context.h:123
@ CTX_MODE_VERTEX_GPENCIL
Definition: BKE_context.h:133
@ CTX_MODE_OBJECT
Definition: BKE_context.h:128
@ CTX_MODE_EDIT_MESH
Definition: BKE_context.h:115
@ CTX_MODE_EDIT_TEXT
Definition: BKE_context.h:118
@ CTX_MODE_EDIT_ARMATURE
Definition: BKE_context.h:119
@ CTX_MODE_SCULPT_GPENCIL
Definition: BKE_context.h:131
@ CTX_MODE_EDIT_LATTICE
Definition: BKE_context.h:121
@ CTX_MODE_PAINT_GPENCIL
Definition: BKE_context.h:129
@ CTX_MODE_PAINT_VERTEX
Definition: BKE_context.h:125
@ CTX_MODE_EDIT_METABALL
Definition: BKE_context.h:120
@ CTX_MODE_PAINT_WEIGHT
Definition: BKE_context.h:124
@ CTX_MODE_POSE
Definition: BKE_context.h:122
enum eContextObjectMode CTX_data_mode_enum_ex(const struct Object *obedit, const struct Object *ob, const eObjectMode object_mode)
General operations, lookup, etc. for blender objects.
bool BKE_scene_uses_blender_workbench(const struct Scene *scene)
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define BLI_INLINE
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:124
#define ELEM(...)
#define N_(msgid)
float DEG_get_ctime(const Depsgraph *graph)
@ BASE_SELECTED
#define OB_MODE_ALL_PAINT
@ OB_WIRE
@ OB_SOLID
@ OB_MODE_PARTICLE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_SCULPT
@ OB_MODE_POSE
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_OBJECT
@ OB_MODE_VERTEX_PAINT
@ OB_SPEAKER
@ OB_LATTICE
@ OB_MBALL
@ OB_EMPTY
@ OB_SURF
@ OB_CAMERA
@ OB_FONT
@ OB_ARMATURE
@ OB_LAMP
@ OB_MESH
@ OB_POINTCLOUD
@ OB_HAIR
@ OB_VOLUME
@ OB_CURVE
@ OB_GPENCIL
@ OB_LIGHTPROBE
@ SCULPT_HIDE_MASK
@ SCULPT_HIDE_FACE_SETS
@ SI_OVERLAY_SHOW_OVERLAYS
@ SPACE_NODE
@ SPACE_IMAGE
@ SPACE_VIEW3D
@ V3D_OVERLAY_EDIT_WEIGHT
#define RV3D_CAMOB
#define V3D_SELECT_OUTLINE
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define V3D_HIDE_OVERLAYS
@ V3D_OVERLAY_FACE_ORIENTATION
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_BONES
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_WIREFRAMES
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_FADE_INACTIVE
@ V3D_OVERLAY_HIDE_TEXT
@ DRW_STATE_CLIP_PLANES
Definition: DRW_render.h:354
#define DRW_VIEWPORT_DATA_SIZE(ty)
Definition: DRW_render.h:97
#define XRAY_ACTIVE(v3d)
Definition: ED_view3d.h:711
#define XRAY_ALPHA(v3d)
Definition: ED_view3d.h:705
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
@ GPU_DEPTH24_STENCIL8
Definition: GPU_texture.h:121
Scene scene
void ** DRW_duplidata_get(void *vedata)
Definition: draw_manager.c:767
bool DRW_state_is_select(void)
bool DRW_state_is_depth(void)
bool DRW_object_is_in_edit_mode(const Object *ob)
Definition: draw_manager.c:204
DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
Definition: draw_manager.c:697
bool DRW_object_is_renderable(const Object *ob)
Definition: draw_manager.c:183
bool DRW_state_is_fbo(void)
const DRWContextState * DRW_context_state_get(void)
DefaultTextureList * DRW_viewport_texture_list_get(void)
Definition: draw_manager.c:702
void DRW_view_set_active(DRWView *view)
void DRW_texture_ensure_fullscreen_2d(GPUTexture **tex, eGPUTextureFormat format, DRWTextureFlag flags)
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void OVERLAY_antialiasing_cache_init(OVERLAY_Data *vedata)
void OVERLAY_antialiasing_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_antialiasing_init(OVERLAY_Data *vedata)
void OVERLAY_xray_depth_copy(OVERLAY_Data *vedata)
void OVERLAY_antialiasing_start(OVERLAY_Data *vedata)
void OVERLAY_xray_depth_infront_copy(OVERLAY_Data *vedata)
void OVERLAY_xray_fade_draw(OVERLAY_Data *vedata)
void OVERLAY_antialiasing_end(OVERLAY_Data *vedata)
void OVERLAY_armature_in_front_draw(OVERLAY_Data *vedata)
bool OVERLAY_armature_is_pose_mode(Object *ob, const DRWContextState *draw_ctx)
void OVERLAY_edit_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_armature_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_armature_cache_init(OVERLAY_Data *vedata)
void OVERLAY_pose_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_pose_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_armature_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_pose_draw(OVERLAY_Data *vedata)
void OVERLAY_armature_draw(OVERLAY_Data *vedata)
void OVERLAY_background_cache_init(OVERLAY_Data *vedata)
void OVERLAY_background_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_curve_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_curve_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_curve_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_surf_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_mesh_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_mesh_init(OVERLAY_Data *vedata)
void OVERLAY_edit_mesh_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_text_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_text_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_text_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_init(OVERLAY_Data *vedata)
static void OVERLAY_draw_scene(void *vedata)
BLI_INLINE OVERLAY_DupliData * OVERLAY_duplidata_get(Object *ob, void *vedata, bool *do_init)
static const DrawEngineDataSize overlay_data_size
static void OVERLAY_engine_free(void)
static void OVERLAY_cache_init(void *vedata)
static void OVERLAY_cache_populate(void *vedata, Object *ob)
static bool overlay_object_is_edit_mode(const OVERLAY_PrivateData *pd, const Object *ob)
DrawEngineType draw_engine_overlay_type
static void OVERLAY_engine_init(void *vedata)
static bool overlay_should_fade_object(Object *ob, Object *active_object)
static void OVERLAY_cache_finish(void *vedata)
void OVERLAY_extra_centers_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_in_front_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_cache_init(OVERLAY_Data *vedata)
Definition: overlay_extra.c:62
void OVERLAY_camera_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_light_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_lightprobe_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_extra_blend_draw(OVERLAY_Data *vedata)
void OVERLAY_extra_draw(OVERLAY_Data *vedata)
void OVERLAY_empty_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_speaker_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_facing_infront_draw(OVERLAY_Data *vedata)
void OVERLAY_facing_draw(OVERLAY_Data *vedata)
void OVERLAY_facing_init(OVERLAY_Data *UNUSED(vedata))
void OVERLAY_facing_cache_init(OVERLAY_Data *vedata)
void OVERLAY_facing_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_fade_cache_populate(OVERLAY_Data *vedata, Object *ob)
Definition: overlay_fade.c:63
void OVERLAY_fade_draw(OVERLAY_Data *vedata)
Definition: overlay_fade.c:87
void OVERLAY_fade_infront_draw(OVERLAY_Data *vedata)
Definition: overlay_fade.c:94
void OVERLAY_fade_cache_init(OVERLAY_Data *vedata)
Definition: overlay_fade.c:34
void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata)
void OVERLAY_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)
void OVERLAY_grid_draw(OVERLAY_Data *vedata)
Definition: overlay_grid.c:279
void OVERLAY_grid_cache_init(OVERLAY_Data *vedata)
Definition: overlay_grid.c:187
void OVERLAY_grid_init(OVERLAY_Data *vedata)
Definition: overlay_grid.c:51
void OVERLAY_image_cache_init(OVERLAY_Data *vedata)
Definition: overlay_image.c:52
void OVERLAY_image_background_draw(OVERLAY_Data *vedata)
void OVERLAY_image_in_front_draw(OVERLAY_Data *vedata)
void OVERLAY_image_scene_background_draw(OVERLAY_Data *vedata)
void OVERLAY_image_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_image_draw(OVERLAY_Data *vedata)
void OVERLAY_image_init(OVERLAY_Data *vedata)
Definition: overlay_image.c:43
void OVERLAY_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_lattice_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_lattice_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_lattice_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_metaball_in_front_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_metaball_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_metaball_draw(OVERLAY_Data *vedata)
void OVERLAY_metaball_cache_init(OVERLAY_Data *vedata)
void OVERLAY_motion_path_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_motion_path_draw(OVERLAY_Data *vedata)
void OVERLAY_motion_path_cache_init(OVERLAY_Data *vedata)
void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, Object *ob, OVERLAY_DupliData *dupli, bool init_dupli)
void OVERLAY_outline_draw(OVERLAY_Data *vedata)
void OVERLAY_outline_init(OVERLAY_Data *vedata)
void OVERLAY_outline_cache_init(OVERLAY_Data *vedata)
void OVERLAY_paint_texture_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_paint_init(OVERLAY_Data *vedata)
Definition: overlay_paint.c:61
void OVERLAY_paint_cache_init(OVERLAY_Data *vedata)
Definition: overlay_paint.c:73
void OVERLAY_paint_draw(OVERLAY_Data *vedata)
void OVERLAY_paint_weight_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_paint_vertex_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_particle_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_particle_cache_init(OVERLAY_Data *vedata)
void OVERLAY_particle_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata)
void OVERLAY_sculpt_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_shader_library_ensure(void)
void OVERLAY_shader_free(void)
void OVERLAY_sculpt_draw(OVERLAY_Data *vedata)
void OVERLAY_wireframe_draw(OVERLAY_Data *vedata)
void OVERLAY_volume_draw(OVERLAY_Data *vedata)
void OVERLAY_wireframe_in_front_draw(OVERLAY_Data *vedata)
void OVERLAY_volume_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_volume_cache_init(OVERLAY_Data *vedata)
void OVERLAY_sculpt_cache_init(OVERLAY_Data *vedata)
void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, Object *ob, OVERLAY_DupliData *dupli, bool init_dupli)
void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata)
void OVERLAY_wireframe_init(OVERLAY_Data *vedata)
struct Object * obact
Definition: DRW_render.h:749
struct Scene * scene
Definition: DRW_render.h:745
struct SpaceLink * space_data
Definition: DRW_render.h:743
struct Depsgraph * depsgraph
Definition: DRW_render.h:753
eObjectMode object_mode
Definition: DRW_render.h:757
struct View3D * v3d
Definition: DRW_render.h:742
struct Object * object_edit
Definition: DRW_render.h:769
struct RegionView3D * rv3d
Definition: DRW_render.h:741
struct GPUFrameBuffer * overlay_only_fb
struct GPUFrameBuffer * in_front_fb
struct GPUFrameBuffer * overlay_fb
struct GPUTexture * depth_in_front
Definition: DNA_ID.h:273
struct ID * orig_id
Definition: DNA_ID.h:324
struct GPUFrameBuffer * overlay_line_in_front_fb
struct GPUFrameBuffer * overlay_in_front_fb
struct GPUFrameBuffer * overlay_default_fb
struct GPUFrameBuffer * overlay_line_fb
struct GPUFrameBuffer * overlay_color_only_fb
View3DOverlay overlay
struct OVERLAY_PrivateData::@245 armature
enum eContextObjectMode ctx_mode
struct OVERLAY_PrivateData::@242 edit_mesh
struct OVERLAY_PrivateData * pd
ListBase particlesystem
short base_flag
struct SculptSession * sculpt
struct ToolSettings * toolsettings
eObjectMode mode_type
Definition: BKE_paint.h:600
SpaceImageOverlay overlay
float sculpt_mode_mask_opacity
float sculpt_mode_face_sets_opacity
View3DOverlay overlay
struct Object * camera
View3DShading shading