Blender V5.0
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
18struct Depsgraph;
19struct Mesh;
20namespace blender::bke {
21enum class AttrDomain : int8_t;
22struct GAttributeReader;
24namespace pbvh {
25class Node;
26}
27} // namespace blender::bke
28
30
31/* Swaps colors at each element in indices with values in colors. */
33 GMutableSpan color_attribute,
34 MutableSpan<float4> r_colors);
35
36/* Stores colors from the elements in indices into colors. */
37void gather_colors(GSpan color_attribute, Span<int> indices, MutableSpan<float4> r_colors);
38
39/* Like gather_colors but handles loop->vert conversion */
41 Span<int> corner_verts,
42 GroupedSpan<int> vert_to_face_map,
43 GSpan color_attribute,
44 bke::AttrDomain color_domain,
46 MutableSpan<float4> r_colors);
47
49 Span<int> corner_verts,
50 GroupedSpan<int> vert_to_face_map,
51 bke::AttrDomain color_domain,
52 int vert,
53 const float4 &color,
54 GMutableSpan color_attribute);
56 Span<int> corner_verts,
57 GroupedSpan<int> vert_to_face_map,
58 GSpan color_attribute,
59 bke::AttrDomain color_domain,
60 int vert);
61
64
65void do_paint_brush(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
BPy_StructRNA * depsgraph
static ushort indices[]
static float verts[][3]
static char faces[256]
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)
bke::GAttributeReader active_color_attribute(const Mesh &mesh)
void do_paint_brush(const Depsgraph &depsgraph, PaintModeSettings &paint_mode_settings, const Sculpt &sd, Object &ob, const IndexMask &node_mask, const IndexMask &texnode_mask)
VecBase< float, 4 > float4