diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.cpp
new file mode 100644
index 00000000..74fcd445
--- /dev/null
+++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.cpp
@@ -0,0 +1,103 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2021 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+
+using sofa::core::objectmodel::Snapshot;
+
+namespace py { using namespace pybind11; }
+PYBIND11_MAKE_OPAQUE(std::vector);
+PYBIND11_MAKE_OPAQUE(std::vector);
+PYBIND11_MAKE_OPAQUE(std::vector>);
+PYBIND11_MAKE_OPAQUE(std::vector>);
+
+namespace sofapython3 {
+
+void moduleAddSnapshot(py::module &m)
+{
+ py::bind_vector>(m, "SnapshotDataInfoVector");
+ py::bind_vector>(m, "SnapshotLinkInfoVector");
+ py::bind_vector>>(m, "SnapshotObjectVector");
+ py::bind_vector>>(m, "SnapshotNodeVector");
+
+ py::class_ snapshot(m, "Snapshot");
+
+ snapshot.def(py::init<>())
+ .def_readwrite("graphRoot", &Snapshot::m_graphRoot);
+
+ py::class_(snapshot, "DataInfo")
+ .def(py::init<>())
+ .def_readwrite("name", &Snapshot::DataInfo::m_name)
+ .def_readwrite("type", &Snapshot::DataInfo::m_type)
+ .def_readwrite("value", &Snapshot::DataInfo::m_value);
+
+ py::class_(snapshot, "LinkInfo")
+ .def(py::init<>())
+ .def_readwrite("name", &Snapshot::LinkInfo::m_name)
+ .def_readwrite("type", &Snapshot::LinkInfo::m_type)
+ .def_readwrite("value", &Snapshot::LinkInfo::m_value);
+
+ py::class_>(snapshot, "SnapshotObject")
+ .def(py::init<>())
+ .def(py::init())
+ .def_readwrite("name", &Snapshot::SnapshotObject::m_name)
+ .def_readwrite("className", &Snapshot::SnapshotObject::m_className)
+ .def_readwrite("pathName", &Snapshot::SnapshotObject::m_pathName)
+
+ .def_property("dataContainer",
+ [](Snapshot::SnapshotObject &self) -> std::vector& { return self.m_dataContainer; },
+ [](Snapshot::SnapshotObject &self, const std::vector &v) { self.m_dataContainer = v; },
+ py::return_value_policy::reference_internal)
+
+ .def_property("linkContainer",
+ [](Snapshot::SnapshotObject &self) -> std::vector& { return self.m_linkContainer; },
+ [](Snapshot::SnapshotObject &self, const std::vector &v) { self.m_linkContainer = v; },
+ py::return_value_policy::reference_internal)
+
+ .def_property("objects",
+ [](Snapshot::SnapshotObject &self) -> std::vector>& { return self.m_objects; },
+ [](Snapshot::SnapshotObject &self, const std::vector> &v) { self.m_objects = v; },
+ py::return_value_policy::reference_internal)
+
+ .def("clear", &Snapshot::SnapshotObject::clear)
+
+ .def("push_back", py::overload_cast(&Snapshot::SnapshotObject::push_back), py::return_value_policy::reference_internal)
+ .def("push_back", py::overload_cast(&Snapshot::SnapshotObject::push_back), py::return_value_policy::reference_internal)
+ .def("push_back", py::overload_cast&>(&Snapshot::SnapshotObject::push_back), py::return_value_policy::reference_internal);
+
+ py::class_>(snapshot, "SnapshotNode")
+ .def(py::init<>())
+ .def(py::init())
+ .def(py::init())
+
+ .def_property("children",
+ [](Snapshot::SnapshotNode &self) -> std::vector>& { return self.m_children; },
+ [](Snapshot::SnapshotNode &self, const std::vector> &v) { self.m_children = v; },
+ py::return_value_policy::reference_internal)
+
+ .def("clear", &Snapshot::SnapshotNode::clear)
+ .def("push_back", py::overload_cast&>(&Snapshot::SnapshotNode::push_back), py::return_value_policy::reference_internal);
+}
+
+}
\ No newline at end of file
diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.h b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.h
new file mode 100644
index 00000000..570546aa
--- /dev/null
+++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Snapshot.h
@@ -0,0 +1,32 @@
+/******************************************************************************
+* SOFA, Simulation Open-Framework Architecture *
+* (c) 2021 INRIA, USTL, UJF, CNRS, MGH *
+* *
+* This program is free software; you can redistribute it and/or modify it *
+* under the terms of the GNU Lesser General Public License as published by *
+* the Free Software Foundation; either version 2.1 of the License, or (at *
+* your option) any later version. *
+* *
+* This program is distributed in the hope that it will be useful, but WITHOUT *
+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
+* for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with this program. If not, see . *
+*******************************************************************************
+* Contact information: contact@sofa-framework.org *
+******************************************************************************/
+
+#pragma once
+
+#include
+#include
+using sofa::core::objectmodel::Snapshot;
+
+namespace sofapython3 {
+
+void moduleAddSnapshot(pybind11::module &m);
+
+} /// namespace sofapython3
+
diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/CMakeLists.txt b/bindings/Sofa/src/SofaPython3/Sofa/Core/CMakeLists.txt
index d2db796b..7b2de183 100644
--- a/bindings/Sofa/src/SofaPython3/Sofa/Core/CMakeLists.txt
+++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/CMakeLists.txt
@@ -53,6 +53,7 @@ set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Binding_BaseCamera_doc.h
${CMAKE_CURRENT_SOURCE_DIR}/Binding_Topology.h
${CMAKE_CURRENT_SOURCE_DIR}/Binding_BaseMeshTopology.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/Binding_Snapshot.h
${CMAKE_CURRENT_SOURCE_DIR}/Binding_TaskScheduler.h
${CMAKE_CURRENT_SOURCE_DIR}/Binding_TaskScheduler_doc.h
${CMAKE_CURRENT_SOURCE_DIR}/Binding_VisualParams.h
@@ -89,6 +90,7 @@ set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/Binding_BaseLink.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Binding_Topology.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Binding_BaseMeshTopology.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Binding_Snapshot.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Binding_TaskScheduler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Binding_VisualParams.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Submodule_Core.cpp
diff --git a/bindings/Sofa/src/SofaPython3/Sofa/Core/Submodule_Core.cpp b/bindings/Sofa/src/SofaPython3/Sofa/Core/Submodule_Core.cpp
index 1f918c53..32e0ce47 100644
--- a/bindings/Sofa/src/SofaPython3/Sofa/Core/Submodule_Core.cpp
+++ b/bindings/Sofa/src/SofaPython3/Sofa/Core/Submodule_Core.cpp
@@ -43,6 +43,7 @@ using sofa::helper::logging::Message;
#include
#include
#include
+#include
#include
#include
#include
@@ -157,6 +158,7 @@ PYBIND11_MODULE(Core, core)
moduleAddBaseMeshTopology(core);
moduleAddPointSetTopologyModifier(core);
moduleAddTaskScheduler(core);
+ moduleAddSnapshot(core);
moduleAddVisualParams(core);
// called when the module is unloaded