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-07-22 16:39:41 +0300
committerJacques Lucke <jacques@blender.org>2022-07-22 16:39:41 +0300
commit1f94b56d774440d08eb92f2a7a47b9a6a7aa7b84 (patch)
tree06928c94d524852c7031aa310d578691735dc0a8 /source/blender/blenkernel/BKE_curves.hh
parent98bf714b37c1f1b05a162b6ffdaca367b312de1f (diff)
Curves: support sculpting on deformed curves
Previously, curves sculpt tools only worked on original data. This was very limiting, because one could effectively only sculpt the curves when all procedural effects were turned off. This patch adds support for curves sculpting while looking the result of procedural effects (like deformation based on the surface mesh). This functionality is also known as "crazy space" support in Blender. For more details see D15407. Differential Revision: https://developer.blender.org/D15407
Diffstat (limited to 'source/blender/blenkernel/BKE_curves.hh')
-rw-r--r--source/blender/blenkernel/BKE_curves.hh33
1 files changed, 33 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_curves.hh b/source/blender/blenkernel/BKE_curves.hh
index 68c90a45031..568899721a9 100644
--- a/source/blender/blenkernel/BKE_curves.hh
+++ b/source/blender/blenkernel/BKE_curves.hh
@@ -11,6 +11,7 @@
#include <mutex>
+#include "BLI_float3x3.hh"
#include "BLI_float4x4.hh"
#include "BLI_generic_virtual_array.hh"
#include "BLI_index_mask.hh"
@@ -414,6 +415,38 @@ class CurvesGeometry : public ::CurvesGeometry {
}
};
+/**
+ * Used to propagate deformation data through modifier evaluation so that sculpt tools can work on
+ * evaluated data.
+ */
+class CurvesEditHints {
+ public:
+ /**
+ * Original data that the edit hints below are meant to be used for.
+ */
+ const Curves &curves_id_orig;
+ /**
+ * Evaluated positions for the points in #curves_orig. If this is empty, the positions from the
+ * evaluated #Curves should be used if possible.
+ */
+ std::optional<Array<float3>> positions;
+ /**
+ * Matrices which transform point movement vectors from original data to corresponding movements
+ * of evaluated data.
+ */
+ std::optional<Array<float3x3>> deform_mats;
+
+ CurvesEditHints(const Curves &curves_id_orig) : curves_id_orig(curves_id_orig)
+ {
+ }
+
+ /**
+ * The edit hints have to correspond to the original curves, i.e. the number of deformed points
+ * is the same as the number of original points.
+ */
+ bool is_valid() const;
+};
+
namespace curves {
/* -------------------------------------------------------------------- */