Blender V5.3
BKE_paint_types.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BLI_enum_flags.hh"
9#include "BLI_utildefines.hh"
10#include "BLI_utility_mixins.hh"
11
12namespace blender {
13namespace gpu {
14class Texture;
15}
16
20
21namespace ocio {
22class ColorSpace;
23}
25enum class PaintMode : int8_t {
26 Sculpt = 0,
28 Vertex = 1,
29 Weight = 2,
35 /* Grease Pencil Vertex Paint */
41
43 /* TODO: Shift the ordering so that invalid is first so that zero-initialization makes sense. */
44 Invalid = 11,
45};
46
47namespace bke {
48namespace paint {
64
68 InvalidCurve = (1 << 3),
70 OverrideCursor = (1 << 4),
71 OverridePrimary = (1 << 5),
73 OverrideMask = OverrideCursor | OverridePrimary | OverrideSecondary,
74};
76
79 int winx = 0;
80 int winy = 0;
81 int old_size = 0;
82 float old_zoom = 0.0f;
83 bool old_col = false;
84
85 TexSnapshot() = default;
87};
88
91 int size = 0;
92 int zoom = 0;
93 int curve_preset = 0;
94
95 CursorSnapshot() = default;
97};
98}; // namespace paint
99
101 bool initialized = false;
105
106 float2 last_rake = float2(0.0f, 0.0f);
107 float last_rake_angle = 0.0f;
108
109 int last_stroke_valid = false;
110 float3 average_stroke_accum = float3(0.0f, 0.0f, 0.0f);
112
118 float brush_rotation = 0.0f;
119 float brush_rotation_sec = 0.0f;
120
121 /*******************************************************************************
122 * All data below are used to communicate with cursor drawing and tex sampling *
123 *******************************************************************************/
124
125 bool draw_anchored = false;
127
133 float overlap_factor = 0.0f;
135 bool stroke_active = false;
136
141 float3 last_location = float3(0.0f, 0.0f, 0.0f);
142 bool last_hit = false;
143
145
150 float pixel_radius = 0.0f;
152 float start_pixel_radius = 0.0f;
153
156
158 float2 tex_mouse = float2(0.0f, 0.0f);
159
162
165 const ocio::ColorSpace *colorspace = nullptr;
166
168 void *paint_cursor = nullptr;
169
171
172 std::unique_ptr<paint::TexSnapshot> primary_snap;
173 std::unique_ptr<paint::TexSnapshot> secondary_snap;
174 std::unique_ptr<paint::CursorSnapshot> cursor_snap;
175
178};
179}; // namespace bke
180
181} // namespace blender
NonCopyable(const NonCopyable &other)=delete
NonMovable(NonMovable &&other)=delete
ENUM_OPERATORS(eOverlayControlFlags)
BMesh Iterators.
unsigned short uint16_t
Definition BKE_text.h:80
VecBase< float, 2 > float2
unsigned char uint8_t
Definition BKE_text.h:79
VecBase< float, 3 > float3
signed char int8_t
Definition BKE_text.h:76
@ Invalid
Definition types.hh:42
paint::AssetCategory asset_category
std::unique_ptr< paint::TexSnapshot > primary_snap
std::unique_ptr< paint::TexSnapshot > secondary_snap
paint::eOverlayControlFlags overlay_flags
std::unique_ptr< paint::CursorSnapshot > cursor_snap
AssetWeakReference * previous_active_brush_reference