File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
bindings/Sofa/src/SofaPython3/Sofa/Core Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ using sofa::core::objectmodel::BaseLink;
2424#include < sofa/core/objectmodel/BaseObject.h>
2525using sofa::core::objectmodel::BaseObject;
2626
27+ #include < SofaPython3/PythonFactory.h>
28+
2729#include < SofaPython3/Sofa/Core/Binding_LinkPath.h>
2830#include < SofaPython3/Sofa/Core/Binding_LinkPath_doc.h>
2931
@@ -79,6 +81,13 @@ void moduleAddLinkPath(py::module& m)
7981 py::class_<LinkPath> link (m, " LinkPath" , sofapython3::doc::linkpath::linkpath);
8082 link.def (" __str__" , &__str__);
8183 link.def (" __repr__" , &__repr__);
84+ link.def (" target" , [](const LinkPath& entry) -> py::object{
85+ if (entry.targetData != nullptr )
86+ return PythonFactory::toPython (entry.targetData );
87+ else if (entry.targetBase .get () != nullptr )
88+ return PythonFactory::toPython (entry.targetBase .get ());
89+ return py::none ();
90+ });
8291}
8392
8493}// / namespace sofapython3
You can’t perform that action at this time.
0 commit comments