Struct LightWaveObject

Source
pub struct LightWaveObject {
    pub file_size: u32,
    pub data: Vec<Tag>,
}
Expand description

The data in LightWave 3D® object files comprise the points, polygons and surfaces that describe the geometry and appearance of an object. “Polygons” here means any of several geometric elements (faces, curves or patches, for example) defined by an ordered list of points, and “surfaces” refers to the collection of attributes, sometimes called materials, that define the visual surface properties of polygons.

Object files can contain multiple layers, or parts, and each part can be a single connected mesh or several disjoint meshes. They may also contain one or more surface definitions with no points or polygons at all. Surface definitions can include references to other files (images, for example), plug-ins, and envelopes containing parameter values that vary over time.

This document outlines the object file format and provides a detailed reference for each of the components. The component descriptions include both a regular expression defining the syntax and a discussion of the contents. See also the Examples supplement, a more conversational introduction to the format that includes annotated listings of file contents as well as several sample files. Informally, object files start with the four bytes “FORM” followed by a four-byte integer giving the length of the file (minus 8) and the four byte ID “LWO2”. The remainder of the data is a collection of chunks, some of which will contain subchunks.

To be read, IFF files must be parsed. The order in which chunks can occur in a file isn’t fixed. Some chunks, however, contain data that depends on the contents of other chunks, and this fixes a relative order for the chunks involved. Chunks and subchunks also depend on context for their meaning. The CHAN subchunk in an envelope chunk isn’t the same thing as the CHAN subchunk in a surface block. And you may encounter chunks that aren’t defined here, which you should be prepared to skip gracefully if you don’t understand them. You can do this by using the chunk size to seek to the next chunk.

Fields§

§file_size: u32§data: Vec<Tag>

Implementations§

Trait Implementations§

Source§

impl BinRead for LightWaveObject

Source§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of read_args() and read_options(). Read more
Source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_>, ) -> BinResult<Self>

Read Self from the reader using the given Endian and arguments. Read more
Source§

fn read<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments. Read more
Source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
Source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
Source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
Source§

fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek, Self: ReadEndian,

Read Self from the reader using the given arguments. Read more
Source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
Source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
Source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
Source§

fn after_parse<R>( &mut self, _: &mut R, _: Endian, _: Self::Args<'_>, ) -> Result<(), Error>
where R: Read + Seek,

Runs any post-processing steps required to finalize construction of the object. Read more
Source§

impl Debug for LightWaveObject

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ReadEndian for LightWaveObject

Source§

const ENDIAN: EndianKind

The endianness of the type.
Source§

impl ReadMagic for LightWaveObject

Source§

const MAGIC: Self::MagicType

The magic number.
Source§

type MagicType = [u8; 4]

The type of the magic number.

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.