This commit is contained in:
1 parent
f29712d158
commit
3e053a81ab
123 files changed
+31930
-1404
No files matched your search
@@ -1,7 +1,40 @@
|
||||
//! Thumbnail generation job descriptor.
|
||||
|
||||
use shared::MaterialDesc;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ThumbnailJob {
|
||||
pub cache_key: String,
|
||||
pub model_path: 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: 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user