Blacksite/crates/shared/src/rendering_profile_asset.rs
Rbanh f29712d158
Some checks are pending
CI / Format, lint, test, build (push) Waiting to run
Initial project import
2026-06-05 21:44:45 -04:00

22 lines
756 B
Rust

//! Named rendering override bundles under `assets/rendering_profiles/`.
use serde::{Deserialize, Serialize};
use crate::PostProcessVolumeOverrides;
/// RON preset: label plus override bundle applied to volumes or project drafts.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RenderingProfileAsset {
pub label: String,
pub overrides: PostProcessVolumeOverrides,
}
impl RenderingProfileAsset {
pub fn load_from_path(catalog_path: &str) -> Result<Self, String> {
let text = std::fs::read_to_string(catalog_path)
.map_err(|err| format!("could not read {catalog_path}: {err}"))?;
ron::from_str(&text)
.map_err(|err| format!("invalid rendering profile RON in {catalog_path}: {err}"))
}
}