From 539b6bea13c0b058721317caf2955f27c9adc110 Mon Sep 17 00:00:00 2001 From: Paul Baksic <30337881+bakpaul@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:19:20 +0100 Subject: [PATCH] [Spring] Add warning when user tries to override MeshSpringForcefield indices (#5136) * Add warning when disabled mechanism is used * remove unnecessary new lines * Update Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl Co-authored-by: Hugo --------- Co-authored-by: Hugo --- .../solidmechanics/spring/MeshSpringForceField.inl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl index fc872ab8089..2cc8a242b2d 100644 --- a/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl +++ b/Sofa/Component/SolidMechanics/Spring/src/sofa/component/solidmechanics/spring/MeshSpringForceField.inl @@ -102,7 +102,13 @@ void MeshSpringForceField::addSpring(std::set void MeshSpringForceField::init() { + if(this->d_springsIndices[0].getValue().size() || this->d_springsIndices[1].getValue().size()) + { + msg_warning(this) << "Setting springs of MeshSpringForcefield through datas \'indices1\' and \'indices2\' has been disabled since v24.12. The input indices will be overridden by the mesh."; + } + SpringForceField::clear(); + if(!(mstate1) || !(mstate2)) mstate2 = mstate1 = dynamic_cast *>(this->getContext()->getMechanicalState());