mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-11 21:41:10 +00:00
1687bfd6ed
This PR adds support for BVH animation files, with a custom animation player and retargeting solution for our Blender Rigify-based skeletal meshes. --------- Co-authored-by: Brooks Palin <brookspalin710@gmail.com>
39 lines
741 B
Rust
39 lines
741 B
Rust
use core::fmt;
|
|
|
|
use anyhow::anyhow;
|
|
use bevy::prelude::Deref;
|
|
|
|
#[derive(Debug, Deref)]
|
|
pub struct Error(pub anyhow::Error);
|
|
|
|
impl From<anyhow::Error> for Error {
|
|
fn from(value: anyhow::Error) -> Self {
|
|
Self(value)
|
|
}
|
|
}
|
|
|
|
pub trait Anyhow<T> {
|
|
fn anyhow(self) -> anyhow::Result<T>;
|
|
}
|
|
|
|
impl<T, E> Anyhow<T> for Result<T, E>
|
|
where
|
|
E: std::error::Error,
|
|
{
|
|
fn anyhow(self) -> anyhow::Result<T> {
|
|
self.map_err(|err| anyhow!("{err}"))
|
|
}
|
|
}
|
|
|
|
impl std::error::Error for Error {
|
|
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
|
self.0.source()
|
|
}
|
|
}
|
|
|
|
impl fmt::Display for Error {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(f, "{}", **self)
|
|
}
|
|
}
|