Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-03-23 20:19:38 +0300
committerJacques Lucke <jacques@blender.org>2022-03-23 20:19:59 +0300
commitd67f9820b8f8376084adf5ad964c580c0944027f (patch)
tree0c3eb60c1d4c8f70a32239c715f1dcec814c677f /source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
parent5d38b13e61ff04df6b8b4e52541910167225a18e (diff)
Curves: improve Comb brush
New supported features: * 3D/spherical brush that samples a good position on the curves. * Falloff. The custom falloff curve mapping is not yet available in the ui because that requires some more ui reorganization. This is better done when we have a better understanding of what settings we need exactly. Currently, the depth of the 3d brush is only sampled once per stroke, when first pressing LMB. Sometimes it is expected that the depth of the brush can change within a single brush. However, implementing that in a good way is not straight forward and might need additional options. Therefore that will be handled separately. Some experimentation results are in D14376. Ref T96445. Differential Revision: https://developer.blender.org/D14376
Diffstat (limited to 'source/blender/editors/sculpt_paint/curves_sculpt_intern.hh')
-rw-r--r--source/blender/editors/sculpt_paint/curves_sculpt_intern.hh23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh b/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
index d1de69f36b6..d021627921f 100644
--- a/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
+++ b/source/blender/editors/sculpt_paint/curves_sculpt_intern.hh
@@ -2,12 +2,22 @@
#pragma once
+#include <optional>
+
#include "curves_sculpt_intern.h"
#include "BLI_math_vector.hh"
+#include "BKE_curves.hh"
+
+struct ARegion;
+struct RegionView3D;
+struct Object;
+
namespace blender::ed::sculpt_paint {
+using bke::CurvesGeometry;
+
struct StrokeExtension {
bool is_first;
float2 mouse_position;
@@ -27,4 +37,17 @@ std::unique_ptr<CurvesSculptStrokeOperation> new_comb_operation();
std::unique_ptr<CurvesSculptStrokeOperation> new_delete_operation();
std::unique_ptr<CurvesSculptStrokeOperation> new_snake_hook_operation();
+struct CurvesBrush3D {
+ float3 position_cu;
+ float radius_cu;
+};
+
+/**
+ * Find 3d brush position based on cursor position for curves sculpting.
+ */
+std::optional<CurvesBrush3D> sample_curves_3d_brush(bContext &C,
+ Object &curves_object,
+ const float2 &brush_pos_re,
+ float brush_radius_re);
+
} // namespace blender::ed::sculpt_paint