Blacksite/crates/editor/src/assets/thumbnails/job.rs
Rbanh b5e561904c
Some checks failed
CI / Format, lint, test, build (push) Has been cancelled
Upgrade to Bevy 0.19 and harden editor workflows
2026-07-09 23:43:47 -04:00

41 lines
901 B
Rust

//! Thumbnail generation job descriptor.
use shared::MaterialDesc;
#[derive(Debug, Clone)]
pub struct ThumbnailJob {
pub cache_key: String,
pub source: ThumbnailJobSource,
}
#[derive(Debug, Clone)]
pub enum ThumbnailJobSource {
Model {
model_path: String,
},
MeshSubAsset {
model_path: String,
mesh_label: String,
material_label: Option<String>,
},
SourceMaterial {
model_path: String,
material_label: String,
},
MaterialAsset {
label: String,
material: Box<MaterialDesc>,
},
}
impl ThumbnailJobSource {
pub fn label(&self) -> &str {
match self {
Self::Model { model_path }
| Self::MeshSubAsset { model_path, .. }
| Self::SourceMaterial { model_path, .. } => model_path,
Self::MaterialAsset { label, .. } => label,
}
}
}