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:
Diffstat (limited to 'source/blender/blenkernel/intern/curves.cc')
-rw-r--r--source/blender/blenkernel/intern/curves.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/curves.cc b/source/blender/blenkernel/intern/curves.cc
index 5684a2e5b07..6554f42d3dd 100644
--- a/source/blender/blenkernel/intern/curves.cc
+++ b/source/blender/blenkernel/intern/curves.cc
@@ -319,6 +319,14 @@ void BKE_curves_data_update(struct Depsgraph *depsgraph, struct Scene *scene, Ob
Curves *curves = static_cast<Curves *>(object->data);
GeometrySet geometry_set = GeometrySet::create_with_curves(curves,
GeometryOwnershipType::ReadOnly);
+ if (object->mode == OB_MODE_SCULPT_CURVES) {
+ /* Try to propagate deformation data through modifier evaluation, so that sculpt mode can work
+ * on evaluated curves. */
+ GeometryComponentEditData &edit_component =
+ geometry_set.get_component_for_write<GeometryComponentEditData>();
+ edit_component.curves_edit_hints_ = std::make_unique<blender::bke::CurvesEditHints>(
+ *static_cast<const Curves *>(DEG_get_original_object(object)->data));
+ }
curves_evaluate_modifiers(depsgraph, scene, object, geometry_set);
/* Assign evaluated object. */
@@ -409,4 +417,20 @@ CurvesSurfaceTransforms::CurvesSurfaceTransforms(const Object &curves_ob, const
}
}
+bool CurvesEditHints::is_valid() const
+{
+ const int point_num = this->curves_id_orig.geometry.point_num;
+ if (this->positions.has_value()) {
+ if (this->positions->size() != point_num) {
+ return false;
+ }
+ }
+ if (this->deform_mats.has_value()) {
+ if (this->deform_mats->size() != point_num) {
+ return false;
+ }
+ }
+ return true;
+}
+
} // namespace blender::bke