Blender
V5.3
source
blender
editors
sculpt_paint
paint_cursor.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2026 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#pragma once
10
11
#include "
DNA_brush_types.h
"
12
#include "
DNA_object_types.h
"
13
#include "
DNA_scene_types.h
"
14
#include "
DNA_screen_types.h
"
15
#include "
DNA_windowmanager_types.h
"
16
17
#include "
BKE_paint.hh
"
18
#include "
BKE_paint_types.hh
"
19
20
#include "
ED_view3d.hh
"
21
22
namespace
blender::ed::sculpt_paint
{
23
enum class
PaintCursorDrawingType
{
24
Curve
,
25
Cursor2D
,
26
Cursor3D
,
27
};
28
29
struct
PaintCursorContext
{
30
ARegion
*
region
=
nullptr
;
31
wmWindow
*
win
=
nullptr
;
32
wmWindowManager
*
wm
=
nullptr
;
33
bScreen
*
screen
=
nullptr
;
34
Depsgraph *
depsgraph
=
nullptr
;
35
Scene
*
scene
=
nullptr
;
36
Object
*
object
=
nullptr
;
37
Base
*
base
=
nullptr
;
38
UnifiedPaintSettings
*
ups
=
nullptr
;
39
Brush
*
brush
=
nullptr
;
40
Paint
*
paint
=
nullptr
;
41
PaintMode
mode
=
PaintMode::Invalid
;
42
ViewContext
vc
= {};
43
44
/* Sculpt related data. */
45
Sculpt
*
sd
=
nullptr
;
46
SculptSession
*
ss
=
nullptr
;
47
51
int
prev_active_vert_index
= -1;
52
54
bool
is_brush_active
=
false
;
55
bool
is_stroke_active
=
false
;
56
bool
is_cursor_over_mesh
=
false
;
57
float
radius
= 0.0f;
58
59
/* 3D view cursor position and normal. */
60
float3
location
=
float3
(0.0f);
61
float3
scene_space_location
=
float3
(0.0f);
62
float3
normal
=
float3
(0.0f);
63
64
/* Cursor main colors. */
65
float3
outline_col
=
float3
(0.0f);
66
float
outline_alpha
= 0.0f;
67
68
/* GPU attribute for drawing. */
69
uint
pos
= 0;
70
71
PaintCursorDrawingType
cursor_type
=
PaintCursorDrawingType::Cursor2D
;
72
73
/* This variable is set after drawing the overlay, not on initialization. It can't be used for
74
* checking if alpha overlay is enabled before drawing it. */
75
bool
alpha_overlay_drawn
=
false
;
76
77
float
zoomx
= 0.0f;
78
/* Coordinates in region space */
79
int2
mval
=
int2
(0);
80
81
/* TODO: Figure out why this and mval are used interchangeably */
82
float2
translation
=
float2
(0.0f);
83
84
float2
tilt
=
float2
(0.0f);
85
86
float
final_radius
= 0.0f;
87
int
pixel_radius
= 0;
88
};
89
90
void
grease_pencil_cursor_draw
(
PaintCursorContext
&pcontext);
91
92
void
mesh_cursor_update_and_init
(
PaintCursorContext
&pcontext);
93
void
mesh_cursor_active_draw
(
PaintCursorContext
&pcontext);
94
void
mesh_cursor_inactive_draw
(
PaintCursorContext
&pcontext);
95
}
// namespace blender::ed::sculpt_paint
BKE_paint.hh
BKE_paint_types.hh
DNA_brush_types.h
DNA_object_types.h
Object is a sort of wrapper for general info.
DNA_scene_types.h
DNA_screen_types.h
DNA_windowmanager_types.h
ED_view3d.hh
blender::ed::sculpt_paint
Definition
BKE_paint.hh:55
blender::ed::sculpt_paint::mesh_cursor_inactive_draw
void mesh_cursor_inactive_draw(PaintCursorContext &pcontext)
Definition
mesh/paint_cursor.cc:808
blender::ed::sculpt_paint::grease_pencil_cursor_draw
void grease_pencil_cursor_draw(PaintCursorContext &pcontext)
Definition
grease_pencil/paint_cursor.cc:77
blender::ed::sculpt_paint::mesh_cursor_active_draw
void mesh_cursor_active_draw(PaintCursorContext &pcontext)
Definition
mesh/paint_cursor.cc:248
blender::ed::sculpt_paint::PaintCursorDrawingType
PaintCursorDrawingType
Definition
paint_cursor.hh:23
blender::ed::sculpt_paint::PaintCursorDrawingType::Cursor3D
@ Cursor3D
Definition
paint_cursor.hh:26
blender::ed::sculpt_paint::PaintCursorDrawingType::Cursor2D
@ Cursor2D
Definition
paint_cursor.hh:25
blender::ed::sculpt_paint::mesh_cursor_update_and_init
void mesh_cursor_update_and_init(PaintCursorContext &pcontext)
Definition
mesh/paint_cursor.cc:150
blender::PaintMode
PaintMode
Definition
BKE_paint_types.hh:25
blender::PaintMode::Invalid
@ Invalid
Definition
BKE_paint_types.hh:44
blender::uint
unsigned int uint
Definition
BKE_text.h:55
blender::int2
VecBase< int32_t, 2 > int2
Definition
BLI_math_vector_types.hh:781
blender::float2
VecBase< float, 2 > float2
Definition
BLI_math_vector_types.hh:798
blender::float3
VecBase< float, 3 > float3
Definition
BLI_math_vector_types.hh:799
blender::ARegion
Definition
DNA_screen_types.h:811
blender::Base
Definition
DNA_layer_types.h:192
blender::Brush
Definition
DNA_brush_types.h:175
blender::Curve
Definition
DNA_curve_types.h:213
blender::Object
Definition
DNA_object_types.h:466
blender::Paint
Definition
DNA_scene_types.h:1229
blender::Scene
Definition
DNA_scene_types.h:2876
blender::SculptSession
Definition
BKE_paint.hh:366
blender::Sculpt
Definition
DNA_scene_types.h:1501
blender::UnifiedPaintSettings
Definition
DNA_scene_types.h:1104
blender::ViewContext
Definition
ED_view3d.hh:71
blender::bScreen
Definition
DNA_screen_types.h:95
blender::ed::sculpt_paint::PaintCursorContext
Definition
paint_cursor.hh:29
blender::ed::sculpt_paint::PaintCursorContext::scene_space_location
float3 scene_space_location
Definition
paint_cursor.hh:61
blender::ed::sculpt_paint::PaintCursorContext::mval
int2 mval
Definition
paint_cursor.hh:79
blender::ed::sculpt_paint::PaintCursorContext::zoomx
float zoomx
Definition
paint_cursor.hh:77
blender::ed::sculpt_paint::PaintCursorContext::ups
UnifiedPaintSettings * ups
Definition
paint_cursor.hh:38
blender::ed::sculpt_paint::PaintCursorContext::is_cursor_over_mesh
bool is_cursor_over_mesh
Definition
paint_cursor.hh:56
blender::ed::sculpt_paint::PaintCursorContext::sd
Sculpt * sd
Definition
paint_cursor.hh:45
blender::ed::sculpt_paint::PaintCursorContext::base
Base * base
Definition
paint_cursor.hh:37
blender::ed::sculpt_paint::PaintCursorContext::vc
ViewContext vc
Definition
paint_cursor.hh:42
blender::ed::sculpt_paint::PaintCursorContext::cursor_type
PaintCursorDrawingType cursor_type
Definition
paint_cursor.hh:71
blender::ed::sculpt_paint::PaintCursorContext::outline_col
float3 outline_col
Definition
paint_cursor.hh:65
blender::ed::sculpt_paint::PaintCursorContext::is_brush_active
bool is_brush_active
Definition
paint_cursor.hh:54
blender::ed::sculpt_paint::PaintCursorContext::location
float3 location
Definition
paint_cursor.hh:60
blender::ed::sculpt_paint::PaintCursorContext::translation
float2 translation
Definition
paint_cursor.hh:82
blender::ed::sculpt_paint::PaintCursorContext::paint
Paint * paint
Definition
paint_cursor.hh:40
blender::ed::sculpt_paint::PaintCursorContext::ss
SculptSession * ss
Definition
paint_cursor.hh:46
blender::ed::sculpt_paint::PaintCursorContext::wm
wmWindowManager * wm
Definition
paint_cursor.hh:32
blender::ed::sculpt_paint::PaintCursorContext::tilt
float2 tilt
Definition
paint_cursor.hh:84
blender::ed::sculpt_paint::PaintCursorContext::pixel_radius
int pixel_radius
Definition
paint_cursor.hh:87
blender::ed::sculpt_paint::PaintCursorContext::scene
Scene * scene
Definition
paint_cursor.hh:35
blender::ed::sculpt_paint::PaintCursorContext::prev_active_vert_index
int prev_active_vert_index
Definition
paint_cursor.hh:51
blender::ed::sculpt_paint::PaintCursorContext::outline_alpha
float outline_alpha
Definition
paint_cursor.hh:66
blender::ed::sculpt_paint::PaintCursorContext::depsgraph
Depsgraph * depsgraph
Definition
paint_cursor.hh:34
blender::ed::sculpt_paint::PaintCursorContext::screen
bScreen * screen
Definition
paint_cursor.hh:33
blender::ed::sculpt_paint::PaintCursorContext::normal
float3 normal
Definition
paint_cursor.hh:62
blender::ed::sculpt_paint::PaintCursorContext::alpha_overlay_drawn
bool alpha_overlay_drawn
Definition
paint_cursor.hh:75
blender::ed::sculpt_paint::PaintCursorContext::win
wmWindow * win
Definition
paint_cursor.hh:31
blender::ed::sculpt_paint::PaintCursorContext::mode
PaintMode mode
Definition
paint_cursor.hh:41
blender::ed::sculpt_paint::PaintCursorContext::region
ARegion * region
Definition
paint_cursor.hh:30
blender::ed::sculpt_paint::PaintCursorContext::pos
uint pos
Definition
paint_cursor.hh:69
blender::ed::sculpt_paint::PaintCursorContext::brush
Brush * brush
Definition
paint_cursor.hh:39
blender::ed::sculpt_paint::PaintCursorContext::is_stroke_active
bool is_stroke_active
Definition
paint_cursor.hh:55
blender::ed::sculpt_paint::PaintCursorContext::radius
float radius
Definition
paint_cursor.hh:57
blender::ed::sculpt_paint::PaintCursorContext::final_radius
float final_radius
Definition
paint_cursor.hh:86
blender::wmWindowManager
Definition
DNA_windowmanager_types.h:113
blender::wmWindow
Definition
DNA_windowmanager_types.h:167
Generated on
for Blender by
doxygen
1.18.0