Skip to main content

SceneEdit

Struct SceneEdit 

Source
pub struct SceneEdit { /* private fields */ }

Implementations§

Source§

impl SceneEdit

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, EditError>

Source

pub fn path(&self) -> PathBuf

Source

pub fn root(&self) -> &Path

Source

pub fn scene(&self) -> &Scene

Source

pub fn project(&self) -> &Project

Source

pub fn files(&self) -> impl Iterator<Item = PathBuf> + '_

Source

pub fn text(&self, file: impl AsRef<Path>) -> Option<&str>

Source

pub fn reload(&mut self) -> Result<(), EditError>

Source

pub fn can_undo(&self) -> bool

Source

pub fn can_redo(&self) -> bool

Source

pub fn undo_label(&self) -> Option<&str>

Source

pub fn redo_label(&self) -> Option<&str>

Source

pub fn begin(&mut self, label: &str) -> Result<(), EditError>

Source

pub fn end(&mut self) -> Option<PatchGroup>

Source

pub fn cancel(&mut self) -> Result<(), EditError>

Source

pub fn apply(&mut self, group: &PatchGroup) -> Result<(), EditError>

Source

pub fn dry_run<T>( &mut self, edits: impl FnOnce(&mut Self) -> Result<T, EditError>, ) -> Result<PatchGroup, EditError>

Source

pub fn undo(&mut self) -> Result<Option<PatchGroup>, EditError>

Source

pub fn redo(&mut self) -> Result<Option<PatchGroup>, EditError>

Source

pub fn set( &mut self, target: &Target, path: &[&str], value: impl Into<Value>, ) -> Result<PatchGroup, EditError>

Source

pub fn unset( &mut self, target: &Target, path: &[&str], ) -> Result<PatchGroup, EditError>

Source

pub fn push( &mut self, target: &Target, path: &[&str], value: impl Into<Value>, ) -> Result<PatchGroup, EditError>

Source

pub fn remove(&mut self, target: &Target) -> Result<PatchGroup, EditError>

Source

pub fn add( &mut self, kind: Kind, id: Id, name: &str, fields: &[(&str, Value)], file: Option<&Path>, ) -> Result<PatchGroup, EditError>

Source

pub fn add_material( &mut self, name: &str, id: Id, material: &Material, file: Option<&Path>, ) -> Result<PatchGroup, EditError>

Source

pub fn duplicate_object( &mut self, name: &str, new: &str, id: Id, ) -> Result<PatchGroup, EditError>

Source

pub fn rename_object( &mut self, name: &str, new: &str, ) -> Result<PatchGroup, EditError>

Source

pub fn set_at( &mut self, object: &str, at: [f32; 3], ) -> Result<PatchGroup, EditError>

Source

pub fn set_rotate( &mut self, object: &str, rotate: [f32; 3], ) -> Result<PatchGroup, EditError>

Source

pub fn set_scale( &mut self, object: &str, scale: impl Into<Value>, ) -> Result<PatchGroup, EditError>

Source

pub fn set_object_material( &mut self, object: &str, material: Option<&str>, ) -> Result<PatchGroup, EditError>

Source

pub fn set_object_materials( &mut self, object: &str, materials: &[(&str, &str)], ) -> Result<PatchGroup, EditError>

Source

pub fn set_shadow( &mut self, object: &str, shadow: &str, ) -> Result<PatchGroup, EditError>

Source

pub fn set_two_sided( &mut self, object: &str, on: bool, ) -> Result<PatchGroup, EditError>

Source

pub fn set_hidden( &mut self, object: &str, on: bool, ) -> Result<PatchGroup, EditError>

Source

pub fn set_clip( &mut self, object: &str, planes: &[[f32; 4]], ) -> Result<PatchGroup, EditError>

Source

pub fn set_parent( &mut self, object: &str, parent: Option<&str>, ) -> Result<PatchGroup, EditError>

Source

pub fn add_mesh( &mut self, id: Id, name: &str, file: &str, node: Option<&str>, ) -> Result<PatchGroup, EditError>

Source

pub fn set_node( &mut self, mesh: &str, node: &str, key: &str, value: impl Into<Value>, ) -> Result<PatchGroup, EditError>

Source

pub fn set_material( &mut self, name: &str, path: &[&str], value: impl Into<Value>, ) -> Result<PatchGroup, EditError>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.