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
impl BinRead for LightWaveObject
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>
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>
Source§fn read<R>(reader: &mut R) -> Result<Self, Error>
fn read<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments. Read moreSource§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments and assuming
big-endian byte order. Read moreSource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments and assuming
little-endian byte order. Read moreSource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T
from the reader assuming native-endian byte order. Read moreSource§fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self
from the reader using the given arguments. Read moreSource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self
from the reader, assuming big-endian byte order, using the
given arguments. Read moreSource§fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self
from the reader, assuming little-endian byte order, using
the given arguments. Read more