Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Plugin/src/SofaPython3/PythonFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ using sofa::core::objectmodel::Event;

#include <sofa/defaulttype/DataTypeInfo.h>

#include <pybind11/eigen.h>

SOFAPYTHON3_BIND_ATTRIBUTE_ERROR()

/// Makes an alias for the pybind11 namespace to increase readability.
Expand Down Expand Up @@ -196,6 +198,10 @@ py::object PythonFactory::valueToPython_ro(sofa::core::objectmodel::BaseData* da
a.attr("flags").attr("writeable") = false;
return std::move(a);
}
if(auto p = dynamic_cast<sofa::core::objectmodel::Data<Eigen::MatrixXf>*>(data)){
const auto matrice = p->getValue();
return py::cast(matrice);
}

/// If this is not the case we return the converted datas (copy)
return convertToPython(data);
Expand Down
Loading