pub struct Project {
pub name: String,
pub scene: Scene,
pub library: Library,
}Expand description
The document: scene graph plus asset library. Saved as pretty JSON
(.wbproj) so projects stay diff-able and hand-editable.
Fields§
§name: String§scene: Scene§library: LibraryImplementations§
Source§impl Project
impl Project
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Serialization used by Self::save; the GUI compares it against the
last saved state to detect unsaved changes (close dialog).
pub fn save(&self, path: impl AsRef<Path>) -> Result<()>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Sourcepub fn validate_structure(&self) -> Result<()>
pub fn validate_structure(&self) -> Result<()>
Structural sanity check for loaded files: parent/child cycles in the
scene and joint parent cycles in skeletons would send the recursive
helpers (world_transform, walk, global_transform) into endless
recursion. Reject such files at load time instead of crashing later.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Project
impl<'de> Deserialize<'de> for Project
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Project
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnsafeUnpin for Project
impl UnwindSafe for Project
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more