Skip to content

[Bindings] Add bindings for Snapshot - #629

Open
Lucas-TJ wants to merge 22 commits into
sofa-framework:masterfrom
Lucas-TJ:snapshot_bindings
Open

Lucas-TJ wants to merge 22 commits into
sofa-framework:masterfrom
Lucas-TJ:snapshot_bindings

Conversation

@Lucas-TJ

@Lucas-TJ Lucas-TJ commented Jul 16, 2026 •

Copy link
Copy Markdown

PR SofaPython3 - Snapshot

Snapshot_bindings

Related to :

Overview

This Pull Request adds bindings for the Snapshot feature in SofaPython3. It provides a bridge between the Snapshot API in Sofa and Python, allowing users to save and load snapshots through Python bindings.

Currently, snapshots can only be saved and loaded in memory with bindings.

API

Snapshot _Python

Snapshot_Python is a class used to store snapshots through the m_snapshots vector.
The C++ class Snapshot is exposed through the bindings..

Save and Load

To save and load snapshots, users can call executeSaveSnapshotVisitor() and executeLoadSnapshotVisitor(). These functions execute the corresponding visitors responsible for saving and loading snapshots.

The visitor is called directly on the "root" node and works in the same way as the standard Snapshot feature. The snapshot is stored in a previously initialized Snapshot_Python container. If you use these functions, you are responsible for managing where the snapshots are stored.

Exemple

snapshot = Sofa.Core.Snapshot

root.executeSaveSnapshotVisitor(snapshot)

root.executeLoadSnapshotVisitor(snapshot)

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants