Blender
V4.3
source
blender
draw
engines
overlay
overlay_next_instance.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#pragma once
10
11
#include "
overlay_next_private.hh
"
12
13
#include "
overlay_next_antialiasing.hh
"
14
#include "
overlay_next_armature.hh
"
15
#include "
overlay_next_attribute_viewer.hh
"
16
#include "
overlay_next_background.hh
"
17
#include "
overlay_next_bounds.hh
"
18
#include "
overlay_next_camera.hh
"
19
#include "
overlay_next_curve.hh
"
20
#include "
overlay_next_edit_text.hh
"
21
#include "
overlay_next_empty.hh
"
22
#include "
overlay_next_facing.hh
"
23
#include "
overlay_next_fade.hh
"
24
#include "
overlay_next_fluid.hh
"
25
#include "
overlay_next_force_field.hh
"
26
#include "
overlay_next_grease_pencil.hh
"
27
#include "
overlay_next_grid.hh
"
28
#include "
overlay_next_lattice.hh
"
29
#include "
overlay_next_light.hh
"
30
#include "
overlay_next_lightprobe.hh
"
31
#include "
overlay_next_mesh.hh
"
32
#include "
overlay_next_metaball.hh
"
33
#include "
overlay_next_mode_transfer.hh
"
34
#include "
overlay_next_motion_path.hh
"
35
#include "
overlay_next_origin.hh
"
36
#include "
overlay_next_outline.hh
"
37
#include "
overlay_next_paint.hh
"
38
#include "
overlay_next_particle.hh
"
39
#include "
overlay_next_prepass.hh
"
40
#include "
overlay_next_relation.hh
"
41
#include "
overlay_next_sculpt.hh
"
42
#include "
overlay_next_speaker.hh
"
43
#include "
overlay_next_wireframe.hh
"
44
#include "
overlay_next_xray_fade.hh
"
45
46
namespace
blender::draw::overlay
{
47
52
class
Instance
{
53
const
SelectionType
selection_type_;
54
const
bool
clipping_enabled_;
55
56
public
:
57
/* WORKAROUND: Legacy. Move to grid pass. */
58
GPUUniformBuf *
grid_ubo
=
nullptr
;
59
60
ShapeCache
shapes
;
61
63
Resources
resources
= {selection_type_,
64
overlay::ShaderModule::module_get
(selection_type_, clipping_enabled_)};
65
State
state
;
66
68
Background
background
;
69
Origins
origins
;
70
Outline
outline
;
71
MotionPath
motion_paths
;
72
73
struct
OverlayLayer
{
74
const
SelectionType
selection_type_
;
75
76
Armatures
armatures
= {
selection_type_
};
77
AttributeViewer
attribute_viewer
;
78
Bounds
bounds
= {
selection_type_
};
79
Cameras
cameras
= {
selection_type_
};
80
Curves
curves
;
81
EditText
edit_text
= {
selection_type_
};
82
Empties
empties
= {
selection_type_
};
83
Facing
facing
= {
selection_type_
};
84
Fade
fade
= {
selection_type_
};
85
Fluids
fluids
= {
selection_type_
};
86
ForceFields
force_fields
= {
selection_type_
};
87
GreasePencil
grease_pencil
;
88
Lattices
lattices
;
89
Lights
lights
= {
selection_type_
};
90
LightProbes
light_probes
= {
selection_type_
};
91
Meshes
meshes
;
92
MeshUVs
mesh_uvs
;
93
Metaballs
metaballs
= {
selection_type_
};
94
ModeTransfer
mode_transfer
;
95
Paints
paints
;
96
Particles
particles
;
97
Prepass
prepass
= {
selection_type_
};
98
Relations
relations
= {
selection_type_
};
99
Sculpts
sculpts
= {
selection_type_
};
100
Speakers
speakers
= {
selection_type_
};
101
Wireframe
wireframe
;
102
} regular{selection_type_}, infront{selection_type_};
103
104
Grid
grid
;
105
106
AntiAliasing
anti_aliasing
;
107
XrayFade
xray_fade
;
108
109
Instance
(
const
SelectionType
selection_type,
const
bool
clipping_enabled
)
110
: selection_type_(selection_type), clipping_enabled_(
clipping_enabled
){};
111
112
~Instance
()
113
{
114
DRW_UBO_FREE_SAFE
(
grid_ubo
);
115
}
116
117
void
init
();
118
void
begin_sync
();
119
void
object_sync
(
ObjectRef
&ob_ref,
Manager
&manager);
120
void
end_sync
();
121
void
draw(
Manager
&manager);
122
123
bool
clipping_enabled
()
const
124
{
125
return
clipping_enabled_;
126
}
127
128
private
:
129
bool
object_is_selected(
const
ObjectRef
&ob_ref);
130
bool
object_is_edit_mode(
const
Object
*
object
);
131
bool
object_is_paint_mode(
const
Object
*
object
);
132
bool
object_is_particle_edit_mode(
const
ObjectRef
&ob_ref);
133
/* Checks for both curve sculpt and regular sculpt mode. */
134
bool
object_is_sculpt_mode(
const
ObjectRef
&ob_ref);
135
/* Checks only for sculpt mode. */
136
bool
object_is_sculpt_mode(
const
Object
*
object
);
137
/* Any mode that requires to view the object without distraction. */
138
bool
object_is_edit_paint_mode(
const
ObjectRef
&ob_ref,
139
bool
in_edit_mode,
140
bool
in_paint_mode,
141
bool
in_sculpt_mode);
142
bool
object_is_in_front(
const
Object
*
object
,
const
State
&
state
);
143
bool
object_needs_prepass(
const
ObjectRef
&ob_ref,
bool
in_paint_mode);
144
145
/* Returns true if the object is rendered transparent by the render engine.
146
* Overlays should not rely on the correct depth being available (and do a depth pre-pass). */
147
bool
object_is_rendered_transparent(
const
Object
*
object
,
const
State
&
state
);
148
};
149
150
}
// namespace blender::draw::overlay
DRW_UBO_FREE_SAFE
#define DRW_UBO_FREE_SAFE(ubo)
Definition
DRW_render.hh:254
blender::draw::Manager
Definition
draw_manager.hh:48
blender::draw::overlay::AntiAliasing
Definition
overlay_next_antialiasing.hh:49
blender::draw::overlay::Armatures
Definition
overlay_next_armature.hh:25
blender::draw::overlay::AttributeViewer
Definition
overlay_next_attribute_viewer.hh:20
blender::draw::overlay::Background
Definition
overlay_next_background.hh:15
blender::draw::overlay::Cameras
Definition
overlay_next_camera.hh:71
blender::draw::overlay::Curves
Definition
overlay_next_curve.hh:24
blender::draw::overlay::EditText
Definition
overlay_next_edit_text.hh:18
blender::draw::overlay::Empties
Definition
overlay_next_empty.hh:16
blender::draw::overlay::Facing
Definition
overlay_next_facing.hh:17
blender::draw::overlay::Fade
Definition
overlay_next_fade.hh:18
blender::draw::overlay::Fluids
Definition
overlay_next_fluid.hh:20
blender::draw::overlay::ForceFields
Definition
overlay_next_force_field.hh:21
blender::draw::overlay::GreasePencil
Definition
overlay_next_grease_pencil.hh:24
blender::draw::overlay::Grid
Definition
overlay_next_grid.hh:24
blender::draw::overlay::Instance
Definition
overlay_next_instance.hh:52
blender::draw::overlay::Instance::begin_sync
void begin_sync()
Definition
overlay_next_instance.cc:107
blender::draw::overlay::Instance::resources
Resources resources
Definition
overlay_next_instance.hh:63
blender::draw::overlay::Instance::motion_paths
MotionPath motion_paths
Definition
overlay_next_instance.hh:71
blender::draw::overlay::Instance::~Instance
~Instance()
Definition
overlay_next_instance.hh:112
blender::draw::overlay::Instance::outline
Outline outline
Definition
overlay_next_instance.hh:70
blender::draw::overlay::Instance::state
State state
Definition
overlay_next_instance.hh:65
blender::draw::overlay::Instance::init
void init()
Definition
overlay_next_instance.cc:21
blender::draw::overlay::Instance::grid_ubo
GPUUniformBuf * grid_ubo
Definition
overlay_next_instance.hh:58
blender::draw::overlay::Instance::origins
Origins origins
Definition
overlay_next_instance.hh:69
blender::draw::overlay::Instance::clipping_enabled
bool clipping_enabled() const
Definition
overlay_next_instance.hh:123
blender::draw::overlay::Instance::xray_fade
XrayFade xray_fade
Definition
overlay_next_instance.hh:107
blender::draw::overlay::Instance::end_sync
void end_sync()
Definition
overlay_next_instance.cc:299
blender::draw::overlay::Instance::anti_aliasing
AntiAliasing anti_aliasing
Definition
overlay_next_instance.hh:106
blender::draw::overlay::Instance::object_sync
void object_sync(ObjectRef &ob_ref, Manager &manager)
Definition
overlay_next_instance.cc:159
blender::draw::overlay::Instance::grid
Grid grid
Definition
overlay_next_instance.hh:104
blender::draw::overlay::Instance::background
Background background
Definition
overlay_next_instance.hh:68
blender::draw::overlay::Instance::Instance
Instance(const SelectionType selection_type, const bool clipping_enabled)
Definition
overlay_next_instance.hh:109
blender::draw::overlay::Instance::shapes
ShapeCache shapes
Definition
overlay_next_instance.hh:60
blender::draw::overlay::Lattices
Definition
overlay_next_lattice.hh:19
blender::draw::overlay::LightProbes
Definition
overlay_next_lightprobe.hh:17
blender::draw::overlay::Lights
Definition
overlay_next_light.hh:15
blender::draw::overlay::MeshUVs
Definition
overlay_next_mesh.hh:449
blender::draw::overlay::Meshes
Definition
overlay_next_mesh.hh:36
blender::draw::overlay::Metaballs
Definition
overlay_next_metaball.hh:18
blender::draw::overlay::ModeTransfer
Definition
overlay_next_mode_transfer.hh:15
blender::draw::overlay::MotionPath
Definition
overlay_next_motion_path.hh:22
blender::draw::overlay::Origins
Definition
overlay_next_origin.hh:14
blender::draw::overlay::Outline
Definition
overlay_next_outline.hh:17
blender::draw::overlay::Paints
Definition
overlay_next_paint.hh:22
blender::draw::overlay::Particles
Definition
overlay_next_particle.hh:22
blender::draw::overlay::Prepass
Definition
overlay_next_prepass.hh:21
blender::draw::overlay::Relations
Definition
overlay_next_relation.hh:21
blender::draw::overlay::Sculpts
Definition
overlay_next_sculpt.hh:23
blender::draw::overlay::ShaderModule::module_get
static ShaderModule & module_get(SelectionType selection_type, bool clipping_enabled)
Definition
overlay_next_shader.cc:629
blender::draw::overlay::ShapeCache
Definition
overlay_next_private.hh:102
blender::draw::overlay::Speakers
Definition
overlay_next_speaker.hh:17
blender::draw::overlay::Wireframe
Definition
overlay_next_wireframe.hh:19
blender::draw::overlay::XrayFade
Definition
overlay_next_xray_fade.hh:21
blender::draw::overlay
Definition
overlay_next_antialiasing.hh:47
blender::draw::select::SelectionType
SelectionType
Definition
select_instance.hh:31
overlay_next_antialiasing.hh
overlay_next_armature.hh
overlay_next_attribute_viewer.hh
overlay_next_background.hh
overlay_next_bounds.hh
overlay_next_camera.hh
overlay_next_curve.hh
overlay_next_edit_text.hh
overlay_next_empty.hh
overlay_next_facing.hh
overlay_next_fade.hh
overlay_next_fluid.hh
overlay_next_force_field.hh
overlay_next_grease_pencil.hh
overlay_next_grid.hh
overlay_next_lattice.hh
overlay_next_light.hh
overlay_next_lightprobe.hh
overlay_next_mesh.hh
overlay_next_metaball.hh
overlay_next_mode_transfer.hh
overlay_next_motion_path.hh
overlay_next_origin.hh
overlay_next_outline.hh
overlay_next_paint.hh
overlay_next_particle.hh
overlay_next_prepass.hh
overlay_next_private.hh
overlay_next_relation.hh
overlay_next_sculpt.hh
overlay_next_speaker.hh
overlay_next_wireframe.hh
overlay_next_xray_fade.hh
Object
Definition
DNA_object_types.h:193
blender::Bounds
Definition
BLI_bounds_types.hh:13
blender::draw::ObjectRef
Definition
draw_handle.hh:52
blender::draw::overlay::Instance::OverlayLayer
Definition
overlay_next_instance.hh:73
blender::draw::overlay::Instance::OverlayLayer::fade
Fade fade
Definition
overlay_next_instance.hh:84
blender::draw::overlay::Instance::OverlayLayer::armatures
Armatures armatures
Definition
overlay_next_instance.hh:76
blender::draw::overlay::Instance::OverlayLayer::mesh_uvs
MeshUVs mesh_uvs
Definition
overlay_next_instance.hh:92
blender::draw::overlay::Instance::OverlayLayer::metaballs
Metaballs metaballs
Definition
overlay_next_instance.hh:93
blender::draw::overlay::Instance::OverlayLayer::mode_transfer
ModeTransfer mode_transfer
Definition
overlay_next_instance.hh:94
blender::draw::overlay::Instance::OverlayLayer::speakers
Speakers speakers
Definition
overlay_next_instance.hh:100
blender::draw::overlay::Instance::OverlayLayer::prepass
Prepass prepass
Definition
overlay_next_instance.hh:97
blender::draw::overlay::Instance::OverlayLayer::curves
Curves curves
Definition
overlay_next_instance.hh:80
blender::draw::overlay::Instance::OverlayLayer::empties
Empties empties
Definition
overlay_next_instance.hh:82
blender::draw::overlay::Instance::OverlayLayer::attribute_viewer
AttributeViewer attribute_viewer
Definition
overlay_next_instance.hh:77
blender::draw::overlay::Instance::OverlayLayer::selection_type_
const SelectionType selection_type_
Definition
overlay_next_instance.hh:74
blender::draw::overlay::Instance::OverlayLayer::relations
Relations relations
Definition
overlay_next_instance.hh:98
blender::draw::overlay::Instance::OverlayLayer::cameras
Cameras cameras
Definition
overlay_next_instance.hh:79
blender::draw::overlay::Instance::OverlayLayer::sculpts
Sculpts sculpts
Definition
overlay_next_instance.hh:99
blender::draw::overlay::Instance::OverlayLayer::lattices
Lattices lattices
Definition
overlay_next_instance.hh:88
blender::draw::overlay::Instance::OverlayLayer::wireframe
Wireframe wireframe
Definition
overlay_next_instance.hh:101
blender::draw::overlay::Instance::OverlayLayer::particles
Particles particles
Definition
overlay_next_instance.hh:96
blender::draw::overlay::Instance::OverlayLayer::facing
Facing facing
Definition
overlay_next_instance.hh:83
blender::draw::overlay::Instance::OverlayLayer::paints
Paints paints
Definition
overlay_next_instance.hh:95
blender::draw::overlay::Instance::OverlayLayer::light_probes
LightProbes light_probes
Definition
overlay_next_instance.hh:90
blender::draw::overlay::Instance::OverlayLayer::meshes
Meshes meshes
Definition
overlay_next_instance.hh:91
blender::draw::overlay::Instance::OverlayLayer::edit_text
EditText edit_text
Definition
overlay_next_instance.hh:81
blender::draw::overlay::Instance::OverlayLayer::force_fields
ForceFields force_fields
Definition
overlay_next_instance.hh:86
blender::draw::overlay::Instance::OverlayLayer::grease_pencil
GreasePencil grease_pencil
Definition
overlay_next_instance.hh:87
blender::draw::overlay::Instance::OverlayLayer::fluids
Fluids fluids
Definition
overlay_next_instance.hh:85
blender::draw::overlay::Instance::OverlayLayer::bounds
Bounds bounds
Definition
overlay_next_instance.hh:78
blender::draw::overlay::Instance::OverlayLayer::lights
Lights lights
Definition
overlay_next_instance.hh:89
blender::draw::overlay::Resources
Definition
overlay_next_private.hh:325
blender::draw::overlay::State
Definition
overlay_next_private.hh:42
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0