fix headless failure

This commit is contained in:
rewin
2024-04-02 22:14:53 +03:00
parent 1d3c309c20
commit 6500031f6b
5 changed files with 66 additions and 39 deletions
Generated
+8 -8
View File
@@ -6082,7 +6082,7 @@ dependencies = [
[[package]]
name = "space_bevy_xpbd_plugin"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"bevy-inspector-egui",
@@ -6093,7 +6093,7 @@ dependencies = [
[[package]]
name = "space_editor"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"space_bevy_xpbd_plugin",
@@ -6104,7 +6104,7 @@ dependencies = [
[[package]]
name = "space_editor_core"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"bevy_egui",
@@ -6119,7 +6119,7 @@ dependencies = [
[[package]]
name = "space_editor_ui"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"anyhow",
"bevy",
@@ -6147,7 +6147,7 @@ dependencies = [
[[package]]
name = "space_persistence"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"ron",
@@ -6157,7 +6157,7 @@ dependencies = [
[[package]]
name = "space_prefab"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"bevy-inspector-egui",
@@ -6171,7 +6171,7 @@ dependencies = [
[[package]]
name = "space_shared"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"anyhow",
"bevy",
@@ -6184,7 +6184,7 @@ dependencies = [
[[package]]
name = "space_undo"
version = "0.5.0"
source = "git+https://github.com/rewin123/space_editor?rev=948090e407558017874de491c5297aa1d2e9d21e#948090e407558017874de491c5297aa1d2e9d21e"
source = "git+https://github.com/rewin123/space_editor?rev=0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b#0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"
dependencies = [
"bevy",
"pretty-type-name",
+1 -1
View File
@@ -48,7 +48,7 @@ futures = "0.3.30"
image = "0.25.0"
bytemuck = "1.14.1"
space_editor = {git = "https://github.com/rewin123/space_editor", rev = "948090e407558017874de491c5297aa1d2e9d21e"}
space_editor = {git = "https://github.com/rewin123/space_editor", rev = "0f15c0d6b6b5864f4a05a2d57dfc2066e96d1a3b"}
anyhow.workspace = true
serde_repr = "0.1.18"
wasm-bindgen-futures = "0.4"
+41 -29
View File
@@ -9,6 +9,7 @@ use space_editor::{
space_editor_ui::{tools::gizmo::GizmoToolPlugin, EditorPluginGroup},
};
use crate::StudioMode;
use crate::{
anim::SkeletalJoint,
camera_controller::{CameraController, CameraMotionSystem},
@@ -57,37 +58,48 @@ impl Plugin for DebugPlugin {
),
);
//space_editor stuff
// app.add_plugins(UndoPlugin);
app.add_plugins(
EditorPluginGroup
.build()
.disable::<EditorUiCore>()
.add_before::<GameViewPlugin, _>(EditorUiCore {
disable_no_editor_cams: false,
})
// .disable::<EguiPlugin>()
.disable::<DefaultInspectorConfigPlugin>()
.disable::<EditorPickingPlugin>()
.disable::<EditorDefaultCameraPlugin>()
// .disable::<BottomMenuPlugin>()
.disable::<GizmoToolPlugin>()
// .disable::<EditorGizmoConfigPlugin>()
// .disable::<MeshlessVisualizerPlugin>()
.disable::<space_editor::prelude::SelectedPlugin>(),
);
let editor_ui_group = EditorPluginGroup
.build()
.disable::<EditorUiCore>()
.add_before::<GameViewPlugin, _>(EditorUiCore {
disable_no_editor_cams: false,
})
// .disable::<EguiPlugin>()
.disable::<DefaultInspectorConfigPlugin>()
.disable::<EditorPickingPlugin>()
.disable::<EditorDefaultCameraPlugin>()
// .disable::<BottomMenuPlugin>()
.disable::<GizmoToolPlugin>()
// .disable::<EditorGizmoConfigPlugin>()
// .disable::<MeshlessVisualizerPlugin>()
.disable::<space_editor::prelude::SelectedPlugin>();
app.auto_undo::<Handle<StandardMaterial>>();
app.auto_undo::<SkeletalJoint>();
app.auto_undo::<Handle<Mesh>>();
app.auto_undo::<SceneElement>();
app.auto_undo::<Selectable>();
let mut only_core = false;
app.add_systems(Update, sync_editor_camera);
app.add_systems(
Update,
update_editor_ui_mode.run_if(resource_changed::<DebugMode>),
);
if let Some(state) = app.world.get_resource::<StudioMode>() {
if *state == StudioMode::Headless {
only_core = true;
}
}
if only_core {
app
.add_plugins(PrefabPlugin)
.add_plugins(EditorCore);
} else {
app.add_plugins(editor_ui_group);
app.auto_undo::<Handle<StandardMaterial>>();
app.auto_undo::<SkeletalJoint>();
app.auto_undo::<Handle<Mesh>>();
app.auto_undo::<SceneElement>();
app.auto_undo::<Selectable>();
app.add_systems(Update, sync_editor_camera);
app.add_systems(
Update,
update_editor_ui_mode.run_if(resource_changed::<DebugMode>),
);
}
}
}
+9
View File
@@ -1,11 +1,20 @@
use bevy::prelude::*;
use space_editor::prelude::*;
use crate::StudioMode;
pub struct PersistancePlugin;
impl Plugin for PersistancePlugin {
fn build(&self, app: &mut App) {
info!("PersistancePlugin::build");
if let Some(state) = app.world.get_resource::<StudioMode>() {
if *state == StudioMode::Headless {
return;
}
}
app.editor_tab_by_trait(
EditorTabName::Other("Persistance".to_string()),
DebugPersistanceTab::default(),
+7 -1
View File
@@ -20,7 +20,7 @@ use space_editor::{
};
use wasm_bindgen::prelude::*;
use crate::material::short_material::ShortMaterial;
use crate::{material::short_material::ShortMaterial, StudioMode};
use crate::{
interaction::Selection,
wasm::{self, StaticBuffer, WasmMessageBuffer},
@@ -30,6 +30,12 @@ pub struct InspectorPlugin;
impl Plugin for InspectorPlugin {
fn build(&self, app: &mut App) {
if let Some(state) = app.world.get_resource::<StudioMode>() {
if *state == StudioMode::Headless {
return;
}
}
app.init_resource::<EntityDescription>();
app.add_event::<UpdateEntityDescription>();