Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spring] Add warning when user tries to override MeshSpringForcefield indices #5136

Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ void MeshSpringForceField<DataTypes>::addSpring(std::set<std::pair<sofa::Index,
template<class DataTypes>
void MeshSpringForceField<DataTypes>::init()
{
if(this->d_springsIndices[0].getValue().size() || this->d_springsIndices[1].getValue().size())
hugtalbot marked this conversation as resolved.
Show resolved Hide resolved
{
msg_warning(this) << "Setting springs of MeshSpringForcefield through datas indices1 and indices2 is disabled since v24.12. The inputed indices will be overriden by the mesh.";
bakpaul marked this conversation as resolved.
Show resolved Hide resolved
}

SpringForceField<DataTypes>::clear();

if(!(mstate1) || !(mstate2))
mstate2 = mstate1 = dynamic_cast<sofa::core::behavior::MechanicalState<DataTypes> *>(this->getContext()->getMechanicalState());

Expand Down
Loading