Skip to main content

gltf_reader/
scene.rs

1use alloc::borrow::Cow;
2use alloc::vec::Vec;
3use ownable::IntoOwned;
4use serde::Deserialize;
5
6use crate::node::Node;
7use crate::{Extensions, Extras, Idx};
8
9/// The root nodes of a scene.
10#[derive(Debug, Clone, Deserialize, IntoOwned)]
11pub struct Scene<'a> {
12    /// The user-defined name of this object.
13    #[serde(borrow)]
14    pub name: Option<Cow<'a, str>>,
15
16    /// The indices of each root node.
17    #[serde(default)] // default instead of option for ergonomics
18    pub nodes: Vec<Idx<Node<'static>>>,
19
20    #[serde(borrow)]
21    pub extensions: Option<Extensions<'a>>,
22    #[serde(borrow)]
23    pub extras: Option<Extras<'a>>,
24}