Skip to content

[Part 2 of 2]--SceneInstance snapshot and save.#1568

Merged
jturner65 merged 28 commits intofacebookresearch:mainfrom
jturner65:SI_SceneInstanceSave
Nov 23, 2021
Merged

[Part 2 of 2]--SceneInstance snapshot and save.#1568
jturner65 merged 28 commits intofacebookresearch:mainfrom
jturner65:SI_SceneInstanceSave

Conversation

@jturner65
Copy link
Copy Markdown
Contributor

@jturner65 jturner65 commented Nov 16, 2021

Motivation and Context

This PR provides the functionality to build a scene instance from the current simulation state and to properly save that scene instance to a JSON file. Saving Attributes to JSON has also been improved for all appropriate Attributes classes.

Functionality being introduced :

  • Create a SceneInstanceAttributes based on the current scene state on demand. This will facilitate creating scenes with stable physics on load.
  • Save all metadata::Attributes (including SceneInstanceAttributes) to disk as JSON based on expected format. The existing functionality provided a generic mechanism to save Configuration values and subconfigs to JSON files, but the various metadata::Attributes classes should only save a subset of their fields as JSON (there are internal fields that have programmatic use but are not appropriate to expose). This PR provides customized handling for each class, to only save the fields, and subconfigs, that are desired to be saved.
  • Existing test has been modified to verify all save/load processes are acting as expected.

Some extra information :
Viewer.cpp has been modified to provide a key-stroke to record the current scene instance, saving it to disk with the same name along with an increment (copy xxxx). Repeatedly saving the scene instance will increase the increment. An unintended, but welcome, consequence of this is that the newly saved scene instance is immediately available to cycle to via Tab/Shift-tab, where it will be loaded in and displayed.

A mechanism is also provided for saving with a new, user-provided, name, which will forcibly overwrite any existing scene instance configs with the same name.

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Nov 16, 2021
@jturner65 jturner65 requested a review from aclegg3 November 16, 2021 17:37
@jturner65 jturner65 force-pushed the SI_SceneInstanceSave branch 10 times, most recently from 3df91f0 to d86d51f Compare November 18, 2021 20:00
@Skylion007 Skylion007 self-requested a review November 19, 2021 15:58
@jturner65 jturner65 changed the title [WIP][Part 2 of 2]--SceneInstance snapshot and save. [Part 2 of 2]--SceneInstance snapshot and save. Nov 22, 2021
@jturner65 jturner65 marked this pull request as ready for review November 22, 2021 20:44
Copy link
Copy Markdown
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread src/esp/physics/PhysicsManager.h Outdated
}
/**
* @brief This will populate the passed @p sceneInstanceAttrs with the current
* stage, object and articulated object insttances reflecting the currernt
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* stage, object and articulated object insttances reflecting the currernt
* stage, object and articulated object instances reflecting the current

@jturner65 jturner65 force-pushed the SI_SceneInstanceSave branch from 31513b7 to 25a23c8 Compare November 23, 2021 16:23
@jturner65 jturner65 merged commit 71e358f into facebookresearch:main Nov 23, 2021
@jturner65 jturner65 deleted the SI_SceneInstanceSave branch November 23, 2021 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants