Skip to content

[Bindings] Add bindings for Snapshot#629

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

[Bindings] Add bindings for Snapshot#629
Lucas-TJ wants to merge 14 commits into
sofa-framework:masterfrom
Lucas-TJ:snapshot_bindings

Conversation

@Lucas-TJ

Copy link
Copy Markdown

PR SofaPython3 - Snapshot

Snapshot_bindings

Related to sofa-framework/sofa#6168 (Do not merge before)

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.

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.

Exemple

snapshot = Sofa.Core.Snapshot_Python

root.executeSaveSnapshotVisitor(snapshot)

root.executeLoadSnapshotVisitor(snapshot,0)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant