This commit is contained in:
commit
f29712d158
259 files changed
+52069
No files matched your search
@@ -0,0 +1,33 @@
|
||||
//! Model file sources for the thumbnail render studio.
|
||||
|
||||
mod fbx;
|
||||
pub(crate) mod gltf;
|
||||
|
||||
pub use fbx::FbxThumbnailSource;
|
||||
pub use gltf::GltfThumbnailSource;
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
/// Spawns untextured or scene-root preview content under `root` for the thumbnail studio.
|
||||
pub trait ThumbnailModelSource: Send + Sync {
|
||||
fn spawn_preview(
|
||||
&self,
|
||||
commands: &mut Commands,
|
||||
meshes: &mut Assets<Mesh>,
|
||||
materials: &mut Assets<StandardMaterial>,
|
||||
root: Entity,
|
||||
catalog_path: &str,
|
||||
) -> bool;
|
||||
}
|
||||
|
||||
pub fn source_for_extension(path: &str) -> Option<&'static dyn ThumbnailModelSource> {
|
||||
if path.ends_with(".fbx") {
|
||||
Some(&FbxThumbnailSource)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn uses_scene_root(path: &str) -> bool {
|
||||
!path.ends_with(".fbx")
|
||||
}
|
||||
Reference in new issue
Block a user