use bevy::asset::AssetPath;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FbxAssetLabel {
Scene(usize),
Mesh(usize),
Material(usize),
Animation(usize),
AnimationStack(usize),
Skeleton(usize),
Node(usize),
Skin(usize),
Light(usize),
Camera(usize),
Texture(usize),
DefaultScene,
DefaultMaterial,
RootNode,
}
impl core::fmt::Display for FbxAssetLabel {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
FbxAssetLabel::Scene(index) => f.write_str(&format!("Scene{index}")),
FbxAssetLabel::Mesh(index) => f.write_str(&format!("Mesh{index}")),
FbxAssetLabel::Material(index) => f.write_str(&format!("Material{index}")),
FbxAssetLabel::Animation(index) => f.write_str(&format!("Animation{index}")),
FbxAssetLabel::AnimationStack(index) => f.write_str(&format!("AnimationStack{index}")),
FbxAssetLabel::Skeleton(index) => f.write_str(&format!("Skeleton{index}")),
FbxAssetLabel::Node(index) => f.write_str(&format!("Node{index}")),
FbxAssetLabel::Skin(index) => f.write_str(&format!("Skin{index}")),
FbxAssetLabel::Light(index) => f.write_str(&format!("Light{index}")),
FbxAssetLabel::Camera(index) => f.write_str(&format!("Camera{index}")),
FbxAssetLabel::Texture(index) => f.write_str(&format!("Texture{index}")),
FbxAssetLabel::DefaultScene => f.write_str("DefaultScene"),
FbxAssetLabel::DefaultMaterial => f.write_str("DefaultMaterial"),
FbxAssetLabel::RootNode => f.write_str("RootNode"),
}
}
}
impl FbxAssetLabel {
pub fn from_asset(&self, path: impl Into<AssetPath<'static>>) -> AssetPath<'static> {
path.into().with_label(self.to_string())
}
}