From 39572c539e973e40521abd0161fd20728f3c4d65 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Tue, 16 Jan 2024 21:49:33 -0500 Subject: [PATCH 01/17] Update crates --- Cargo.toml | 8 ++++---- core/grim/Cargo.toml | 6 +++--- core/grim_macros/Cargo.toml | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 653d41d..e10d084 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,17 +18,17 @@ authors = ["PikminGuts92"] edition = "2021" [workspace.dependencies] -clap = { version = "4.4.11", features = ["derive"] } +clap = { version = "4.4.18", features = ["derive"] } gltf = { version = "=1.3.0", default-features = false, features = [ "import", "names", "utils" ] } gltf-json = { version = "=1.3.0", features = [ "names" ] } grim = { path = "core/grim" } itertools = "0.12.0" lazy_static = "1.4.0" log = "0.4.20" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" +serde = { version = "1.0.195", features = ["derive"] } +serde_json = "1.0.111" simplelog = "0.12.1" -thiserror = "1.0.52" +thiserror = "1.0.56" [profile.dev.package."*"] opt-level = 3 diff --git a/core/grim/Cargo.toml b/core/grim/Cargo.toml index 2c14b97..f0a3877 100644 --- a/core/grim/Cargo.toml +++ b/core/grim/Cargo.toml @@ -5,9 +5,9 @@ authors.workspace = true edition.workspace = true [dependencies] -base64 = "0.21.5" +base64 = "0.21.7" bitstream-io = { version = "2.2.0", optional = true } -ffmpeg-next = { version = "6.1.0", optional = true } +ffmpeg-next = { version = "6.1.1", optional = true } flate2 = "1.0.28" fon = { version = "0.6.0", optional = true } gltf = { workspace = true, optional = true } @@ -16,7 +16,7 @@ grim_gltf = { path = "../grim_gltf", optional = true } grim_macros = { path = "../grim_macros" } grim_traits = { path = "../grim_traits" } half = { version = "2.3.1", default-features = false } -image = { version = "0.24.7", default-features = false, features = [ "dxt", "png" ] } +image = { version = "0.24.8", default-features = false, features = [ "dxt", "png" ] } itertools = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } diff --git a/core/grim_macros/Cargo.toml b/core/grim_macros/Cargo.toml index ffad0f2..1b3f25e 100644 --- a/core/grim_macros/Cargo.toml +++ b/core/grim_macros/Cargo.toml @@ -10,6 +10,6 @@ proc-macro = true [dependencies] grim_traits = { path = "../grim_traits" } lazy_static = { workspace = true } -proc-macro2 = "1.0.71" -quote = "1.0.33" -syn = { version = "2.0.43", default-features = false, features = [ "clone-impls", "derive", "parsing", "printing", "proc-macro" ] } +proc-macro2 = "1.0.76" +quote = "1.0.35" +syn = { version = "2.0.48", default-features = false, features = [ "clone-impls", "derive", "parsing", "printing", "proc-macro" ] } From 7d20b2d73ae2087b6973e68d52e441d0474a8d9d Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Tue, 16 Jan 2024 21:53:36 -0500 Subject: [PATCH 02/17] Remove ffmpeg dependency --- core/grim/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/grim/Cargo.toml b/core/grim/Cargo.toml index f0a3877..1919f2c 100644 --- a/core/grim/Cargo.toml +++ b/core/grim/Cargo.toml @@ -7,7 +7,6 @@ edition.workspace = true [dependencies] base64 = "0.21.7" bitstream-io = { version = "2.2.0", optional = true } -ffmpeg-next = { version = "6.1.1", optional = true } flate2 = "1.0.28" fon = { version = "0.6.0", optional = true } gltf = { workspace = true, optional = true } @@ -37,7 +36,7 @@ rstest = "0.18.2" [features] audio = [ "bitstream-io", "fon", "wav" ] -audio_experimental = [ "ffmpeg-next" ] +audio_experimental = [] midi = [ "midly" ] model = [ "gltf", "gltf-json", "grim_gltf", "nalgebra", "serde" ] python = [ "pyo3" ] From 17f64539719656d5d85b2db19291af1f0cc96d4f Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Tue, 16 Jan 2024 22:54:30 -0500 Subject: [PATCH 03/17] Update eframe and rerun --- utils/anim_preview/Cargo.toml | 4 ++-- utils/anim_preview/src/main.rs | 8 ++++---- utils/lipsync_preview/Cargo.toml | 6 +++--- utils/lipsync_preview/src/main.rs | 6 ++++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/utils/anim_preview/Cargo.toml b/utils/anim_preview/Cargo.toml index 54778ad..b03336d 100644 --- a/utils/anim_preview/Cargo.toml +++ b/utils/anim_preview/Cargo.toml @@ -8,5 +8,5 @@ edition.workspace = true grim = { workspace = true } keyframe = "1.1.1" nalgebra = "0.32.3" -rerun = { version = "0.10.1", features = [ "native_viewer" ] } -shared = { path = "../shared" } \ No newline at end of file +rerun = { version = "0.12.0", features = [ "native_viewer" ] } +shared = { path = "../shared" } diff --git a/utils/anim_preview/src/main.rs b/utils/anim_preview/src/main.rs index 661b7a3..d14bee0 100644 --- a/utils/anim_preview/src/main.rs +++ b/utils/anim_preview/src/main.rs @@ -80,7 +80,7 @@ fn main() -> Result<(), Box> { }) .collect::>(); - let (mut rec_stream, storage) = RecordingStreamBuilder::new("anim_preview").memory()?; + let (rec_stream, storage) = RecordingStreamBuilder::new("anim_preview").memory()?; rec_stream.log_timeless( "world", @@ -88,7 +88,7 @@ fn main() -> Result<(), Box> { ViewCoordinates::from_up_and_handedness( SignedAxis3::POSITIVE_Z, Handedness::Right)) - ); + )?; for mesh_anim in mesh_anims { println!("{}", mesh_anim.get_name()); @@ -145,7 +145,7 @@ fn main() -> Result<(), Box> { rec_stream.log( mesh_anim.get_name().as_str(), &Points3D::new(glam_points) - ); + )?; // Send line strip to rerun /*MsgSender::new(mesh_anim.get_name().as_str()) @@ -505,7 +505,7 @@ fn add_bones_to_stream(bone: &BoneNode, rec_stream: &RecordingStream, i: usize) rec_stream.log( format!("world/{}/lines", bone.name), &rerun::LineStrips3D::new(strips) - ); + ).unwrap(); // Add direction arrow (not working) /*MsgSender::new(format!("world/{}/arrows", bone.name)) diff --git a/utils/lipsync_preview/Cargo.toml b/utils/lipsync_preview/Cargo.toml index 9c975b3..433904b 100644 --- a/utils/lipsync_preview/Cargo.toml +++ b/utils/lipsync_preview/Cargo.toml @@ -6,9 +6,9 @@ edition.workspace = true [dependencies] grim = { workspace = true, features = [ "audio" ] } -eframe = "0.23.0" -egui_plot = "0.23.0" +eframe = "0.25.0" +egui_plot = "0.25.0" keyframe = "1.1.1" nalgebra = "0.32.3" #rerun = "0.2.0" -shared = { path = "../shared" } \ No newline at end of file +shared = { path = "../shared" } diff --git a/utils/lipsync_preview/src/main.rs b/utils/lipsync_preview/src/main.rs index 33ee063..1056ed4 100644 --- a/utils/lipsync_preview/src/main.rs +++ b/utils/lipsync_preview/src/main.rs @@ -23,9 +23,11 @@ fn main() -> Result<(), Box> { app.load_args(&args)?; let ops = NativeOptions { - drag_and_drop_support: true, + viewport: eframe::egui::ViewportBuilder::default() + .with_min_inner_size([320.0, 240.0]) + .with_drag_and_drop(true), // icon_data: Some(icon), - min_window_size: Some([1000., 600.].into()), + // min_window_size: Some([1000., 600.].into()), follow_system_theme: false, // Always dark by default default_theme: eframe::Theme::Dark, ..NativeOptions::default() From 90a9deb4d673161d1d8aa3c62dc25c0496199721 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 08:38:33 -0500 Subject: [PATCH 04/17] Add python type stub --- core/grim/Cargo.toml | 2 +- core/grim/grim.pyi | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 core/grim/grim.pyi diff --git a/core/grim/Cargo.toml b/core/grim/Cargo.toml index 1919f2c..7a5871d 100644 --- a/core/grim/Cargo.toml +++ b/core/grim/Cargo.toml @@ -23,7 +23,7 @@ midly = { version = "0.5.3", optional = true } nalgebra = { version = "0.32.3", optional = true } nom = "7.1.3" # pyo3 = { version = "0.17.3", optional = true, features = [ "extension-module" ] } -pyo3 = { git = "https://github.com/PyO3/pyo3", branch = "cfg-feature-pyo3", optional = true, features = [ "extension-module" ] } +pyo3 = { git = "https://github.com/PyO3/pyo3", branch = "cfg-feature-pyo3", optional = true, features = [ "experimental-inspect", "extension-module" ] } rayon = "1.8.0" regex = { version = "1.10.2", default-features = false, features = [ "std" ] } serde = { optional = true, workspace = true } diff --git a/core/grim/grim.pyi b/core/grim/grim.pyi new file mode 100644 index 0000000..f97c895 --- /dev/null +++ b/core/grim/grim.pyi @@ -0,0 +1,15 @@ +class ArkOffsetEntry: + id: int + path: str + offset: int + part: int + size: int + inflated_size: int + +class Ark: + version: int + encryption: int | None + entries: list[ArkOffsetEntry] + + @staticmethod + def from_file_path(path: str) -> Ark: ... \ No newline at end of file From 2606fc585289d6e80a3561ce85e7b2601f0cc19e Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 08:44:41 -0500 Subject: [PATCH 05/17] Add type info for bitmap class --- core/grim/grim.pyi | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/grim/grim.pyi b/core/grim/grim.pyi index f97c895..c16bad7 100644 --- a/core/grim/grim.pyi +++ b/core/grim/grim.pyi @@ -12,4 +12,18 @@ class Ark: entries: list[ArkOffsetEntry] @staticmethod - def from_file_path(path: str) -> Ark: ... \ No newline at end of file + def from_file_path(path: str) -> Ark: ... + +class Bitmap: + bpp: int + encoding: int + mip_maps: int + width: int + height: int + bpl: int + raw_data: list[int] + + @staticmethod + def from_file_path(path: str) -> Bitmap: ... + + def save_to_file(path: str) -> None: ... \ No newline at end of file From 39b280866a3ec5d2c42d530933a3de1dc16176ee Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 08:45:51 -0500 Subject: [PATCH 06/17] Add python script for reading ark info --- scripts/read_ark.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/read_ark.py diff --git a/scripts/read_ark.py b/scripts/read_ark.py new file mode 100644 index 0000000..34c6581 --- /dev/null +++ b/scripts/read_ark.py @@ -0,0 +1,18 @@ +import grim +import sys + +def main(args: list[str]): + ark_path = args[0] + print(f'Opening ark from \'{ark_path}\'') + + ark = grim.Ark.from_file_path(ark_path) + ark_entries = ark.entries + + print(f'Ark: (version = {ark.version}, encryption = {ark.encryption})') + print(f'Found {len(ark_entries)} entries') + + for entry in ark_entries: + print(entry.path) + +if __name__ == '__main__': + main(sys.argv[1:]) \ No newline at end of file From 5c6096a429773d6929853acf7c667144c9728e48 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 18:04:22 -0500 Subject: [PATCH 07/17] Add python build instructions --- scripts/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/README.md diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..51059d9 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,22 @@ +## Setup Python Environment +```bash +python -m venv .env +. .env/Scripts/activate # Using Git Bash on Windows +pip install maturin +``` + +## Run (Development) +```bash +# Adds grim api as python module to current env +maturin develop -m ./core/grim/Cargo.toml --all-features +``` + +## Build and Install +```bash +# Build grim api as python module in target/wheels +maturin build -m ./core/grim/Cargo.toml --all-features -r + +# Use '--force-reinstall' to override pre-existing install +# Note: File name may be different depending on build target +pip install ./target/wheels/grim-0.1.0-cp310-none-win_amd64.whl --force-reinstall +``` \ No newline at end of file From 54be7937c27c8d305a82647cda35e192b64c5140 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 18:08:55 -0500 Subject: [PATCH 08/17] Build with all features in ci --- .github/workflows/audit.yml | 2 +- .github/workflows/ci.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 599be86..3038d27 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -53,7 +53,7 @@ jobs: - name: Build audit binaries shell: bash run: | - cargo auditable build --release --bins + cargo auditable build --release --bins --all-features - name: Audit binaries shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7a3afc..20af335 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: check + args: --all-features test: name: Test @@ -54,6 +55,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test + args: --all-features clippy: name: Clippy @@ -131,7 +133,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: build - args: --release --bins + args: --release --bins --all-features - name: Create output directory and copy licenses shell: bash run: | From 527ff447dbd3cffc478776d1204bab7f502b6018 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 18:21:59 -0500 Subject: [PATCH 09/17] Disable building all features --- .github/workflows/audit.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 3038d27..599be86 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -53,7 +53,7 @@ jobs: - name: Build audit binaries shell: bash run: | - cargo auditable build --release --bins --all-features + cargo auditable build --release --bins - name: Audit binaries shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20af335..94a0ada 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,7 +133,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: build - args: --release --bins --all-features + args: --release --bins - name: Create output directory and copy licenses shell: bash run: | From b5b00b192f094b8946f0210934896fbff4c31371 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 18:24:04 -0500 Subject: [PATCH 10/17] Remove 32-bit build --- .github/workflows/audit.yml | 5 +---- .github/workflows/ci.yml | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 599be86..66f0b1f 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -20,9 +20,6 @@ jobs: osname: "linux-x64" - os: windows-latest osname: "win-x64" - - os: windows-latest - osname: "win-x86" - toolchain: "stable-i686-pc-windows-msvc" env: BIN_PATH: ./target/release steps: @@ -43,7 +40,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: ${{ matrix.toolchain || 'stable' }} + toolchain: stable override: true - name: Install audit dependencies shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a0ada..79caa92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,9 +103,6 @@ jobs: osname: "linux-x64" - os: windows-latest osname: "win-x64" - - os: windows-latest - osname: "win-x86" - toolchain: "stable-i686-pc-windows-msvc" env: ZIP_NAME: ${{ github.event.repository.name }}-ci-${{ github.sha }}-${{ matrix.osname }} BIN_PATH: ./target/release @@ -128,7 +125,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: ${{ matrix.toolchain || 'stable' }} + toolchain: stable override: true - uses: actions-rs/cargo@v1 with: From 6259e2b65ac0b92e2d3fe92102027aec7c7993ac Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Thu, 18 Jan 2024 18:29:52 -0500 Subject: [PATCH 11/17] Add experimental feature to default build for mesh tool --- apps/cli/mesh_tool/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/cli/mesh_tool/Cargo.toml b/apps/cli/mesh_tool/Cargo.toml index f39b5df..e50118e 100644 --- a/apps/cli/mesh_tool/Cargo.toml +++ b/apps/cli/mesh_tool/Cargo.toml @@ -10,4 +10,5 @@ grim = { workspace = true, features = [ "model" ] } thiserror = { workspace = true } [features] +default = [ "experimental" ] experimental = [] \ No newline at end of file From 9c4874d9413d0da5b2faa86473659193a395d48b Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 21:22:02 -0500 Subject: [PATCH 12/17] Add build instructions to readme --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2d3952..70b6f56 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # Grim (Working Title) [![CI](https://github.com/PikminGuts92/grim/workflows/CI/badge.svg)](https://github.com/PikminGuts92/grim/actions?query=workflow%3ACI) -This project is intended to be a re-write of [Mackiloha](https://github.com/PikminGuts92/Mackiloha). - **UNDER CONSTRUCTION** -**DO NOT USE** \ No newline at end of file +This project is intended to be an evolution of [Mackiloha](https://github.com/PikminGuts92/Mackiloha). Overall design is still being worked on and python API should be considered unstable. The latest CI build can be found [here](https://github.com/PikminGuts92/grim/actions/workflows/ci.yml). + +# Build +Install **rustup** and **cargo** from [here](https://www.rust-lang.org/tools/install). Specific python module build instructions are in [scripts](scripts/). + +Run: `cargo build --release` \ No newline at end of file From 21496028e7a1823decb4c38896beead98092242a Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 21:25:10 -0500 Subject: [PATCH 13/17] Also specify cli is unstable --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70b6f56..b657c22 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Grim (Working Title) [![CI](https://github.com/PikminGuts92/grim/workflows/CI/badge.svg)](https://github.com/PikminGuts92/grim/actions?query=workflow%3ACI) **UNDER CONSTRUCTION** -This project is intended to be an evolution of [Mackiloha](https://github.com/PikminGuts92/Mackiloha). Overall design is still being worked on and python API should be considered unstable. The latest CI build can be found [here](https://github.com/PikminGuts92/grim/actions/workflows/ci.yml). +This project is intended to be an evolution of [Mackiloha](https://github.com/PikminGuts92/Mackiloha). Overall design is still being worked on. Command line interface and Python API should be considered unstable. The latest CI build can be found [here](https://github.com/PikminGuts92/grim/actions/workflows/ci.yml). # Build Install **rustup** and **cargo** from [here](https://www.rust-lang.org/tools/install). Specific python module build instructions are in [scripts](scripts/). From 98ba3d74358de0504f18094876af04cf96acb69e Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 21:37:51 -0500 Subject: [PATCH 14/17] Configure workspace linting --- Cargo.toml | 5 +++++ apps/cli/audio_tool/Cargo.toml | 5 ++++- apps/cli/audio_tool/src/main.rs | 2 -- apps/cli/mesh_tool/Cargo.toml | 5 ++++- apps/cli/mesh_tool/src/main.rs | 2 -- apps/cli/p9_scene_tool/Cargo.toml | 3 +++ apps/cli/p9_scene_tool/src/main.rs | 3 --- apps/cli/scene_tool/Cargo.toml | 3 +++ apps/cli/scene_tool/src/main.rs | 3 --- core/grim/Cargo.toml | 3 +++ core/grim/src/lib.rs | 3 --- core/grim/src/texture/dxt.rs | 2 -- core/grim_gltf/Cargo.toml | 5 ++++- core/grim_macros/Cargo.toml | 3 +++ core/grim_macros/src/lib.rs | 3 --- core/grim_traits/Cargo.toml | 3 +++ core/grim_traits/src/lib.rs | 2 -- utils/anim_preview/Cargo.toml | 3 +++ utils/anim_preview/src/main.rs | 3 --- utils/lipsync_preview/Cargo.toml | 3 +++ utils/lipsync_preview/src/main.rs | 3 --- utils/milo_export/Cargo.toml | 3 +++ utils/milo_export/src/main.rs | 3 --- 23 files changed, 41 insertions(+), 32 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e10d084..2820b60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,11 @@ serde_json = "1.0.111" simplelog = "0.12.1" thiserror = "1.0.56" +[workspace.lints.rust] +dead_code = "allow" +deprecated = "allow" +unused_imports = "allow" + [profile.dev.package."*"] opt-level = 3 diff --git a/apps/cli/audio_tool/Cargo.toml b/apps/cli/audio_tool/Cargo.toml index 18251a2..92d3c56 100644 --- a/apps/cli/audio_tool/Cargo.toml +++ b/apps/cli/audio_tool/Cargo.toml @@ -10,4 +10,7 @@ grim = { workspace = true, features = [ "audio" ] } thiserror = { workspace = true } [features] -encode = [ "grim/audio_experimental" ] \ No newline at end of file +encode = [ "grim/audio_experimental" ] + +[lints] +workspace = true \ No newline at end of file diff --git a/apps/cli/audio_tool/src/main.rs b/apps/cli/audio_tool/src/main.rs index 17d1107..f583895 100644 --- a/apps/cli/audio_tool/src/main.rs +++ b/apps/cli/audio_tool/src/main.rs @@ -1,5 +1,3 @@ -#![allow(unused_imports)] - mod apps; use apps::AudioTool; diff --git a/apps/cli/mesh_tool/Cargo.toml b/apps/cli/mesh_tool/Cargo.toml index e50118e..a581bb5 100644 --- a/apps/cli/mesh_tool/Cargo.toml +++ b/apps/cli/mesh_tool/Cargo.toml @@ -11,4 +11,7 @@ thiserror = { workspace = true } [features] default = [ "experimental" ] -experimental = [] \ No newline at end of file +experimental = [] + +[lints] +workspace = true \ No newline at end of file diff --git a/apps/cli/mesh_tool/src/main.rs b/apps/cli/mesh_tool/src/main.rs index fa5556e..a75d9dd 100644 --- a/apps/cli/mesh_tool/src/main.rs +++ b/apps/cli/mesh_tool/src/main.rs @@ -1,5 +1,3 @@ -#![allow(unused_imports)] - mod apps; use apps::MeshTool; diff --git a/apps/cli/p9_scene_tool/Cargo.toml b/apps/cli/p9_scene_tool/Cargo.toml index 15c9639..77abd8c 100644 --- a/apps/cli/p9_scene_tool/Cargo.toml +++ b/apps/cli/p9_scene_tool/Cargo.toml @@ -18,3 +18,6 @@ thiserror = { workspace = true } [dev-dependencies] criterion = "0.5.1" rstest = "0.18.2" + +[lints] +workspace = true \ No newline at end of file diff --git a/apps/cli/p9_scene_tool/src/main.rs b/apps/cli/p9_scene_tool/src/main.rs index afd3821..dd68a8b 100644 --- a/apps/cli/p9_scene_tool/src/main.rs +++ b/apps/cli/p9_scene_tool/src/main.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - mod apps; mod formatter; mod helpers; diff --git a/apps/cli/scene_tool/Cargo.toml b/apps/cli/scene_tool/Cargo.toml index 833adbb..3fb9f44 100644 --- a/apps/cli/scene_tool/Cargo.toml +++ b/apps/cli/scene_tool/Cargo.toml @@ -8,3 +8,6 @@ edition.workspace = true clap = { workspace = true } grim = { workspace = true, features = [ "midi" ] } thiserror = { workspace = true } + +[lints] +workspace = true \ No newline at end of file diff --git a/apps/cli/scene_tool/src/main.rs b/apps/cli/scene_tool/src/main.rs index 4cacd5a..e54efca 100644 --- a/apps/cli/scene_tool/src/main.rs +++ b/apps/cli/scene_tool/src/main.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - mod apps; use apps::SceneTool; diff --git a/core/grim/Cargo.toml b/core/grim/Cargo.toml index 7a5871d..427cf27 100644 --- a/core/grim/Cargo.toml +++ b/core/grim/Cargo.toml @@ -48,3 +48,6 @@ harness = false [lib] bench = false crate-type = [ "lib", "cdylib" ] + +[lints] +workspace = true \ No newline at end of file diff --git a/core/grim/src/lib.rs b/core/grim/src/lib.rs index 3c7172c..1ce8d63 100644 --- a/core/grim/src/lib.rs +++ b/core/grim/src/lib.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - pub mod ark; #[cfg(feature = "audio")] pub mod audio; pub mod dta; diff --git a/core/grim/src/texture/dxt.rs b/core/grim/src/texture/dxt.rs index 4b0782a..d92cabc 100644 --- a/core/grim/src/texture/dxt.rs +++ b/core/grim/src/texture/dxt.rs @@ -1,5 +1,3 @@ -#![allow(deprecated)] - use image::codecs::dxt::{DxtEncoder, DxtVariant}; // TODO: Remove deprecated types use rayon::prelude::*; use super::*; diff --git a/core/grim_gltf/Cargo.toml b/core/grim_gltf/Cargo.toml index ea6837e..7ce9841 100644 --- a/core/grim_gltf/Cargo.toml +++ b/core/grim_gltf/Cargo.toml @@ -8,4 +8,7 @@ edition.workspace = true gltf = { workspace = true } gltf-json = { workspace = true } itertools = { workspace = true } -serde = { workspace = true } \ No newline at end of file +serde = { workspace = true } + +[lints] +workspace = true \ No newline at end of file diff --git a/core/grim_macros/Cargo.toml b/core/grim_macros/Cargo.toml index 1b3f25e..e500b4d 100644 --- a/core/grim_macros/Cargo.toml +++ b/core/grim_macros/Cargo.toml @@ -13,3 +13,6 @@ lazy_static = { workspace = true } proc-macro2 = "1.0.76" quote = "1.0.35" syn = { version = "2.0.48", default-features = false, features = [ "clone-impls", "derive", "parsing", "printing", "proc-macro" ] } + +[lints] +workspace = true \ No newline at end of file diff --git a/core/grim_macros/src/lib.rs b/core/grim_macros/src/lib.rs index ec6b48b..fec2a28 100644 --- a/core/grim_macros/src/lib.rs +++ b/core/grim_macros/src/lib.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - use crate::scene::get_object_tokens; use crate::scene::get_milo_object_tokens; use proc_macro::TokenStream; diff --git a/core/grim_traits/Cargo.toml b/core/grim_traits/Cargo.toml index 5accff5..e745b89 100644 --- a/core/grim_traits/Cargo.toml +++ b/core/grim_traits/Cargo.toml @@ -3,3 +3,6 @@ name = "grim_traits" version.workspace = true authors.workspace = true edition.workspace = true + +[lints] +workspace = true \ No newline at end of file diff --git a/core/grim_traits/src/lib.rs b/core/grim_traits/src/lib.rs index abc55bf..ccbeeae 100644 --- a/core/grim_traits/src/lib.rs +++ b/core/grim_traits/src/lib.rs @@ -1,3 +1 @@ -#![allow(unused_imports)] - pub mod scene; diff --git a/utils/anim_preview/Cargo.toml b/utils/anim_preview/Cargo.toml index b03336d..00386a0 100644 --- a/utils/anim_preview/Cargo.toml +++ b/utils/anim_preview/Cargo.toml @@ -10,3 +10,6 @@ keyframe = "1.1.1" nalgebra = "0.32.3" rerun = { version = "0.12.0", features = [ "native_viewer" ] } shared = { path = "../shared" } + +[lints] +workspace = true \ No newline at end of file diff --git a/utils/anim_preview/src/main.rs b/utils/anim_preview/src/main.rs index d14bee0..6e543dd 100644 --- a/utils/anim_preview/src/main.rs +++ b/utils/anim_preview/src/main.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - use std::env; use std::error::Error; use std::collections::{HashMap, HashSet}; diff --git a/utils/lipsync_preview/Cargo.toml b/utils/lipsync_preview/Cargo.toml index 433904b..04b89ba 100644 --- a/utils/lipsync_preview/Cargo.toml +++ b/utils/lipsync_preview/Cargo.toml @@ -12,3 +12,6 @@ keyframe = "1.1.1" nalgebra = "0.32.3" #rerun = "0.2.0" shared = { path = "../shared" } + +[lints] +workspace = true \ No newline at end of file diff --git a/utils/lipsync_preview/src/main.rs b/utils/lipsync_preview/src/main.rs index 1056ed4..6871cfc 100644 --- a/utils/lipsync_preview/src/main.rs +++ b/utils/lipsync_preview/src/main.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - use std::collections::{HashMap, HashSet}; use std::error::Error; use std::io::prelude::*; diff --git a/utils/milo_export/Cargo.toml b/utils/milo_export/Cargo.toml index e426b6b..a555dcd 100644 --- a/utils/milo_export/Cargo.toml +++ b/utils/milo_export/Cargo.toml @@ -8,3 +8,6 @@ edition.workspace = true grim = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } + +[lints] +workspace = true \ No newline at end of file diff --git a/utils/milo_export/src/main.rs b/utils/milo_export/src/main.rs index e97163c..23878aa 100644 --- a/utils/milo_export/src/main.rs +++ b/utils/milo_export/src/main.rs @@ -1,6 +1,3 @@ -#![allow(dead_code)] -#![allow(unused_imports)] - mod helpers; //use grim::io::PathFinder; From 604fe0ac3a392426074765ef43276bac3292e79f Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 21:47:36 -0500 Subject: [PATCH 15/17] Fix linting issues --- Cargo.toml | 1 + apps/cli/audio_tool/src/apps/encode.rs | 4 ++-- core/grim/src/audio/xma.rs | 2 +- core/grim/src/dta/mod.rs | 2 +- core/grim/src/dta/parser.rs | 4 ++-- core/grim/src/model/export.rs | 8 ++++---- core/grim/src/scene/object_dir.rs | 2 +- utils/anim_preview/src/main.rs | 4 ++-- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2820b60..bf87795 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ thiserror = "1.0.56" [workspace.lints.rust] dead_code = "allow" deprecated = "allow" +unused_assignments = "allow" unused_imports = "allow" [profile.dev.package."*"] diff --git a/apps/cli/audio_tool/src/apps/encode.rs b/apps/cli/audio_tool/src/apps/encode.rs index 90b8612..71abae6 100644 --- a/apps/cli/audio_tool/src/apps/encode.rs +++ b/apps/cli/audio_tool/src/apps/encode.rs @@ -27,8 +27,8 @@ pub struct EncoderApp { impl SubApp for EncoderApp { fn process(&mut self) -> Result<(), Box> { - let input_path = Path::new(&self.input_path); - let output_path = Path::new(&self.output_path); + let _input_path = Path::new(&self.input_path); + let _output_path = Path::new(&self.output_path); todo!() //Ok(()) diff --git a/core/grim/src/audio/xma.rs b/core/grim/src/audio/xma.rs index 652079e..f93dd54 100644 --- a/core/grim/src/audio/xma.rs +++ b/core/grim/src/audio/xma.rs @@ -51,7 +51,7 @@ pub fn read_frame_length(reader: &mut BitReader) - } #[cfg(feature = "audio_experimental")] -pub fn decode_xma_packets(packets: &[u8], sample_count: i32) -> Result> { +pub fn decode_xma_packets(packets: &[u8], _sample_count: i32) -> Result> { let mut reader = BitReader::endian(Cursor::new(packets), BigEndian); let packet = PacketInfo::from_reader(&mut reader)?; diff --git a/core/grim/src/dta/mod.rs b/core/grim/src/dta/mod.rs index cce4cdc..b15f6f2 100644 --- a/core/grim/src/dta/mod.rs +++ b/core/grim/src/dta/mod.rs @@ -225,7 +225,7 @@ impl DataArray { stream.write_all(&v.data)?; }, //DataArray::Func(_) => 0x03, - DataArray::Object(o) => { + DataArray::Object(_o) => { todo!("Support object dta serialization") }, DataArray::Symbol(s) => { diff --git a/core/grim/src/dta/parser.rs b/core/grim/src/dta/parser.rs index c3c0ace..34d4b92 100644 --- a/core/grim/src/dta/parser.rs +++ b/core/grim/src/dta/parser.rs @@ -53,7 +53,7 @@ impl<'a> DTAParser<'a> { } fn parse_array(&mut self) -> Vec<(DataArray, usize)> { - let mut data = Vec::new(); + let data = Vec::new(); self.consume_whitespace(); // TODO: Consume comments @@ -346,7 +346,7 @@ fn parse_variable<'a>(text: &'a [u8]) -> IResult<&'a [u8], DataArray> { fn parse_kdata_unhandled<'a>(text: &'a [u8]) -> IResult<&'a [u8], DataArray> { map( all_consuming(tag("kDataUnhandled")), - |data: &'a [u8]| DataArray::KDataUnhandled + |_data: &'a [u8]| DataArray::KDataUnhandled )(text) } diff --git a/core/grim/src/model/export.rs b/core/grim/src/model/export.rs index 8d590ca..30167bc 100644 --- a/core/grim/src/model/export.rs +++ b/core/grim/src/model/export.rs @@ -426,7 +426,7 @@ impl GltfExporter { self.dirs_rc.clear(); - for (i, mut dir_entry) in self.object_dirs.drain(..).enumerate() { + for (_i, mut dir_entry) in self.object_dirs.drain(..).enumerate() { let entries = dir_entry.entries.drain(..).collect::>(); let parent = Rc::new(dir_entry); @@ -1849,7 +1849,7 @@ impl GltfExporter { let mut samplers = Vec::new(); // TODO: Delete after testing - let filtered_bone_names = HashSet::from([ + let _filtered_bone_names = HashSet::from([ //"bone_neck.mesh" "bone_spine1.mesh", "bone_spine2.mesh", @@ -1865,7 +1865,7 @@ impl GltfExporter { //.filter(|(b, _)| filtered_bone_names.contains(b.symbol.as_str())) .collect::>(); - for (mut bone, frames) in bone_samples { + for (mut bone, _frames) in bone_samples { let bone_name = bone.symbol.as_str(); let Some(node_idx) = node_map.get(bone_name).map(|i| *i) else { continue; @@ -1887,7 +1887,7 @@ impl GltfExporter { .unwrap_or_else(|| na::UnitQuaternion::identity()); // TODO: Add scaling transform samples... - let node_scale = node.scale + let _node_scale = node.scale .map(na::Vector3::from) .unwrap_or_else(|| na::Vector3::from_element(1.0)); diff --git a/core/grim/src/scene/object_dir.rs b/core/grim/src/scene/object_dir.rs index 806ea83..a14a371 100644 --- a/core/grim/src/scene/object_dir.rs +++ b/core/grim/src/scene/object_dir.rs @@ -1,4 +1,4 @@ -use crate::{SystemInfo}; +use crate::SystemInfo; use crate::io::{BinaryStream, FileSearchDepth, FileStream, MemoryStream, PathFinder, SeekFrom, Stream}; use crate::scene::*; use lazy_static::lazy_static; diff --git a/utils/anim_preview/src/main.rs b/utils/anim_preview/src/main.rs index 6e543dd..68d4e63 100644 --- a/utils/anim_preview/src/main.rs +++ b/utils/anim_preview/src/main.rs @@ -17,7 +17,7 @@ use rerun::{ components::{LineStrip3D, Position3D, Radius, Scalar, Transform3D, ViewCoordinates}, RecordingStream, RecordingStreamBuilder, time::Timeline, - transform::{TranslationRotationScale3D}, + transform::TranslationRotationScale3D, }; use rerun::{Arrows3D, Points3D}; @@ -419,7 +419,7 @@ impl<'a> BoneNode<'a> { } if let Some(rotz) = rotz { - let (roll, pitch, yaw) = rotate.euler_angles(); + let (_roll, _pitch, _yaw) = rotate.euler_angles(); //println!("({}, {}, {})", roll, pitch, yaw); //rotate = na::UnitQuaternion::from_euler_angles(roll, pitch, std::f32::consts::PI * rotz); From 355f31458137018e92dabc05aba852399861e97c Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 22:01:07 -0500 Subject: [PATCH 16/17] Remove cargo/toolchain actions and clippy check --- .github/workflows/audit.yml | 5 --- .github/workflows/ci.yml | 68 ++++++------------------------------- 2 files changed, 10 insertions(+), 63 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 66f0b1f..f36f49f 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -37,11 +37,6 @@ jobs: ~/.cargo/ target/ key: ${{ matrix.osname }}-cargo-audit-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - name: Install audit dependencies shell: bash run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79caa92..6f8162e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,15 +20,10 @@ jobs: ~/.cargo/ target/ key: ${{ runner.os }}-cargo-check-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features + - name: Cargo check + shell: bash + run: | + cargo check --all-features test: name: Test @@ -47,48 +42,10 @@ jobs: ~/.cargo/ target/ key: ${{ runner.os }}-cargo-test-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features - - clippy: - name: Clippy - if: ${{ false }} # Always skip job (for now) - runs-on: ubuntu-latest - steps: - - name: Install linux dependencies + - name: Cargo test shell: bash run: | - sudo apt-get update - sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev - sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev - - uses: actions/checkout@v2 - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/ - target/ - key: ${{ runner.os }}-cargo-clippy-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + cargo test --all-features build: name: Build (${{ matrix.osname }}) @@ -122,15 +79,10 @@ jobs: ~/.cargo/ target/ key: ${{ matrix.osname }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --bins + - name: Cargo build + shell: bash + run: | + cargo build --release --bins - name: Create output directory and copy licenses shell: bash run: | From 7b3e4c25b7ad2fe2d122637fb3f2bdca7dd9d0f5 Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Fri, 19 Jan 2024 22:07:16 -0500 Subject: [PATCH 17/17] Update actions dependency versions --- .github/workflows/audit.yml | 4 ++-- .github/workflows/ci.yml | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index f36f49f..f0d4f1f 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -30,8 +30,8 @@ jobs: sudo apt-get update sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev - - uses: actions/checkout@v2 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f8162e..bfcf73d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: sudo apt-get update sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev - - uses: actions/checkout@v2 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/ @@ -35,8 +35,8 @@ jobs: sudo apt-get update sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev - - uses: actions/checkout@v2 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/ @@ -72,8 +72,8 @@ jobs: sudo apt-get update sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev - - uses: actions/checkout@v2 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/ @@ -95,7 +95,7 @@ jobs: for exe in $(find $BIN_PATH -maxdepth 1 -type f ${{ matrix.os == 'macos-latest' && '-perm +0111' || '-executable' }} -print); do cp -f $exe $OUTPUT_PATH/$(basename $exe) done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ env.ZIP_NAME }} path: ${{ env.OUTPUT_PATH }}/* \ No newline at end of file