Blender V5.3
sculpt_color.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 "DNA_scene_types.h"
12
13#include "BLI_generic_span.hh"
15#include "BLI_offset_indices.hh"
16#include "BLI_span.hh"
17
18namespace blender {
19
20struct Depsgraph;
21struct Mesh;
22namespace bke {
23enum class AttrDomain : int8_t;
24struct GAttributeReader;
26namespace pbvh {
27class Node;
28}
29} // namespace bke
30
32
33/* Swaps colors at each element in indices with values in colors. */
35 GMutableSpan color_attribute,
36 MutableSpan<float4> r_colors);
37
38/* Stores colors from the elements in indices into colors. */
39void gather_colors(GSpan color_attribute, Span<int> indices, MutableSpan<float4> r_colors);
40
41/* Like gather_colors but handles loop->vert conversion */
43 Span<int> corner_verts,
44 GroupedSpan<int> vert_to_face_map,
45 GSpan color_attribute,
46 bke::AttrDomain color_domain,
47 Span<int> verts,
48 MutableSpan<float4> r_colors);
49
51 Span<int> corner_verts,
52 GroupedSpan<int> vert_to_face_map,
53 bke::AttrDomain color_domain,
54 int vert,
55 const float4 &color,
56 GMutableSpan color_attribute);
58 Span<int> corner_verts,
59 GroupedSpan<int> vert_to_face_map,
60 GSpan color_attribute,
61 bke::AttrDomain color_domain,
62 int vert);
63
64float4 color_corner_get(const GSpan color_attribute, int corner_index);
65
68
69void do_paint_brush(const Depsgraph &depsgraph,
70 const Sculpt &sd,
71 Object &ob,
72 const IndexMask &node_mask);
73void do_smear_brush(const Depsgraph &depsgraph,
74 const Sculpt &sd,
75 Object &ob,
76 const IndexMask &node_mask);
77void do_blur_brush(const Depsgraph &depsgraph,
78 const Sculpt &sd,
79 Object &ob,
80 const IndexMask &node_mask);
81} // namespace ed::sculpt_paint::color
82
83} // namespace blender
bke::GSpanAttributeWriter active_color_attribute_for_write(Mesh &mesh)
void gather_colors_vert(OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, GSpan color_attribute, bke::AttrDomain color_domain, Span< int > verts, MutableSpan< float4 > r_colors)
void do_smear_brush(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
float4 color_vert_get(OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, GSpan color_attribute, bke::AttrDomain color_domain, int vert)
void gather_colors(GSpan color_attribute, Span< int > indices, MutableSpan< float4 > r_colors)
void color_vert_set(OffsetIndices< int > faces, Span< int > corner_verts, GroupedSpan< int > vert_to_face_map, bke::AttrDomain color_domain, int vert, const float4 &color, GMutableSpan color_attribute)
void swap_gathered_colors(Span< int > indices, GMutableSpan color_attribute, MutableSpan< float4 > r_colors)
void do_paint_brush(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
bke::GAttributeReader active_color_attribute(const Mesh &mesh)
float4 color_corner_get(const GSpan color_attribute, int corner_index)
void do_blur_brush(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
BMesh Iterators.
VecBase< float, 4 > float4
signed char int8_t
Definition BKE_text.h:76