Blender V4.3
sculpt_filter.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 <array>
12
13#include "BLI_array.hh"
14#include "BLI_index_mask.hh"
15#include "BLI_math_matrix.hh"
16#include "BLI_math_vector.hh"
17#include "BLI_vector.hh"
18
19#include "ED_view3d.hh"
20
21struct wmOperatorType;
22
23namespace blender {
24namespace bke::pbvh {
25class Node;
26}
27namespace ed::sculpt_paint {
29namespace auto_mask {
30struct Cache;
31}
32namespace cloth {
33struct SimulationData;
34}
35namespace undo {
36enum class Type : int8_t;
37}
38} // namespace ed::sculpt_paint
39} // namespace blender
40
42
44 Local = 0,
45 World = 1,
46 View = 2,
47};
48
49struct Cache {
50 std::array<bool, 3> enabled_axis;
52
53 /* Used for alternating between filter operations in filters that need to apply different ones to
54 * achieve certain effects. */
56
57 /* Stores the displacement produced by the laplacian step of HC smooth. */
61
62 /* Sharpen mesh filter. */
68
69 /* Filter orientation. */
75
76 /* Displacement eraser. */
78
79 /* unmasked nodes */
82
83 /* Cloth filter. */
84 std::unique_ptr<cloth::SimulationData> cloth_sim;
86
87 /* mask expand iteration caches */
95
98
100
102
103 std::unique_ptr<auto_mask::Cache> automasking;
106
107 /* Pre-smoothed colors used by sharpening. Colors are HSL. */
109
112
113 ~Cache();
114};
115
116void cache_init(bContext *C,
117 Object &ob,
118 const Sculpt &sd,
119 undo::Type undo_type,
120 const float mval_fl[2],
121 float area_normal_radius,
122 float start_strength);
124
125/* Filter orientation utils. */
126float3x3 to_orientation_space(const filter::Cache &filter_cache);
127float3x3 to_object_space(const filter::Cache &filter_cache);
128void zero_disabled_axis_components(const filter::Cache &filter_cache, MutableSpan<float3> vectors);
129} // namespace blender::ed::sculpt_paint::filter
void cache_init(bContext *C, Object &ob, const Sculpt &sd, undo::Type undo_type, const float mval_fl[2], float area_normal_radius, float start_strength)
void zero_disabled_axis_components(const filter::Cache &filter_cache, MutableSpan< float3 > vectors)
float3x3 to_orientation_space(const filter::Cache &filter_cache)
float3x3 to_object_space(const filter::Cache &filter_cache)
void register_operator_props(wmOperatorType *ot)
signed char int8_t
Definition stdint.h:75
std::unique_ptr< cloth::SimulationData > cloth_sim
std::unique_ptr< auto_mask::Cache > automasking
TransformDisplacementMode transform_displacement_mode
wmOperatorType * ot
Definition wm_files.cc:4125