Blender V5.0
paint_mask.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
9#pragma once
10
11#include "BLI_array.hh"
12#include "BLI_function_ref.hh"
13#include "BLI_index_mask_fwd.hh"
14#include "BLI_set.hh"
15
16struct BMesh;
17struct BMVert;
18struct CCGKey;
19struct Depsgraph;
20struct Object;
21struct SubdivCCG;
22struct wmOperatorType;
23namespace blender::bke::pbvh {
24class Node;
25}
26
28
29Array<float> duplicate_mask(const Object &object);
30void mix_new_masks(Span<float> new_masks, float factor, MutableSpan<float> masks);
31void mix_new_masks(Span<float> new_masks, Span<float> factors, MutableSpan<float> masks);
32void clamp_mask(MutableSpan<float> masks);
33void invert_mask(MutableSpan<float> masks);
34
35void gather_mask_grids(const SubdivCCG &subdiv_ccg, Span<int> grids, MutableSpan<float> r_mask);
36void gather_mask_bmesh(const BMesh &bm, const Set<BMVert *, 0> &verts, MutableSpan<float> r_mask);
37
38void scatter_mask_grids(Span<float> mask, SubdivCCG &subdiv_ccg, Span<int> grids);
39void scatter_mask_bmesh(Span<float> mask, const BMesh &bm, const Set<BMVert *, 0> &verts);
40
41void average_neighbor_mask_bmesh(int mask_offset,
42 const Set<BMVert *, 0> &verts,
43 MutableSpan<float> new_masks);
44
46void write_mask_mesh(const Depsgraph &depsgraph,
47 Object &object,
48 const IndexMask &node_mask,
49 FunctionRef<void(MutableSpan<float>, Span<int>)> write_fn);
50
55void update_mask_mesh(const Depsgraph &depsgraph,
56 Object &object,
57 const IndexMask &node_mask,
58 FunctionRef<void(MutableSpan<float>, Span<int>)> update_fn);
59
61bool mask_equals_array_grids(Span<float> masks,
62 const CCGKey &key,
63 Span<int> grids,
64 Span<float> values);
65bool mask_equals_array_bmesh(int mask_offset, const Set<BMVert *, 0> &verts, Span<float> values);
66
67void PAINT_OT_mask_flood_fill(wmOperatorType *ot);
68void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot);
69void PAINT_OT_mask_box_gesture(wmOperatorType *ot);
70void PAINT_OT_mask_line_gesture(wmOperatorType *ot);
71void PAINT_OT_mask_polyline_gesture(wmOperatorType *ot);
72} // namespace blender::ed::sculpt_paint::mask
struct Object Object
BMesh * bm
BPy_StructRNA * depsgraph
static float verts[][3]
bool mask_equals_array_bmesh(const int mask_offset, const Set< BMVert *, 0 > &verts, const Span< float > values)
void scatter_mask_grids(const Span< float > mask, SubdivCCG &subdiv_ccg, const Span< int > grids)
void PAINT_OT_mask_polyline_gesture(wmOperatorType *ot)
bool mask_equals_array_grids(const Span< float > masks, const CCGKey &key, const Span< int > grids, const Span< float > values)
void PAINT_OT_mask_line_gesture(wmOperatorType *ot)
void write_mask_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> write_fn)
void update_mask_mesh(const Depsgraph &depsgraph, Object &object, const IndexMask &node_mask, FunctionRef< void(MutableSpan< float >, Span< int >)> update_fn)
void scatter_mask_bmesh(const Span< float > mask, const BMesh &bm, const Set< BMVert *, 0 > &verts)
void gather_mask_bmesh(const BMesh &bm, const Set< BMVert *, 0 > &verts, const MutableSpan< float > r_mask)
void mix_new_masks(const Span< float > new_masks, const float factor, const MutableSpan< float > masks)
Definition paint_mask.cc:95
Array< float > duplicate_mask(const Object &object)
Definition paint_mask.cc:55
void invert_mask(const MutableSpan< float > masks)
void gather_mask_grids(const SubdivCCG &subdiv_ccg, const Span< int > grids, const MutableSpan< float > r_mask)
void PAINT_OT_mask_box_gesture(wmOperatorType *ot)
void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot)
void clamp_mask(const MutableSpan< float > masks)
void PAINT_OT_mask_flood_fill(wmOperatorType *ot)
void average_neighbor_mask_bmesh(const int mask_offset, const Set< BMVert *, 0 > &verts, const MutableSpan< float > new_masks)
wmOperatorType * ot
Definition wm_files.cc:4237