StudioMode switch for full-editor capabilities (#23)

This PR adds a `StudioMode` resource to toggle editing capabilities, and
configures the frontend application to read the desired mode from a URL
parameter.

For now, setting the app to `StudioMode::Viewer` with
`<app-url>?mode=viewer` hides the Transform Toolbar and disables most of
the interactive features of the app, but otherwise exhibits the same
behavior as `StudioMode::Editor` / `<app-url>?mode=studio`.

In the future, the "Viewer" and "Editor" modes will receive different
initialization inputs to better serve the needs of their use cases. In
particular:

* The "Viewer" mode will accept a BVH animation handle, which should be
  played in a loop on a simple mannequin asset, allowing a user to preview
  a given animation before using it within the full studio workflow.
* The "Editor" mode will accept a full Bevy scene handle which can be
  edited and saved to the user's account. These scenes will serve as the
  basis for the generative-AI workflows Storyteller Studio is ultimately
  seeking to facilitate.
* It will likely be useful for "Editor" mode to alternatively accept
  only a BVH animation handle, which would be used to initialize a new
  scene for editing similar to "Viewer" mode, but with editing
  capabilities enabled.
This commit is contained in:
Danny McGee
2024-01-18 13:56:46 -05:00
committed by GitHub
parent 3ef34ccd8c
commit 5f62a4024b
6 changed files with 148 additions and 32 deletions
+3 -1
View File
@@ -5,6 +5,8 @@ use bevy::{
};
use space_editor::prelude::space_undo::UndoRedo;
use crate::is_editor;
#[derive(SystemSet, Hash, Debug, PartialEq, Eq, Clone)]
pub struct StudioInputSystem;
@@ -31,7 +33,7 @@ impl Plugin for StudioInputPlugin {
translate_debug_toggle,
translate_dcc_camera_events,
translate_fps_camera_events,
send_undo_event,
send_undo_event.run_if(is_editor),
)
.in_set(StudioInputSystem)
.after(bevy::input::InputSystem)