WmoEditor

Struct WmoEditor 

Source
pub struct WmoEditor { /* private fields */ }
Expand description

WMO editor for modifying WMO files

Implementations§

Source§

impl WmoEditor

Source

pub fn new(root: WmoRoot) -> Self

Create a new WMO editor from a root WMO file

Source

pub fn add_group(&mut self, group: WmoGroup) -> Result<()>

Add a group to the editor

Source

pub fn root(&self) -> &WmoRoot

Get a reference to the root WMO

Source

pub fn root_mut(&mut self) -> &mut WmoRoot

Get a mutable reference to the root WMO

Source

pub fn group(&self, index: usize) -> Option<&WmoGroup>

Get a reference to a specific group

Source

pub fn group_mut(&mut self, index: usize) -> Option<&mut WmoGroup>

Get a mutable reference to a specific group

Source

pub fn group_count(&self) -> usize

Get the number of groups

Source

pub fn is_group_loaded(&self, index: usize) -> bool

Check if a specific group has been loaded

Source

pub fn is_group_modified(&self, index: usize) -> bool

Check if a specific group has been modified

Source

pub fn is_root_modified(&self) -> bool

Check if the root has been modified

Source

pub fn convert_to_version(&mut self, target_version: WmoVersion) -> Result<()>

Convert to a specific version

Source

pub fn original_version(&self) -> WmoVersion

Get the original version of the WMO

Source

pub fn current_version(&self) -> WmoVersion

Get the current version of the WMO

Source

pub fn save_root<W: Write + Seek>(&self, writer: &mut W) -> Result<()>

Save the root WMO to a writer

Source

pub fn save_group<W: Write + Seek>( &self, writer: &mut W, index: usize, ) -> Result<()>

Save a specific group to a writer

Source

pub fn add_material(&mut self, material: WmoMaterial) -> usize

Add a new material

Source

pub fn remove_material(&mut self, index: usize) -> Result<WmoMaterial>

Remove a material

Source

pub fn material(&self, index: usize) -> Option<&WmoMaterial>

Get a reference to a material

Source

pub fn material_mut(&mut self, index: usize) -> Option<&mut WmoMaterial>

Get a mutable reference to a material

Source

pub fn add_texture(&mut self, texture: String) -> usize

Add a new texture

Source

pub fn remove_texture(&mut self, index: usize) -> Result<String>

Remove a texture

Source

pub fn texture(&self, index: usize) -> Option<&String>

Get a reference to a texture

Source

pub fn texture_mut(&mut self, index: usize) -> Option<&mut String>

Get a mutable reference to a texture

Source

pub fn create_group(&mut self, name: String) -> usize

Create a new group

Source

pub fn remove_group(&mut self, index: usize) -> Result<WmoGroupInfo>

Remove a group

Source

pub fn add_vertex(&mut self, group_index: usize, vertex: Vec3) -> Result<usize>

Add a vertex to a group

Source

pub fn remove_vertex( &mut self, group_index: usize, vertex_index: usize, ) -> Result<Vec3>

Remove a vertex from a group

Source

pub fn recalculate_group_bounding_box( &mut self, group_index: usize, ) -> Result<()>

Recalculate the bounding box for a group

Source

pub fn recalculate_global_bounding_box(&mut self) -> Result<()>

Recalculate the global bounding box

Source

pub fn add_doodad(&mut self, doodad: WmoDoodadDef) -> usize

Add a doodad definition

Source

pub fn remove_doodad(&mut self, index: usize) -> Result<WmoDoodadDef>

Remove a doodad definition

Source

pub fn add_doodad_set(&mut self, set: WmoDoodadSet) -> usize

Doodad set manipulation methods Add a doodad set

Source

pub fn remove_doodad_set(&mut self, index: usize) -> Result<WmoDoodadSet>

Remove a doodad set

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more