Skip to content

Commit e7a9eaf

Browse files
committed
[SofaPython] Restore the copy by default approach in toSofaParsableString
Because it breaks bckward compatibility and was not really better.
1 parent 8536c1c commit e7a9eaf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Plugin/src/SofaPython3/DataHelper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ std::string toSofaParsableString(const py::handle& p)
4848
if(py::isinstance<py::str>(p))
4949
return py::str(p);
5050

51-
// Insure compatibility with data field code returning value instead of data.
51+
// If the object is a data field we take its value to copy them.
5252
if(py::isinstance<sofa::core::objectmodel::BaseData>(p))
5353
{
5454
sofa::core::objectmodel::BaseData* data = py::cast<sofa::core::objectmodel::BaseData*>(p);
55-
return data->getLinkPath();
55+
return data->getValueString();
5656
}
5757

58-
// If the object is a numpy array we convert it to a list then to a sofa string
58+
// If the object is a numpy array we convert it to a list then to a sofa string.
5959
if(py::isinstance<py::array>(p))
6060
{
6161
py::object o = p.attr("tolist")();

0 commit comments

Comments
 (0)