Upgrade to Bevy 0.19 and harden editor workflows
CI / Format, lint, test, build (push) Has been cancelled
CI / Format, lint, test, build (push) Has been cancelled
This commit is contained in:
1 parent
3f85d25cc7
commit
b5e561904c
204 files changed
+6972
-29907
No files matched your search
@@ -25,42 +25,27 @@ impl Default for AssetId {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum ModelPlacementMode {
|
||||
#[default]
|
||||
StaticAsset,
|
||||
SceneInstance,
|
||||
}
|
||||
|
||||
impl Default for ModelPlacementMode {
|
||||
fn default() -> Self {
|
||||
Self::StaticAsset
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum ModelHierarchyMode {
|
||||
#[default]
|
||||
SingleActor,
|
||||
SourceHierarchy,
|
||||
}
|
||||
|
||||
impl Default for ModelHierarchyMode {
|
||||
fn default() -> Self {
|
||||
Self::SingleActor
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum MaterialImportPolicy {
|
||||
#[default]
|
||||
SourceMaterials,
|
||||
AuthoringOverride,
|
||||
}
|
||||
|
||||
impl Default for MaterialImportPolicy {
|
||||
fn default() -> Self {
|
||||
Self::SourceMaterials
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
pub struct ImportSettings {
|
||||
pub scale: f32,
|
||||
|
||||
@@ -59,14 +59,13 @@ pub fn apply_texture_operator(
|
||||
) -> bool {
|
||||
let label = format!("Apply Texture {}", asset.label);
|
||||
let availability = selection_availability(world, selected);
|
||||
let selected = selected;
|
||||
run_immediate_operator(
|
||||
world,
|
||||
"assets.apply_texture",
|
||||
&label,
|
||||
availability,
|
||||
move |world| {
|
||||
apply_texture_to_selection(world, &asset, &selected);
|
||||
apply_texture_to_selection(world, &asset, selected);
|
||||
Ok(())
|
||||
},
|
||||
)
|
||||
@@ -79,14 +78,13 @@ pub fn apply_material_operator(
|
||||
) -> bool {
|
||||
let label = format!("Apply Material {}", asset.label);
|
||||
let availability = selection_availability(world, selected);
|
||||
let selected = selected;
|
||||
run_immediate_operator(
|
||||
world,
|
||||
"assets.apply_material",
|
||||
&label,
|
||||
availability,
|
||||
move |world| {
|
||||
apply_material_asset_to_selection(world, &asset, &selected);
|
||||
apply_material_asset_to_selection(world, &asset, selected);
|
||||
Ok(())
|
||||
},
|
||||
)
|
||||
|
||||
@@ -206,9 +206,9 @@ fn build_static_mesh_manifest(record: &AssetRecord) -> Result<StaticMeshManifest
|
||||
scale: record.import_settings.scale,
|
||||
generate_collider: record.import_settings.generate_collider,
|
||||
lod0_only: record.import_settings.lod0_only,
|
||||
placement_mode: record.import_settings.placement_mode.clone(),
|
||||
hierarchy_mode: record.import_settings.hierarchy_mode.clone(),
|
||||
material_policy: record.import_settings.material_policy.clone(),
|
||||
placement_mode: record.import_settings.placement_mode,
|
||||
hierarchy_mode: record.import_settings.hierarchy_mode,
|
||||
material_policy: record.import_settings.material_policy,
|
||||
};
|
||||
|
||||
let mut manifest = match format.as_str() {
|
||||
|
||||
@@ -199,7 +199,7 @@ impl AssetThumbnailCache {
|
||||
key.clone(),
|
||||
ThumbnailJobSource::MaterialAsset {
|
||||
label: material.label.clone(),
|
||||
material: material.material,
|
||||
material: Box::new(material.material),
|
||||
},
|
||||
) {
|
||||
self.studio_pending.insert(key);
|
||||
|
||||
@@ -24,7 +24,7 @@ pub enum ThumbnailJobSource {
|
||||
},
|
||||
MaterialAsset {
|
||||
label: String,
|
||||
material: MaterialDesc,
|
||||
material: Box<MaterialDesc>,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ use bevy::math::bounding::Aabb3d;
|
||||
use bevy::mesh::VertexAttributeValues;
|
||||
use bevy::prelude::*;
|
||||
use bevy::render::render_resource::TextureFormat;
|
||||
use bevy::scene::SceneRoot;
|
||||
use bevy_egui::EguiUserTextures;
|
||||
use shared::{material_from_desc, ModelRef};
|
||||
|
||||
@@ -134,6 +133,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
||||
ThumbnailStudioLayer,
|
||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||
Camera3d::default(),
|
||||
Msaa::Off,
|
||||
Camera {
|
||||
is_active: false,
|
||||
order: -50,
|
||||
@@ -157,7 +157,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||
DirectionalLight {
|
||||
illuminance: 12_000.0,
|
||||
shadows_enabled: false,
|
||||
shadow_maps_enabled: false,
|
||||
..default()
|
||||
},
|
||||
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.8, 0.9, 0.0)),
|
||||
@@ -172,7 +172,7 @@ fn setup_thumbnail_studio(mut commands: Commands, mut images: ResMut<Assets<Imag
|
||||
RenderLayers::layer(THUMBNAIL_LAYER),
|
||||
DirectionalLight {
|
||||
illuminance: 3_500.0,
|
||||
shadows_enabled: false,
|
||||
shadow_maps_enabled: false,
|
||||
..default()
|
||||
},
|
||||
Transform::from_rotation(Quat::from_euler(EulerRot::XYZ, -0.4, -2.2, 0.0)),
|
||||
@@ -380,7 +380,7 @@ fn spawn_thumbnail_job_content(
|
||||
match source {
|
||||
ThumbnailJobSource::Model { model_path } => {
|
||||
if uses_scene_root(model_path) {
|
||||
commands.entity(root).insert(SceneRoot(
|
||||
commands.entity(root).insert(WorldAssetRoot(
|
||||
asset_server.load(model_scene_asset_path(model_path, 0)),
|
||||
));
|
||||
}
|
||||
@@ -494,6 +494,10 @@ fn finish_active_thumbnail(
|
||||
studio.cooldown_frames = COOLDOWN_FRAMES;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::too_many_arguments,
|
||||
reason = "thumbnail failure coordinates the job, cache, render target, and camera state"
|
||||
)]
|
||||
fn fail_active_thumbnail(
|
||||
commands: &mut Commands,
|
||||
studio: &mut ThumbnailStudio,
|
||||
|
||||
Reference in new issue
Block a user