Skip to content

Commit 292ccec

Browse files
committed
[SofaPython3] Add linkpath property in Binding_BaseData
1 parent e2d1234 commit 292ccec

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ void moduleAddBase(py::module &m)
441441
base.def("getLoggedMessagesAsString", &BindingBase::getLoggedMessagesAsString, sofapython3::doc::base::getLoggedMessagesAsString);
442442
base.def("countLoggedMessages", &BindingBase::countLoggedMessages, sofapython3::doc::base::countLoggedMessages);
443443
base.def("clearLoggedMessages", &BindingBase::clearLoggedMessages, sofapython3::doc::base::clearLoggedMessages);
444-
base.def("getPathName", &BindingBase::getPathName, sofapython3::doc::base::setDataValues);
445-
base.def("getPathName", &BindingBase::getLinkPath, sofapython3::doc::base::setDataValues);
444+
base.def("getPathName", &BindingBase::getPathName, sofapython3::doc::base::getPathName);
445+
base.def("getLinkPath", &BindingBase::getLinkPath, sofapython3::doc::base::getLinkPath);
446446
base.def("setDataValues", &BindingBase::setDataValues, sofapython3::doc::base::setDataValues);
447447
}
448448

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_BaseData.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ py::object writeableArray(BaseData* self)
112112

113113
void __setattr__(py::object self, const std::string& s, py::object value)
114114
{
115+
SOFA_UNUSED(s);
115116
BaseData* selfdata = py::cast<BaseData*>(self);
116117

117118
if(py::isinstance<DataContainer>(value))
@@ -137,7 +138,7 @@ py::object __getattr__(py::object self, const std::string& s)
137138
if(s == "value")
138139
return PythonFactory::valueToPython_ro(py::cast<BaseData*>(self));
139140

140-
if(s == "link")
141+
if(s == "linkpath")
141142
return py::cast((py::cast<BaseData*>(self))->getLinkPath());
142143

143144
/// BaseData does not support dynamic attributes, if you think this is an important feature

0 commit comments

Comments
 (0)