Blender V5.0
sculpt_boundary.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_span.hh"
14#include "BLI_map.hh"
16#include "BLI_offset_indices.hh"
17#include "BLI_span.hh"
18#include "BLI_vector.hh"
19
20struct Brush;
21struct BMVert;
22struct Depsgraph;
23struct Object;
24struct Sculpt;
26struct SculptSession;
27struct SubdivCCG;
28struct SubdivCCGCoord;
29namespace blender::bke::pbvh {
30class Node;
31}
32
34
36 /* Vertex indices of the active boundary. */
38
39 /* Distance from a vertex in the boundary to initial vertex indexed by vertex index, taking into
40 * account the length of all edges between them. Any vertex that is not in the boundary will have
41 * a distance of 0. */
43
44 /* Data for drawing the preview. */
46
47 /* Initial vertex index in the boundary which is closest to the current sculpt active vertex. */
49
50 /* Vertex that at max_propagation_steps from the boundary and closest to the original active
51 * vertex that was used to initialize the boundary. This is used as a reference to check how much
52 * the deformation will go into the mesh and to calculate the strength of the brushes. */
54
55 /* Stores the initial positions of the pivot and boundary initial vertex as they may be deformed
56 * during the brush action. This allows to use them as a reference positions and vectors for some
57 * brush effects. */
59
60 /* Maximum number of topology steps that were calculated from the boundary. */
62
63 /* Indexed by vertex index, contains the topology information needed for boundary deformations.
64 */
65 struct {
66 /* Vertex index from where the topology propagation reached this vertex. */
68
69 /* How many steps were needed to reach this vertex from the boundary. */
71
72 /* Strength that is used to deform this vertex. */
75
76 /* Bend Deform type. */
77 struct {
81
82 /* Slide Deform type. */
83 struct {
86
87 /* Twist Deform type. */
88 struct {
92};
93
99void ensure_boundary_info(Object &object);
100
106bool vert_is_boundary(GroupedSpan<int> vert_to_face_map,
107 Span<bool> hide_poly,
109 int vert);
111 Span<int> corner_verts,
113 const SubdivCCG &subdiv_ccg,
114 SubdivCCGCoord vert);
115bool vert_is_boundary(BMVert *vert);
116
121std::unique_ptr<SculptBoundary> data_init(const Depsgraph &depsgraph,
122 Object &object,
123 const Brush *brush,
124 int initial_vert,
125 float radius);
126std::unique_ptr<SculptBoundary> data_init_mesh(const Depsgraph &depsgraph,
127 Object &object,
128 const Brush *brush,
129 int initial_vert,
130 float radius);
131std::unique_ptr<SculptBoundary> data_init_grids(Object &object,
132 const Brush *brush,
133 SubdivCCGCoord initial_vert,
134 float radius);
135std::unique_ptr<SculptBoundary> data_init_bmesh(Object &object,
136 const Brush *brush,
137 BMVert *initial_vert,
138 float radius);
139std::unique_ptr<SculptBoundaryPreview> preview_data_init(const Depsgraph &depsgraph,
140 Object &object,
141 const Brush *brush,
142 float radius);
143
144void edges_preview_draw(uint gpuattr,
145 SculptSession &ss,
146 const float outline_col[3],
147 float outline_alpha);
149
150void do_boundary_brush(const Depsgraph &depsgraph,
151 const Sculpt &sd,
152 Object &object,
153 const IndexMask &node_mask);
154
155} // namespace blender::ed::sculpt_paint::boundary
unsigned int uint
BPy_StructRNA * depsgraph
static char faces[256]
void pivot_line_preview_draw(const uint gpuattr, SculptSession &ss)
std::unique_ptr< SculptBoundary > data_init_bmesh(Object &object, const Brush *brush, BMVert *initial_vert, const float radius)
std::unique_ptr< SculptBoundaryPreview > preview_data_init(const Depsgraph &depsgraph, Object &object, const Brush *brush, const float radius)
std::unique_ptr< SculptBoundary > data_init(const Depsgraph &depsgraph, Object &object, const Brush *brush, const int initial_vert, const float radius)
bool vert_is_boundary(const GroupedSpan< int > vert_to_face_map, const Span< bool > hide_poly, const BitSpan boundary, const int vert)
Definition sculpt.cc:483
void edges_preview_draw(const uint gpuattr, SculptSession &ss, const float outline_col[3], const float outline_alpha)
std::unique_ptr< SculptBoundary > data_init_mesh(const Depsgraph &depsgraph, Object &object, const Brush *brush, const int initial_vert, const float radius)
void do_boundary_brush(const Depsgraph &depsgraph, const Sculpt &sd, Object &ob, const IndexMask &node_mask)
void ensure_boundary_info(Object &object)
Definition sculpt.cc:6073
std::unique_ptr< SculptBoundary > data_init_grids(Object &object, const Brush *brush, const SubdivCCGCoord initial_vert, const float radius)
VecBase< float, 3 > float3
Vector< std::pair< float3, float3 > > edges
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@323005326032327147311336001014033276320243112166 bend
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@277100262305314074236065030053204346073216026132 twist
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@040373240076136143173251223200300140060366356167 edit_info
struct blender::ed::sculpt_paint::boundary::SculptBoundary::@227302173357037301367136333217263217232265025176 slide