Blender V4.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
9#pragma once
10
11#include "DNA_scene_types.h"
12
13#include "BLI_generic_span.hh"
14#include "BLI_math_vector.hh"
15#include "BLI_offset_indices.hh"
16#include "BLI_span.hh"
17
18struct Depsgraph;
19namespace blender::bke {
20enum class AttrDomain : int8_t;
21struct GAttributeReader;
22struct GSpanAttributeWriter;
23namespace pbvh {
24class Node;
25}
26} // namespace blender::bke
27
29
30/* Swaps colors at each element in indices with values in colors. */
32 GMutableSpan color_attribute,
33 MutableSpan<float4> r_colors);
34
35/* Stores colors from the elements in indices into colors. */
36void gather_colors(GSpan color_attribute, Span<int> indices, MutableSpan<float4> r_colors);
37
38/* Like gather_colors but handles loop->vert conversion */
40 Span<int> corner_verts,
41 GroupedSpan<int> vert_to_face_map,
42 GSpan color_attribute,
43 bke::AttrDomain color_domain,
45 MutableSpan<float4> r_colors);
46
48 Span<int> corner_verts,
49 GroupedSpan<int> vert_to_face_map,
50 bke::AttrDomain color_domain,
51 int vert,
52 const float4 &color,
53 GMutableSpan color_attribute);
55 Span<int> corner_verts,
56 GroupedSpan<int> vert_to_face_map,
57 GSpan color_attribute,
58 bke::AttrDomain color_domain,
59 int vert);
60
63
64void do_paint_brush(const Scene &scene,
65 const Depsgraph &depsgraph,
66 PaintModeSettings &paint_mode_settings,
67 const Sculpt &sd,
68 Object &ob,
69 const IndexMask &node_mask,
70 const IndexMask &texnode_mask);
71void do_smear_brush(const Depsgraph &depsgraph,
72 const Sculpt &sd,
73 Object &ob,
74 const IndexMask &node_mask);
75} // namespace blender::ed::sculpt_paint::color
const Depsgraph * depsgraph
static float verts[][3]
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 Scene &scene, const Depsgraph &depsgraph, PaintModeSettings &paint_mode_settings, const Sculpt &sd, Object &ob, const IndexMask &node_mask, const IndexMask &texnode_mask)
bke::GAttributeReader active_color_attribute(const Mesh &mesh)
signed char int8_t
Definition stdint.h:75