diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 33225c6..155b3f3 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -242,12 +242,82 @@ dependencies = [
"weezl",
]
+[[package]]
+name = "glam"
+version = "0.23.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e4afd9ad95555081e109fe1d21f2a30c691b5f0919c67dfa690a2e1eb6bd51c"
+
[[package]]
name = "glob"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+[[package]]
+name = "godot"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "godot-core",
+ "godot-macros",
+]
+
+[[package]]
+name = "godot-bindings"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "godot4-prebuilt",
+]
+
+[[package]]
+name = "godot-codegen"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "godot-bindings",
+ "heck",
+ "nanoserde",
+ "proc-macro2",
+ "quote",
+]
+
+[[package]]
+name = "godot-core"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "glam",
+ "godot-codegen",
+ "godot-ffi",
+]
+
+[[package]]
+name = "godot-ffi"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "godot-bindings",
+ "godot-codegen",
+ "paste",
+]
+
+[[package]]
+name = "godot-macros"
+version = "0.1.0"
+source = "git+https://github.com/godot-rust/gdext?branch=master#c0935ac122dd94983f0f790cd07d6c7629a7429e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "venial",
+]
+
+[[package]]
+name = "godot4-prebuilt"
+version = "0.0.0"
+source = "git+https://github.com/godot-rust/godot4-prebuilt?branch=4.0.1#f9e8cfec0ec565201801b02160ef836800746617"
+
[[package]]
name = "half"
version = "2.2.1"
@@ -257,6 +327,12 @@ dependencies = [
"crunchy",
]
+[[package]]
+name = "heck"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
+
[[package]]
name = "hermit-abi"
version = "0.2.6"
@@ -325,8 +401,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
[[package]]
-name = "lightwave"
+name = "lightwave-3d"
version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9e57b794415e79e3446e057c2c2cc9922c7a83261b2ac6be00b15191e9ed07e"
dependencies = [
"binrw",
]
@@ -364,7 +442,18 @@ name = "mhex"
version = "0.1.0"
dependencies = [
"glob",
- "lightwave",
+ "lightwave-3d",
+ "starforcelib",
+]
+
+[[package]]
+name = "mhgd"
+version = "0.1.0"
+dependencies = [
+ "godot",
+ "itertools",
+ "lightwave-3d",
+ "springylib",
"starforcelib",
]
@@ -396,6 +485,21 @@ dependencies = [
"getrandom",
]
+[[package]]
+name = "nanoserde"
+version = "0.1.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "755e7965536bc54d7c9fba2df5ada5bf835b0443fd613f0a53fa199a301839d3"
+dependencies = [
+ "nanoserde-derive",
+]
+
+[[package]]
+name = "nanoserde-derive"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed7a94da6c6181c35d043fc61c43ac96d3a5d739e7b8027f77650ba41504d6ab"
+
[[package]]
name = "num-integer"
version = "0.1.45"
@@ -448,6 +552,12 @@ version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
+[[package]]
+name = "paste"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
+
[[package]]
name = "pin-project"
version = "1.0.12"
@@ -671,6 +781,16 @@ version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
+[[package]]
+name = "venial"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "61584a325b16f97b5b25fcc852eb9550843a251057a5e3e5992d2376f3df4bb2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+]
+
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index aaf5114..dc762a7 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -1,3 +1,3 @@
[workspace]
-members = ["renderwarelib", "springylib", "starforcelib", "mhex", "lightwave"]
+members = ["renderwarelib", "springylib", "starforcelib", "mhex", "mhgd"]
diff --git a/rust/lightwave/Cargo.toml b/rust/lightwave/Cargo.toml
deleted file mode 100644
index 4032709..0000000
--- a/rust/lightwave/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
-[package]
-name = "lightwave"
-version = "1.0.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-binrw = "0.11.1"
diff --git a/rust/lightwave/README.md b/rust/lightwave/README.md
deleted file mode 100644
index d8c2943..0000000
--- a/rust/lightwave/README.md
+++ /dev/null
@@ -1,175 +0,0 @@
-# LightWave 3D Rust Parser
-
-Complete LWO2 parser for Rust.
-
-Basic Usage
-
-```rust
-use lightwave::LightWaveObject;
-
-fn main() {
- LightWaveObject::read_file("path/to/file.lwo");
- // or
- LightWaveObject::read(Cursor::new(vec![0x00, 0x01, ...]))
-}
-```
-
-## LightWave Object (LWO2)
-
-Fully feature complete following the [LWO2 Spec](http://static.lightwave3d.com/sdk/2015/html/filefmts/lwo2.html).
-
-| Chunk | Tag | Status |
-|--------------------------------------------|--------|--------|
-| Layer | `LAYR` | ✅ |
-| Point List | `PNTS` | ✅ |
-| Vertex Mapping | `VMAP` | ✅ |
-| Polygon List | `POLS` | ✅ |
-| Tag Strings | `TAGS` | ✅ |
-| Polygon Tag Mapping | `PTAG` | ✅ |
-| Discontinuous Vertex Mapping | `VMAD` | ✅ |
-| Vertex Map Parameter | `VMPA` | ✅ |
-| [Envelope Definition](#envelope-subchunks) | `ENVL` | ✅ |
-| [Image (-Sequence)](#clip-subchunks) | `CLIP` | ✅ |
-| [Surface Definition](#surface-subchunks) | `SURF` | ✅ |
-| Bounding Box | `BBOX` | ✅ |
-| Description Line | `DESC` | ✅ |
-| Commentary Text | `TEXT` | ✅ |
-| Thumbnail Icon Image | `ICON` | ✅ |
-
-
-### Envelope Subchunks
-
-| Chunk | Tag | Status |
-|--------------------------|--------|--------|
-| Envelope Type | `TYPE` | ✅ |
-| Pre-Behavior | `PRE` | ✅ |
-| Post-Behavior | `POST` | ✅ |
-| Keyframe Time and Value | `KEY` | ✅ |
-| Interval Interpolation | `SPAN` | ✅ |
-| Plugin Channel Modifiers | `CHAN` | ✅ |
-| Channel Name | `NAME` | ✅ |
-
-
-### Clip Subchunks
-
-| Chunk | Tag | Status |
-|----------------------|--------|--------|
-| Still Image | `STIL` | ✅ |
-| Image Sequence | `ISEQ` | ✅ |
-| Plugin Animation | `ANIM` | ✅ |
-| Reference (Clone) | `XREF` | ✅ |
-| Flag (Undocumented) | `FLAG` | ⚠️ |
-| Color-cycling Still | `STCC` | ✅ |
-| Time | `TIME` | ✅ |
-| Color Space RGB | `CLRS` | ✅ |
-| Color Space Alpha | `CLRA` | ✅ |
-| Image Filtering | `FILT` | ✅ |
-| Image Dithering | `DITH` | ✅ |
-| Contrast | `CONT` | ✅ |
-| Brightness | `BRIT` | ✅ |
-| Saturation | `SATR` | ✅ |
-| Hue | `HUE` | ✅ |
-| Gamma Correction | `GAMM` | ✅ |
-| Negative | `NEGA` | ✅ |
-| Plugin Image Filters | `IFLT` | ✅ |
-| Plugin Pixel Filters | `PFLT` | ✅ |
-
-
-### Surface Subchunks
-
-### Basic Surface Parameters
-
-| Chunk | Tag | Status |
-|-----------------------------------|----------------------------------------------------------|--------|
-| Base Color | `COLR` | ✅ |
-| Base Shading Values | `DIFF`
`LUMI`
`SPEC`
`REFL`
`TRAN`
`TRNL` | ✅ |
-| Specular Glossiness | `GLOS` | ✅ |
-| Diffuse Sharpness | `SHRP` | ✅ |
-| Bump Intensity | `BUMP` | ✅ |
-| Polygon Sidedness | `SIDE` | ✅ |
-| Max Smoothing Angle | `SMAN` | ✅ |
-| Reflection Options | `RFOP` | ✅ |
-| Reflection Map Image | `RIMG` | ✅ |
-| Reflection Map Image Seam Angle | `RSAN` | ✅ |
-| Reflection Blurring | `RBLR` | ✅ |
-| Refractive Index | `RIND` | ✅ |
-| Transparency Options | `TROP` | ✅ |
-| Refraction Map Image | `TIMG` | ✅ |
-| Refraction Blurring | `TBLR` | ✅ |
-| Color Highlights | `CLRH` | ✅ |
-| Color Filter | `CLRF` | ✅ |
-| Additive Transparency | `ADRT` | ✅ |
-| Glow Effect | `GLOW` | ✅ |
-| Render Outlines | `LINE` | ✅ |
-| Alpha Mode | `ALPH` | ✅ |
-| Vertex Color Map | `VCOL` | ✅ |
-| [Surface Blocks](#surface-blocks) | `BLOK` | 🚧 |
-
-### Surface Blocks
-
-Ordinal Strings:
-* ✅ [Image Texture Map](#image-texture-map) `IMAP`
-* ✅ [Procedural Texture](#procedural-texture) `PROC`
-* ✅ [Gradient Texture](#gradient-texture) `GRAD`
-* ✅ [Shader Plugin](#shaders) `SHDR`
-
-#### Shared
-
-| Chunk | Tag | Status |
-|-------------------------|--------|--------|
-| Texture Channel | `CHAN` | ✅ |
-| Enable State | `ENAB` | ✅ |
-| Opacity | `OPAC` | ✅ |
-| Displacement Axis | `AXIS` | ✅ |
-| Negative (Undocumented) | `NEGA` | ⚠️ |
-
-#### Texture Mapping
-
-| Chunk | Tag | Status |
-|---------------------|----------------------------|--------|
-| Positioning | `CNTR`
`SIZE`
`ROTA` | ✅ |
-| Reference Object | `OREF` | ✅ |
-| Falloff | `FALL` | ✅ |
-| Coordinate System | `CSYS` | ✅ |
-
-#### Image Texture Map
-
-| Chunk | Tag | Status |
-|-------------------------------------|------------------|--------|
-| [Texture Mapping](#texture-mapping) | `TMAP` | ✅ |
-| Projection Mode | `PROJ` | ✅ |
-| Major Axis | `AXIS` | ✅ |
-| Image Map | `IMAG` | ✅ |
-| Image Wrap Options | `WRAP` | ✅ |
-| Image Wrap Amount | `WRPW`
`WRPH` | ✅ |
-| UV Vertex Map | `VMAP` | ✅ |
-| Antialiasing Strength | `AAST` | ✅ |
-| Pixel Blending | `PIXB` | ✅ |
-| Sticky Projection | `STCK` | ✅ |
-| Texture Ampliture | `TAMP` | ✅ |
-
-#### Procedural Texture
-
-| Chunk | Tag | Status |
-|--------------------------|--------|--------|
-| Axis | `AXIS` | ✅ |
-| Basic Value | `VALU` | ✅ |
-| Algorithm and Parameters | `FUNC` | ✅ |
-
-#### Gradient Texture
-
-| Chunk | Tag | Status |
-|----------------|-------------------|--------|
-| Parameter Name | `PNAM` | ✅ |
-| Item Name | `INAM` | ✅ |
-| Gradient Range | `GRST`
`GREN` | ✅ |
-| Repeat Mode | `GRPT` | ✅ |
-| Key Values | `FKEY` | ✅ |
-| Key Parameters | `IKEY` | ✅ |
-
-#### Shaders
-
-
-| Chunk | Tag | Status |
-|------------------|--------|--------|
-| Shader Algorithm | `FUNC` | ✅ |
diff --git a/rust/lightwave/src/binrw_helpers.rs b/rust/lightwave/src/binrw_helpers.rs
deleted file mode 100644
index 3504faf..0000000
--- a/rust/lightwave/src/binrw_helpers.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-use crate::lwo2::vx;
-use binrw::{binread, BinRead, BinResult, Endian};
-use std::io::{Read, Seek};
-use std::iter::from_fn;
-
-#[binread]
-#[br(assert(false, "Not implemented yet"))]
-#[derive(Debug)]
-pub struct BinReadTodo();
-
-pub fn until_size_limit(
- limit: u64,
-) -> impl Fn(&mut R, Endian, Arg) -> BinResult
-where
- T: for<'a> BinRead = Arg>,
- R: Read + Seek,
- Arg: Clone,
- Ret: FromIterator,
-{
- until_size_limit_with(limit, default_reader)
-}
-
-/// Reads data until total size reaches a limit
-pub fn until_size_limit_with(
- limit: u64,
- reader_fn: ReadFn,
-) -> impl Fn(&mut R, Endian, Arg) -> BinResult
-where
- T: for<'a> BinRead = Arg>,
- R: Read + Seek,
- Arg: Clone,
- ReadFn: Fn(&mut R, Endian, Arg) -> BinResult,
- Ret: FromIterator,
-{
- move |reader, endian, args| {
- let pos = reader.stream_position()?;
- from_fn(|| match reader.stream_position() {
- Ok(now) if now - pos < limit => Some(reader_fn(reader, endian, args.clone())),
- Ok(_) => None,
- Err(err) => Some(Err(binrw::Error::Io(err))),
- })
- .fuse()
- .collect()
- }
-}
-
-pub fn count_with_vx(n: usize) -> impl Fn(&mut R, Endian, ()) -> BinResult>
-where
- R: Read + Seek,
-{
- move |reader, endian, _args: ()| {
- core::iter::repeat_with(|| vx(reader, endian, ()))
- .take(n)
- .collect()
- }
-}
-
-fn default_reader<'a, T: BinRead, R: Read + Seek>(
- reader: &mut R,
- endian: Endian,
- args: T::Args<'a>,
-) -> BinResult
-where
- T::Args<'a>: Clone,
-{
- let mut value = T::read_options(reader, endian, args.clone())?;
- value.after_parse(reader, endian, args)?;
- Ok(value)
-}
diff --git a/rust/lightwave/src/iff.rs b/rust/lightwave/src/iff.rs
deleted file mode 100644
index 218903a..0000000
--- a/rust/lightwave/src/iff.rs
+++ /dev/null
@@ -1,46 +0,0 @@
-use binrw::{binread, BinRead};
-use std::ops::Deref;
-
-#[binread]
-#[derive(Debug)]
-pub struct Chunk
-where
- for<'a> D: BinRead = (u32,)>,
-{
- pub length: u32,
- #[br(pad_size_to = length, align_after = 2, args(length))]
- pub data: D,
-}
-
-impl Deref for Chunk
-where
- for<'a> D: BinRead = (u32,)>,
-{
- type Target = D;
-
- fn deref(&self) -> &Self::Target {
- &self.data
- }
-}
-
-#[binread]
-#[derive(Debug)]
-pub struct SubChunk
-where
- for<'a> D: BinRead = (u32,)>,
-{
- pub length: u16,
- #[br(pad_size_to = length, align_after = 2, args(length as u32))]
- pub data: D,
-}
-
-impl Deref for SubChunk
-where
- for<'a> D: BinRead = (u32,)>,
-{
- type Target = D;
-
- fn deref(&self) -> &Self::Target {
- &self.data
- }
-}
diff --git a/rust/lightwave/src/lib.rs b/rust/lightwave/src/lib.rs
deleted file mode 100644
index 1696499..0000000
--- a/rust/lightwave/src/lib.rs
+++ /dev/null
@@ -1,60 +0,0 @@
-use crate::lwo2::tags::Tag;
-use binrw::{binread, until_eof, BinRead, BinResult};
-use std::fs::File;
-use std::io::{Read, Seek};
-use std::path::Path;
-
-mod binrw_helpers;
-pub mod iff;
-pub mod lwo2;
-
-/// 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.
-#[binread]
-#[br(big, magic(b"FORM"))]
-#[derive(Debug)]
-pub struct LightWaveObject {
- pub file_size: u32,
- #[br(magic(b"LWO2"), parse_with = until_eof)]
- pub data: Vec,
-}
-
-impl LightWaveObject {
- pub fn read_file>(path: P) -> std::io::Result {
- let mut reader = File::open(path)?;
- Self::read(&mut reader)
- .map_err(|err| std::io::Error::new(std::io::ErrorKind::InvalidData, err))
- }
-
- pub fn read(reader: &mut R) -> BinResult
- where
- R: Read + Seek,
- {
- BinRead::read(reader)
- }
-}
diff --git a/rust/lightwave/src/lwo2/mod.rs b/rust/lightwave/src/lwo2/mod.rs
deleted file mode 100644
index e470608..0000000
--- a/rust/lightwave/src/lwo2/mod.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-use binrw::{BinReaderExt, BinResult, Endian};
-use std::io::{Read, Seek};
-
-pub mod sub_tags;
-pub mod tags;
-
-/// This is an index into an array of items (points or polygons), or a collection of items
-/// each uniquely identified by an integer (clips or envelopes). A VX is written as a variable
-/// length 2- or 4-byte element. If the index value is less than 65,280 (0xFF00), then the
-/// index is written as an unsigned two-byte integer. Otherwise the index is written as an
-/// unsigned four byte integer with bits 24-31 set. When reading an index, if the first byte
-/// encountered is 255 (0xFF), then the four-byte form is being used and the first byte should
-/// be discarded or masked out.
-pub fn vx(reader: &mut R, endian: Endian, _args: ()) -> BinResult
-where
- R: Read + Seek,
-{
- let kind: u16 = reader.read_type(endian)?;
- Ok(if kind < 0xff00 {
- kind as u32
- } else {
- (((kind as u32) & 0xff) << 16) | (reader.read_type::(endian)? as u32)
- })
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/blocks/gradient_texture.rs b/rust/lightwave/src/lwo2/sub_tags/blocks/gradient_texture.rs
deleted file mode 100644
index 7555b72..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/blocks/gradient_texture.rs
+++ /dev/null
@@ -1,68 +0,0 @@
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::Name;
-use binrw::binread;
-
-#[binread]
-#[derive(Debug)]
-pub enum GradientTextureSubChunk {
- #[br(magic(b"PNAM"))]
- ParameterName(SubChunk),
- #[br(magic(b"INAM"))]
- ItemName(SubChunk),
- #[br(magic(b"GRST"))]
- GradientRangeStart(SubChunk),
- #[br(magic(b"GREN"))]
- GradientRangeEnd(SubChunk),
- #[br(magic(b"GRPT"))]
- RepeatMode(SubChunk),
- #[br(magic(b"FKEY"))]
- KeyValues(SubChunk),
- #[br(magic(b"IKEY"))]
- KeyParameters(SubChunk),
-}
-
-/// The repeat mode. This is currently undefined.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct KeyParameters {
- #[br(count = length / 2)]
- pub repeat_mode: Vec,
-}
-
-/// The transfer function is defined by an array of keys, each with an input value and an RGBA
-/// output vector. Given an input value, the gradient can be evaluated by selecting the keys whose
-/// positions bracket the value and interpolating between their outputs. If the input value is lower
-/// than the first key or higher than the last key, the gradient value is the value of the closest
-/// key.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct KeyValues {
- #[br(count = length / 18)]
- pub key_values: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub struct KeyValue {
- pub input: f32,
- pub output: [f32; 4],
-}
-
-/// The start and end of the input range. These values only affect the display of the gradient
-/// in the user interface. They don't affect rendering.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct GradientRange {
- pub name: f32,
-}
-
-/// The repeat mode. This is currently undefined.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct RepeatMode {
- pub repeat_mode: u16,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/blocks/image_texture.rs b/rust/lightwave/src/lwo2/sub_tags/blocks/image_texture.rs
deleted file mode 100644
index bb57f64..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/blocks/image_texture.rs
+++ /dev/null
@@ -1,121 +0,0 @@
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::blocks::texture_mapping::TextureMapping;
-use crate::lwo2::sub_tags::{ValueEnvelope, VxReference};
-use crate::lwo2::vx;
-use binrw::{binread, NullString};
-
-#[binread]
-#[derive(Debug)]
-pub enum SurfaceBlockImageTextureSubChunk {
- #[br(magic(b"TMAP"))]
- TextureMapping(SubChunk),
- #[br(magic(b"PROJ"))]
- ProjectionMode(SubChunk),
- #[br(magic(b"AXIS"))]
- MajorAxis(SubChunk),
- #[br(magic(b"IMAG"))]
- ImageMap(SubChunk),
- #[br(magic(b"WRAP"))]
- ImageWrapOptions(SubChunk),
- #[br(magic(b"WRPW"))]
- ImageWrapAmountWidth(SubChunk),
- #[br(magic(b"WRPH"))]
- ImageWrapAmountHeight(SubChunk),
- #[br(magic(b"VMAP"))]
- UvVertexMap(SubChunk),
- #[br(magic(b"AAST"))]
- AntialiasingStrength(SubChunk),
- #[br(magic(b"PIXB"))]
- PixelBlending(SubChunk),
- #[br(magic(b"STICK"))]
- StickyProjection(SubChunk),
- #[br(magic(b"TAMP"))]
- TextureAmplitude(SubChunk),
-}
-
-/// The major axis used for planar, cylindrical and spherical projections. The value is 0, 1 or 2
-/// for the X, Y or Z axis.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct MajorAxis {
- pub texture_axis: u16,
-}
-
-/// Pixel blending enlarges the sample filter when it would otherwise be smaller than a single
-/// image map pixel. If the low-order flag bit is set, then pixel blending is enabled.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct PixelBlending {
- pub flags: u16,
-}
-
-/// The low bit of the flags word is an enable flag for texture antialiasing. The antialiasing
-/// strength is proportional to the width of the sample filter, so larger values sample a larger
-/// area of the image.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct AntialiasingStrength {
- pub flags: u16,
- pub strength: f32,
-}
-
-/// For UV projection, which depends on texture coordinates at each vertex, this selects the name of
-/// the TXUV vertex map that contains those coordinates.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct UvMap {
- #[br(align_after = 2)]
- pub txuv_map_name: NullString,
-}
-
-/// For cylindrical and spherical projections, these parameters control how many times the image
-/// repeats over each full interval.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct ImageWrapAmount {
- pub cycles: f32,
- #[br(parse_with = vx)]
- pub envelope: u32,
-}
-
-/// Specifies how the color of the texture is derived for areas outside the image.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct ImageWrapOptions {
- pub width_wrap: ImageWrapType,
- pub height_wrap: ImageWrapType,
-}
-
-#[binread]
-#[br(repr = u16)]
-#[derive(Debug)]
-pub enum ImageWrapType {
- /// Areas outside the image are assumed to be black. The ultimate effect of this depends on
- /// the opacity settings. For an additive texture layer on the color channel, the final color
- /// will come from the preceding layers or from the base color of the surface.
- Reset = 0,
- /// The image is repeated or tiled.
- Repeat = 1,
- /// Like repeat, but alternate tiles are mirror-reversed.
- Mirror = 2,
- /// The color is taken from the image's nearest edge pixel.
- Edge = 3,
-}
-
-#[binread]
-#[br(repr = u16, import(_length: u32))]
-#[derive(Debug)]
-pub enum ProjectionMode {
- Planar = 0,
- Cylindrical = 1,
- Spherical = 2,
- Cubic = 3,
- FrontProjection = 4,
- UV = 5,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/blocks/mod.rs b/rust/lightwave/src/lwo2/sub_tags/blocks/mod.rs
deleted file mode 100644
index f58f89b..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/blocks/mod.rs
+++ /dev/null
@@ -1,140 +0,0 @@
-use crate::binrw_helpers::until_size_limit;
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::blocks::gradient_texture::GradientTextureSubChunk;
-use crate::lwo2::sub_tags::blocks::image_texture::SurfaceBlockImageTextureSubChunk;
-use crate::lwo2::sub_tags::blocks::procedural_texture::ProceduralTextureSubChunk;
-use crate::lwo2::sub_tags::EnableState;
-use crate::lwo2::vx;
-use binrw::{binread, NullString};
-
-pub mod gradient_texture;
-pub mod image_texture;
-pub mod procedural_texture;
-pub mod texture_mapping;
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub enum SurfaceBlocks {
- #[br(magic(b"IMAP"))]
- ImageMapTexture {
- header: SubChunk,
- #[br(parse_with = until_size_limit(length as u64 - (header.length as u64 + 2 + 4)))]
- attributes: Vec,
- },
- #[br(magic(b"PROC"))]
- ProceduralTexture {
- header: SubChunk,
- #[br(parse_with = until_size_limit(length as u64 - (header.length as u64 + 2 + 4)))]
- attributes: Vec,
- },
- #[br(magic(b"GRAD"))]
- GradientTexture {
- header: SubChunk,
- #[br(parse_with = until_size_limit(length as u64 - (header.length as u64 + 2 + 4)))]
- attributes: Vec,
- },
- #[br(magic(b"SHDR"))]
- ShaderPlugin {
- header: SubChunk,
- #[br(magic(b"FUNC"))]
- algorithm: SubChunk,
- },
-}
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct Algorithm {
- #[br(align_after = 2)]
- pub algorithm_name: NullString,
- #[br(count = length - (algorithm_name.len() as u32 + 1))]
- pub data: Vec,
-}
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct SurfaceBlockHeader {
- #[br(pad_before = 2)]
- #[br(parse_with = until_size_limit(length as u64 - 4))]
- pub block_attributes: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum SurfaceBlockHeaderSubChunk {
- #[br(magic(b"CHAN"))]
- Channel(SubChunk),
- #[br(magic(b"ENAB"))]
- EnabledState(SubChunk),
- #[br(magic(b"OPAC"))]
- Opacity(SubChunk),
- #[br(magic(b"AXIS"))]
- DisplacementAxis(SubChunk),
- #[br(magic(b"NEGA"))]
- Negative(SubChunk),
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct DisplacementAxis {
- pub displacement_axis: u16,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct Opacity {
- pub kind: OpacityType,
- pub opacity: f32,
- #[br(parse_with = vx)]
- pub envelope: u32,
-}
-
-#[binread]
-#[br(repr = u16)]
-#[derive(Debug)]
-pub enum OpacityType {
- Normal = 0,
- Subtractive = 1,
- Difference = 2,
- Multiply = 3,
- Divide = 4,
- Alpha = 5,
- TextureDisplacement = 6,
- Additive = 7,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct Channel {
- pub texture_channel: TextureChannel,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum TextureChannel {
- #[br(magic(b"COLR"))]
- Color,
- #[br(magic(b"DIFF"))]
- Diffuse,
- #[br(magic(b"LUMI"))]
- Luminosity,
- #[br(magic(b"SPEC"))]
- Specular,
- #[br(magic(b"GLOS"))]
- Glossy,
- #[br(magic(b"REFL"))]
- Reflectivity,
- #[br(magic(b"TRAN"))]
- Transparency,
- #[br(magic(b"RIND"))]
- RefractiveIndex,
- #[br(magic(b"TRNL"))]
- Translucency,
- #[br(magic(b"BUMP"))]
- Bump,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/blocks/procedural_texture.rs b/rust/lightwave/src/lwo2/sub_tags/blocks/procedural_texture.rs
deleted file mode 100644
index 1a88ec1..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/blocks/procedural_texture.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::blocks::Algorithm;
-use binrw::binread;
-
-#[binread]
-#[derive(Debug)]
-pub enum ProceduralTextureSubChunk {
- #[br(magic(b"AXIS"))]
- Axis(SubChunk),
- #[br(magic(b"VALU"))]
- BasicValue(SubChunk),
- #[br(magic(b"FUNC"))]
- AlgorithmAndParameters(SubChunk),
-}
-
-/// Procedurals are often modulations between the current channel value and another value, given
-/// here. This may be a scalar or a vector.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct BasicValue {
- #[br(count = length / 4)]
- pub value: Vec,
-}
-
-/// If the procedural has an axis, it may be defined with this chunk using a value of 0, 1 or 2.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct Axis {
- pub axis: u16,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/blocks/texture_mapping.rs b/rust/lightwave/src/lwo2/sub_tags/blocks/texture_mapping.rs
deleted file mode 100644
index 7f0ddcf..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/blocks/texture_mapping.rs
+++ /dev/null
@@ -1,67 +0,0 @@
-use crate::binrw_helpers::until_size_limit;
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::VectorEnvelope;
-use crate::lwo2::vx;
-use binrw::{binread, NullString};
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct TextureMapping {
- #[br(parse_with = until_size_limit(length as u64))]
- pub attributes: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum TextureMappingSubChunk {
- #[br(magic(b"CNTR"))]
- Center(SubChunk),
- #[br(magic(b"SIZE"))]
- Size(SubChunk),
- #[br(magic(b"ROTA"))]
- Rotation(SubChunk),
- #[br(magic(b"OREF"))]
- ReferenceObject(SubChunk),
- #[br(magic(b"FALL"))]
- Falloff(SubChunk),
- #[br(magic(b"CSYS"))]
- CoordinateSystem(SubChunk),
-}
-
-#[binread]
-#[br(repr = u16, import(_length: u32))]
-#[derive(Debug)]
-pub enum CoordinateSystem {
- ObjectCoordinates = 0,
- WorldCoordinates = 1,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct ReferenceObject {
- #[br(align_after = 2)]
- pub object_name: NullString,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct Falloff {
- pub kind: FalloffType,
- pub vector: [f32; 3],
- #[br(parse_with = vx)]
- pub envelope: u32,
-}
-
-#[binread]
-#[br(repr = u16)]
-#[derive(Debug)]
-pub enum FalloffType {
- Cubic = 0,
- Spherical = 1,
- LinearX = 2,
- LinearY = 3,
- LinearZ = 4,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/mod.rs b/rust/lightwave/src/lwo2/sub_tags/mod.rs
deleted file mode 100644
index 098cf8a..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/mod.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-use crate::lwo2::vx;
-use binrw::{binread, NullString};
-
-pub mod blocks;
-pub mod plugin;
-pub mod surface_parameters;
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct VectorEnvelope {
- pub base_color: [f32; 3],
- #[br(parse_with = vx)]
- pub envelope: u32,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct Name {
- #[br(align_after = 2)]
- pub name: NullString,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct ValueEnvelope {
- pub value: f32,
- #[br(parse_with = vx)]
- pub envelope: u32,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct VxReference {
- #[br(parse_with = vx)]
- pub texture_image: u32,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct EnableState {
- pub enable: u16,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/plugin.rs b/rust/lightwave/src/lwo2/sub_tags/plugin.rs
deleted file mode 100644
index 4654e81..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/plugin.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-use binrw::{binread, NullString, PosValue};
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct PluginServerNameAndData {
- #[br(temp)]
- start_pos: PosValue<()>,
- #[br(align_after = 2)]
- pub server_name: NullString,
- pub flags: u16,
- #[br(temp)]
- end_pos: PosValue<()>,
- #[br(count = length as u64 - (end_pos.pos - start_pos.pos))]
- pub parameters: Vec,
-}
diff --git a/rust/lightwave/src/lwo2/sub_tags/surface_parameters.rs b/rust/lightwave/src/lwo2/sub_tags/surface_parameters.rs
deleted file mode 100644
index 2dde5a7..0000000
--- a/rust/lightwave/src/lwo2/sub_tags/surface_parameters.rs
+++ /dev/null
@@ -1,177 +0,0 @@
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::blocks::SurfaceBlocks;
-use crate::lwo2::sub_tags::{ValueEnvelope, VectorEnvelope, VxReference};
-use crate::lwo2::vx;
-use binrw::{binread, NullString};
-
-#[binread]
-#[derive(Debug)]
-pub enum SurfaceParameterSubChunk {
- #[br(magic(b"COLR"))]
- BaseColor(SubChunk),
- #[br(magic(b"DIFF"))]
- BaseShadingValueDiffuse(SubChunk),
- #[br(magic(b"LUMI"))]
- BaseShadingValueLuminosity(SubChunk),
- #[br(magic(b"SPEC"))]
- BaseShadingValueSpecular(SubChunk),
- #[br(magic(b"REFL"))]
- BaseShadingValueReflectivity(SubChunk),
- #[br(magic(b"TRAN"))]
- BaseShadingValueTransparency(SubChunk),
- #[br(magic(b"TRNL"))]
- BaseShadingValueTranslucency(SubChunk),
- #[br(magic(b"GLOS"))]
- SpecularGlossiness(SubChunk),
- #[br(magic(b"SHRP"))]
- DiffuseSharpness(SubChunk),
- #[br(magic(b"BUMP"))]
- BumpIntensity(SubChunk),
- #[br(magic(b"SIDE"))]
- PolygonSidedness(SubChunk),
- #[br(magic(b"SMAN"))]
- MaxSmoothingAngle(SubChunk),
- #[br(magic(b"RFOP"))]
- ReflectionOptions(SubChunk),
- #[br(magic(b"RIMG"))]
- ReflectionMapImage(SubChunk),
- #[br(magic(b"RSAN"))]
- ReflectionMapSeamAngle(SubChunk),
- #[br(magic(b"RBLR"))]
- ReflectionBlurring(SubChunk),
- #[br(magic(b"RIND"))]
- RefractiveIndex(SubChunk),
- #[br(magic(b"TROP"))]
- TransparencyOptions(SubChunk),
- #[br(magic(b"TIMG"))]
- RefractionMapImage(SubChunk),
- #[br(magic(b"TBLR"))]
- RefractionBlurring(SubChunk),
- #[br(magic(b"CLRH"))]
- ColorHighlights(SubChunk),
- #[br(magic(b"CLRF"))]
- ColorFilter(SubChunk),
- #[br(magic(b"ADTR"))]
- AdditiveTransparency(SubChunk),
- #[br(magic(b"GLOW"))]
- GlowEffect(SubChunk),
- #[br(magic(b"LINE"))]
- RenderOutlines(SubChunk),
- #[br(magic(b"ALPH"))]
- AlphaMode(SubChunk),
- #[br(magic(b"VCOL"))]
- VertexColorMap(SubChunk),
- #[br(magic(b"BLOK"))]
- Blocks(SubChunk),
-}
-
-/// The vertex color map subchunk identifies an RGB or RGBA VMAP that will be used to color the surface.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct VertexColorMap {
- pub intensity: f32,
- #[br(parse_with = vx)]
- pub envelope: u32,
- pub vmap_type: [u8; 4],
- #[br(align_after = 2)]
- pub name: NullString,
-}
-
-/// The alpha mode defines the alpha channel output options for the surface.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct AlphaMode {
- pub mode: AlphaModeMode,
- pub value: f32,
-}
-
-#[binread]
-#[br(repr = u16)]
-#[derive(Debug)]
-pub enum AlphaModeMode {
- /// The surface has no effect on the alpha channel when rendered.
- UnaffectedBySurface = 0,
- /// The alpha channel will be written with the constant value following the mode in the subchunk.
- ConstantValue = 1,
- /// The alpha value is derived from surface opacity, which is the default if the ALPH chunk is missing.
- SurfaceOpacity = 2,
- /// The alpha value comes from the shadow density.
- ShadowDensity = 3,
-}
-
-/// The line effect draws the surface as a wireframe of the polygon edges. Currently the only flag
-/// defined is an enable switch in the low bit. The size is the thickness of the lines in pixels,
-/// and the color, if not given, is the base color of the surface. Note that you may encounter
-/// LINE subchunks with no color information (these will have a subchunk length of 8 bytes) and
-/// possibly without size information (subchunk length 2).
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct RenderOutlines {
- pub flags: u16,
- #[br(if(length > 2))]
- pub size: f32,
- #[br(if(length > 2))]
- #[br(parse_with = vx)]
- pub size_envelope: u32,
- #[br(if(length > 8))]
- pub color: [f32; 3],
- #[br(if(length > 8))]
- #[br(parse_with = vx)]
- pub color_envelope: u32,
-}
-
-/// The glow effect causes a surface to spread and affect neighboring areas of the image. The type
-/// can be 0 for Hastings glow, and 1 for image convolution. The size and intensity define how large
-/// and how strong the effect is.
-///
-/// You may also encounter glow information written in a GVAL subchunk containing only the intensity
-/// and its envelope (the subchunk length is 6).
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct GlowEffect {
- pub kind: GlowType,
- pub intensity: f32,
- #[br(parse_with = vx)]
- pub intensity_envelope: u32,
- #[br(if(length > 6))]
- pub size: f32,
- #[br(if(length > 6))]
- #[br(parse_with = vx)]
- pub size_envelope: u32,
-}
-
-#[binread]
-#[br(repr = u16)]
-#[derive(Debug)]
-pub enum GlowType {
- HastingsGlow = 0,
- ImageConvolution = 1,
-}
-
-#[binread]
-#[br(repr = u16, import(_length: u32))]
-#[derive(Debug)]
-pub enum ReflectionOptions {
- BackdropOnly = 0,
- RaytracingAndBackdrop = 1,
- SphericalMap = 2,
- RaytracingAndSphericalMap = 3,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct PolygonSidedness {
- pub sidedness: u16,
-}
-
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct MaxSmoothingAngle {
- pub max_smoothing_angle: f32,
-}
diff --git a/rust/lightwave/src/lwo2/tags/bounding_box.rs b/rust/lightwave/src/lwo2/tags/bounding_box.rs
deleted file mode 100644
index f3a9412..0000000
--- a/rust/lightwave/src/lwo2/tags/bounding_box.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-use binrw::binread;
-
-///Store the bounding box for the vertex data in a layer. Optional. The min and max vectors are
-/// the lower and upper corners of the bounding box.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct BoundingBox {
- pub min: [f32; 3],
- pub max: [f32; 3],
-}
diff --git a/rust/lightwave/src/lwo2/tags/discontinuous_vertex_mapping.rs b/rust/lightwave/src/lwo2/tags/discontinuous_vertex_mapping.rs
deleted file mode 100644
index ca20e2f..0000000
--- a/rust/lightwave/src/lwo2/tags/discontinuous_vertex_mapping.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-use crate::binrw_helpers::until_size_limit;
-use crate::lwo2::vx;
-use binrw::{binread, NullString, PosValue};
-
-/// (Introduced with LightWave® 6.5.) Associates a set of floating-point vectors with the vertices
-/// of specific polygons. VMADs are similar to VMAPs, but they assign vectors to polygon vertices
-/// rather than points. For a given mapping, a VMAP always assigns only one vector to a point, while
-/// a VMAD can assign as many vectors to a point as there are polygons sharing the point.
-///
-/// The motivation for VMADs is the problem of seams in UV texture mapping. If a UV map is
-/// topologically equivalent to a cylinder or a sphere, a seam is formed where the opposite edges of
-/// the map meet. Interpolation of UV coordinates across this discontinuity is aesthetically and
-/// mathematically incorrect. The VMAD substitutes an equivalent mapping that interpolates
-/// correctly. It only needs to do this for polygons in which the seam lies.
-///
-/// VMAD chunks are paired with VMAPs of the same name, if they exist. The vector values in the VMAD
-/// will then replace those in the corresponding VMAP, but only for calculations involving the
-/// specified polygons. When the same points are used for calculations on polygons not specified in
-/// the VMAD, the VMAP values are used.
-///
-/// VMADs need not be associated with a VMAP. They can also be used simply to define a
-/// (discontinuous) per-polygon mapping. But not all mapping types are valid for VMADs, since for
-/// some types it makes no sense for points to have more than one map value. TXUV, RGB, RGBA and
-/// WGHT types are supported for VMADs, for example, while MORF and SPOT are not. VMADs of
-/// unsupported types are preserved but never evaluated.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct DiscontinuousVertexMappings {
- #[br(temp)]
- pub start_pos: PosValue<()>,
- pub kind: [u8; 4],
- #[br(temp)]
- pub dimension: u16,
- #[br(align_after = 2)]
- pub name: NullString,
- #[br(temp)]
- pub end_pos: PosValue<()>,
- #[br(parse_with = |reader, endian, _: ()| until_size_limit(length as u64 - (end_pos.pos - start_pos.pos))(reader, endian, (dimension, )))]
- pub mappings: Vec,
-}
-
-#[binread]
-#[br(import(dimension: u16))]
-#[derive(Debug)]
-pub struct DiscontinuousVertexMapping {
- #[br(parse_with = vx)]
- pub vert: u32,
- #[br(parse_with = vx)]
- pub poly: u32,
- #[br(count = dimension)]
- pub values: Vec,
-}
diff --git a/rust/lightwave/src/lwo2/tags/envelope.rs b/rust/lightwave/src/lwo2/tags/envelope.rs
deleted file mode 100644
index 63c5f1b..0000000
--- a/rust/lightwave/src/lwo2/tags/envelope.rs
+++ /dev/null
@@ -1,148 +0,0 @@
-use crate::binrw_helpers::until_size_limit;
-use crate::iff::SubChunk;
-use crate::lwo2::vx;
-use binrw::{binread, NullString, PosValue};
-use crate::lwo2::sub_tags::plugin::PluginServerNameAndData;
-
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct EnvelopeDefinition {
- #[br(temp)]
- pos_start: PosValue<()>,
- #[br(parse_with = vx)]
- pub index: u32,
- #[br(temp)]
- pos_end: PosValue<()>,
- #[br(parse_with = until_size_limit(length as u64 - (pos_end.pos - pos_start.pos)))]
- pub attributes: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum EnvelopeSubChunk {
- #[br(magic(b"TYPE"))]
- EnvelopeType(SubChunk),
- #[br(magic(b"PRE"))]
- PreBehavior(SubChunk),
- #[br(magic(b"POST"))]
- PostBehavior(SubChunk),
- #[br(magic(b"KEY"))]
- KeyframeTimeAndValue(SubChunk),
- #[br(magic(b"SPAN"))]
- IntervalInterpolation(SubChunk),
- #[br(magic(b"CHAN"))]
- PluginChannelModifiers(SubChunk),
- #[br(magic(b"NAME"))]
- ChannelName(SubChunk),
-}
-
-/// An optional name for the envelope. LightWave® itself ignores the names of surface envelopes,
-/// but plug-ins can browse the envelope database by name.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct PluginChannelName {
- #[br(align_after = 2)]
- pub channel_name: NullString,
-}
-
-/// Defines the interpolation between the most recent KEY chunk and the KEY immediately before it in
-/// time. The type identifies the interpolation algorithm and can be STEP, LINE, TCB
-/// (Kochanek-Bartels), HERM (Hermite), BEZI (1D Bezier) or BEZ2 (2D Bezier).
-/// Different parameters are stored for each of these.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct IntervalInterpolation {
- pub kind: IntervalInterpolationType,
- #[br(count = (length - 4) / 4)]
- pub parameters: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum IntervalInterpolationType {
- #[br(magic(b"STEP"))]
- Step,
- #[br(magic(b"LINE"))]
- Line,
- #[br(magic(b"TCB\0"))]
- KochanekBartels,
- #[br(magic(b"HERM"))]
- Hermite,
- #[br(magic(b"BEZI"))]
- Bezier1D,
- #[br(magic(b"BEZ2"))]
- Bezier2D,
-}
-
-/// The value of the envelope at the specified time in seconds. The signal value between keyframes
-/// is interpolated. The time of a keyframe isn't restricted to integer frames.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct KeyframeTimeAndValue {
- pub time: f32,
- pub value: f32,
-}
-
-#[binread]
-#[br(repr = u16, import(_length: u32))]
-#[derive(Debug)]
-pub enum Behavior {
- /// Sets the value to 0.0.
- Reset = 0,
- /// Sets the value to the value at the nearest key.
- Constant = 1,
- /// Repeats the interval between the first and last keys (the primary interval).
- Repeat = 2,
- /// Like Repeat, but alternating copies of the primary interval are time-reversed.
- Oscillate = 3,
- /// Like Repeat, but offset by the difference between the values of the first and last keys.
- OffsetRepeat = 4,
- /// Linearly extrapolates the value based on the tangent at the nearest key.
- Linear = 5,
-}
-
-/// The type subchunk records the format in which the envelope is displayed to the user and a type
-/// code that identifies the components of certain predefined envelope triples. The user format has
-/// no effect on the actual values, only the way they're presented in LightWave®'s interface.
-#[binread]
-#[br(import(_length: u32))]
-#[derive(Debug)]
-pub struct EnvelopeType {
- pub user_format: UserFormat,
- pub kind: EnvelopeKind,
-}
-
-#[binread]
-#[br(repr = u8)]
-#[derive(Debug)]
-pub enum UserFormat {
- Float = 2,
- Distance = 3,
- Percent = 4,
- Angle = 5,
-}
-
-#[binread]
-#[br(repr = u8)]
-#[derive(Debug)]
-pub enum EnvelopeKind {
- PositionX = 0x1,
- PositionY = 0x2,
- PositionZ = 0x3,
- RotHeading = 0x4,
- RotPitch = 0x5,
- RotBank = 0x6,
- ScaleX = 0x7,
- ScaleY = 0x8,
- ScaleZ = 0x9,
- ColorR = 0xa,
- ColorG = 0xb,
- ColorB = 0xc,
- FalloffX = 0xd,
- FalloffY = 0xe,
- FalloffZ = 0xf,
-}
diff --git a/rust/lightwave/src/lwo2/tags/image_clip.rs b/rust/lightwave/src/lwo2/tags/image_clip.rs
deleted file mode 100644
index 587cbac..0000000
--- a/rust/lightwave/src/lwo2/tags/image_clip.rs
+++ /dev/null
@@ -1,172 +0,0 @@
-use crate::binrw_helpers::until_size_limit;
-use crate::iff::SubChunk;
-use crate::lwo2::sub_tags::plugin::PluginServerNameAndData;
-use crate::lwo2::sub_tags::{EnableState, ValueEnvelope};
-use binrw::{binread, NullString, PosValue};
-
-/// Describes an image or a sequence of images. Surface definitions specify images by referring to
-/// CLIP chunks. The term "clip" is used to describe these because they can be numbered sequences
-/// or animations as well as stills. The index identifies this clip uniquely and may be any non-zero
-/// value less than 0x1000000. The filename and any image processing modifiers follow as a variable
-/// list of subchunks, which are documented below in the Clip Subchunks section.
-#[binread]
-#[br(import(length: u32))]
-#[derive(Debug)]
-pub struct ImageClip {
- pub index: u32,
- #[br(parse_with = until_size_limit(length as u64 - 4))]
- pub attributes: Vec,
-}
-
-#[binread]
-#[derive(Debug)]
-pub enum ImageClipSubChunk {
- #[br(magic(b"STIL"))]
- StillImage(SubChunk),
- #[br(magic(b"ISEQ"))]
- ImageSequence(SubChunk),
- #[br(magic(b"ANIM"))]
- PluginAnimation(SubChunk),
- #[br(magic(b"XREF"))]
- Reference(SubChunk),
- #[br(magic(b"FLAG"))]
- Flag(SubChunk),
- #[br(magic(b"STCC"))]
- ColorCyclingStill(SubChunk),
- #[br(magic(b"TIME"))]
- Time(SubChunk