Blender V4.3
sculpt_automask.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8#pragma once
9
10#include <memory>
11
12#include "BLI_array.hh"
13#include "BLI_bit_vector.hh"
14#include "BLI_offset_indices.hh"
15#include "BLI_set.hh"
16#include "BLI_sys_types.h"
17
18#include "DNA_brush_enums.h"
19
20struct BMVert;
21struct Brush;
22struct CurveMapping;
23struct Depsgraph;
24struct Object;
25struct Sculpt;
26struct SculptSession;
27namespace blender::bke::pbvh {
28struct MeshNode;
29struct GridsNode;
30struct BMeshNode;
31} // namespace blender::bke::pbvh
32
34
50
83
88const Cache *active_cache_get(const SculptSession &ss);
89
96std::unique_ptr<Cache> cache_init(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob);
97std::unique_ptr<Cache> cache_init(const Depsgraph &depsgraph,
98 const Sculpt &sd,
99 const Brush *brush,
100 Object &ob);
101
102bool mode_enabled(const Sculpt &sd, const Brush *br, eAutomasking_flag mode);
103bool is_enabled(const Sculpt &sd, const Object &object, const Brush *br);
104
105bool needs_normal(const SculptSession &ss, const Sculpt &sd, const Brush *brush);
106
107bool brush_type_can_reuse_automask(int sculpt_brush_type);
108
112void calc_vert_factors(const Depsgraph &depsgraph,
113 const Object &object,
114 const Cache &cache,
115 const bke::pbvh::MeshNode &node,
117 MutableSpan<float> factors);
118inline void calc_vert_factors(const Depsgraph &depsgraph,
119 const Object &object,
120 const Cache *cache,
121 const bke::pbvh::MeshNode &node,
123 MutableSpan<float> factors)
124{
125 if (cache) {
126 calc_vert_factors(depsgraph, object, *cache, node, verts, factors);
127 }
128}
129void calc_grids_factors(const Depsgraph &depsgraph,
130 const Object &object,
131 const Cache &cache,
132 const bke::pbvh::GridsNode &node,
133 Span<int> grids,
134 MutableSpan<float> factors);
135inline void calc_grids_factors(const Depsgraph &depsgraph,
136 const Object &object,
137 const Cache *cache,
138 const bke::pbvh::GridsNode &node,
139 Span<int> grids,
140 MutableSpan<float> factors)
141{
142 if (cache) {
143 calc_grids_factors(depsgraph, object, *cache, node, grids, factors);
144 }
145}
146void calc_vert_factors(const Depsgraph &depsgraph,
147 const Object &object,
148 const Cache &cache,
149 const bke::pbvh::BMeshNode &node,
150 const Set<BMVert *, 0> &verts,
151 MutableSpan<float> factors);
152inline void calc_vert_factors(const Depsgraph &depsgraph,
153 const Object &object,
154 const Cache *cache,
155 const bke::pbvh::BMeshNode &node,
156 const Set<BMVert *, 0> &verts,
157 MutableSpan<float> factors)
158{
159 if (cache) {
160 calc_vert_factors(depsgraph, object, *cache, node, verts, factors);
161 }
162}
163
167void calc_face_factors(const Depsgraph &depsgraph,
168 const Object &object,
169 OffsetIndices<int> faces,
170 Span<int> corner_verts,
171 const Cache &cache,
172 const bke::pbvh::MeshNode &node,
173 Span<int> face_indices,
174 MutableSpan<float> factors);
175
176} // namespace blender::ed::sculpt_paint::auto_mask
unsigned char uchar
eAutomasking_flag
const Depsgraph * depsgraph
static float verts[][3]
void calc_grids_factors(const Depsgraph &depsgraph, const Object &object, const Cache &cache, const bke::pbvh::GridsNode &node, Span< int > grids, MutableSpan< float > factors)
bool needs_normal(const SculptSession &ss, const Sculpt &sd, const Brush *brush)
std::unique_ptr< Cache > cache_init(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob)
bool brush_type_can_reuse_automask(int sculpt_brush_type)
const Cache * active_cache_get(const SculptSession &ss)
void calc_face_factors(const Depsgraph &depsgraph, const Object &object, OffsetIndices< int > faces, Span< int > corner_verts, const Cache &cache, const bke::pbvh::MeshNode &node, Span< int > face_indices, MutableSpan< float > factors)
bool is_enabled(const Sculpt &sd, const Object &object, const Brush *br)
bool mode_enabled(const Sculpt &sd, const Brush *br, eAutomasking_flag mode)
void calc_vert_factors(const Depsgraph &depsgraph, const Object &object, const Cache &cache, const bke::pbvh::MeshNode &node, Span< int > verts, MutableSpan< float > factors)
signed char int8_t
Definition stdint.h:75